Win Tims Money! a.k.a. find my sockets bug!

John M McIntosh johnmci at smalltalkconsulting.com
Sat Apr 22 00:07:33 UTC 2000


> I'm pretty sure it went like this:
> 
> The IP address was the four bytes:
>
> D0 DA 03 01 (208.218.3.1)
>
> But as signed 32-bit values, they are:
>
> FFFFFFD0 FFFFFFDA 00000003 00000001
>
> After shifting each byte by the appropriate bits, we then added:
>
> D0000000
> FFDA0000
> 00000300
> 00000001
>
> which gives us:
>
> CFDA0301
>
> which is what John discovered

Between flights I can again comment.
What Duane reports is true, the compiler cheerfully sign extends the byte,
shifts it then adds them all together.

I can't claim the full amount since I didn't provide a good solution, but I
knew that Tim was heading to the mountains today and I had a plane to catch
so I didn't want him to fret about this issue on his drive today, thus I
posted an early partial solution for other to solve in a more elegant
manner.

What made this problem interesting is that it only shows itself if you use a
particular set of address, and those address map to a nonexistent IP. Is
that IP you just pinged the one you thought it was, meaning of course your
test suite needs to be more picky about the results.

But onwards, let's not forget the other problem I saw in the sound stuff:
===========

Ok I tried the PluckedSound bachFugue play again. This time it worked.
However if I do command '.' and close the user interrupt dialog (breakpoint
in InputSensor) then redo the PluckedSound message then a good 50% of the
time I get hung up with a repetitive note and when I do command '.' again up
pops the primitive failed dialog after the user interrupt dialog in
InputSensor.

Now I went back and attempted this same action with a 2.7 image didn't have
ANY problems.
===========

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Custom Macintosh programming & various Smalltalk dialects
PGP Key: DSS/Diff/46FC3BE6
Fingerprint=B22F 7D67 92B7 5D52 72D7  E94A EE69 2D21 46FC 3BE6
===========================================================================





More information about the Squeak-dev mailing list