On Fri, Aug 25, 2017 at 12:09 PM, Konstantin Khomoutov <kos...@bswap.ru>
wrote:

> On Fri, Aug 25, 2017 at 08:39:29AM -0700, Tong Sun wrote:
>
> > I'm experiencing a *very very* strange problem now -- the same Go code is
> > producing different results *for me*.
> [...]
> > Can someone verify for me what you get please?
> >
> > go get github.com/go-dedup/fsimilar
> >
> > then
> >
> > cd go-dedup/fsimilar
> > go build
> > find test/sim -type f | ./fsimilar -i -d 12 -vv
> >
> > and tell me what's the last output that you got please.
> >
> > The problem is that *two *of my machines produce:
> >
> > [fsimilar] ## Similar items
> >  map[Similars:[map[Hash:6184610222622303958 Dist:0 SizeRef:1 Name:GNU -
> > 2001 - Python Standard Library Ext:.pdf Size:1 Dir:test/sim/]
> map[Name:GNU
> > - Python Standard Library (2001) Ext:.rar Size:1 Dir:test/sim/
> > Hash:6184610222622303958 Dist:0 SizeRef:1]]].
> > *test/sim/GNU - 2001 - Python Standard Library.pdf*
> > *test/sim/GNU - Python Standard Library (2001).rar*
> >
> > But another one, the *only one*, produce:
> [...]
>
> Two quick points:
>
> * What happens if you copy the "working" binary to the "wrong" machine
>   and run it there?
>
>   Does it work?
>

Ah, good idea. Previously I was copying the bad code into good machine, and
the result is the bad code works in the good machine.

Now I copy the good code into bad machine, and the result is good code
doesn't work in bad machine any more.

Giving that the original source is pulled from the same git, with same
status, adding these *three things* up *I'm sure the code are the same now*
-- the only different is the machine.



>   I mean, you should rule out possible inconsistencies with build
>   systems.  This means both Go and all the graph of the libraries
>   your project uses.  If you're building on each machine, try doing
>   clean-room building.  This means freshly cloning the Go source code
>   of, say, the 1.8 release branch and building it.  Then copying over
>   the whole hierarchy of the whole branch of the dependencies from the
>   "working" machine into a new directory which must be a Go workspace.
>   Then building there.
>

All three machines are using the same golang ubuntu packages:

$ apt-cache policy golang-1.8-go
golang-1.8-go:
  Installed: 1.8.1-1ubuntu1
  Candidate: 1.8.1-1ubuntu1

I'll try download go binary from go source next.


> * This bit [1] smells bad IMO.
>
>   From the quick glance I failed to see where it's used but
>   why it's there?  What happens if you seed PRNG with a constant?
>
> 1. https://github.com/go-dedup/fsimilar/blob/master/fsimilarCLICmd.go#L70
>

Yeah, you are right, it is not used at all. It is copied there for future
features that I haven't put in yet.
So we can rule that out.



Can someone try it out for me and see what you got please?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to