[squeak-dev] SIGTRAP when Proceeding from BlockCannotReturn

Jaromir Matas mail at jaromir.net
Sun May 8 17:15:22 UTC 2022


Hi again,

                From: Nicolas Cellier
                Sent: Sunday, May 8, 2022 18:16
                To: The general-purpose Squeak developers list
                Subject: Re: [squeak-dev] SIGTRAP when Proceeding from BlockCannotReturn

                > I have the impression that DelayWaitTimeout depends on the old primitiveSuspend (#88) behavior:

                signalWaitingProcess
                     "Release the given process from the semaphore it is waiting on.
                     This method relies on running at highest priority so that it cannot be preempted
                     by the process being released."
                     beingWaitedOn := false.
                     "Release the process but only if it is still waiting on its original list"
                     process suspendingList == delaySemaphore ifTrue:[
                         expired := true.
                         process suspend; resume.
                     ].
                > My understanding is that this code assumes that suspending, then resuming will remove the waiting process from the list.

                Yes, that’s exactly the problem; I’m enclosing the fix:

                signalWaitingProcess
                                "Release the given process from the semaphore it is waiting on.
                                This method relies on running at highest priority so that it cannot be preempted
                                by the process being released."
                                | list |
                                beingWaitedOn := false.
                                "Release the process but only if it is still waiting on its original list"
                                (list := process suspendingList) == delaySemaphore ifTrue:[
                                                expired := true.
                                                list remove: self ifAbsent:[].
                                                process offList; resume]

                Maybe it's `list remove: process ifAbsent: []` instead.

Oh my, I have no idea why I put ‘self’ in there :) Thanks!

                Excavating offList usage would require an update of its comment...

Ha ha, "excavating offList" :D

                Also, see why manipulating the list from within the image might be dangerous
                http://forum.world.st/Process-gt-gt-terminate-woes-td69405.html

Thank you, very interesting... sounds like this fix may be too tricky without using #suspend

Best,
Jaromir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220508/254f5855/attachment.html>


More information about the Squeak-dev mailing list