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

Tim Rowledge tim at sumeru.stanford.edu
Sun Apr 23 04:34:54 UTC 2000



John M McIntosh wrote:

> 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.

Yes this is very odd. I couldn't causethe problem for thelongest time,
but now I can hardly _not_ cause it!

The first thing  Idid  of course was to scan for repeats of the
signed/unsigend char mistake. Can't find any yet, but I did spot a
wierdo  in the insert smaples prim.
I am using the cPtrAsOop construct from AndyG's testPlugin framework (
and must say I am very impressed, and there is a reasonable chance that
2.8 updates have already fixed some of the stuff I have been hacking for
this bug) which turns
	buf cPtrAsOop
into 
	(int)(buf -4)
which seems fine (and is a good encapsulation of the -BaseHeaderSIze
idiom) EXCEPT if buf happens to be something other than an int or char *
-- obviously it will do something quite other if buf is int * !! Now in
the insert smaples prim, but happens to be declard as unsigned * - which
IIRC is shorthand (deprecated, I thought) for unsigend int *. So, buf -4
is actually <16> bytes before buf, not 4 :-) 

Obvisouly this left me a bit puzzled as to how the prim could _ever_
work. To further add ot the oddness, it works almost exactly as well (or
badly) as before when 'fixed'.

<head scratching>
tim
</head scratching?





More information about the Squeak-dev mailing list