Hi Vanessa,
I think this might be caused by a known issue that is tracked here: https://github.com/squeak-smalltalk/squeak-object-memory/issues/92
How exactly did you invoke the debugger? How does your process browser look before and after the invocation?
Best, Christoph
________________________________ Von: vm-dev-request@lists.squeakfoundation.org vm-dev-request@lists.squeakfoundation.org Gesendet: Samstag, November 25, 2023 12:31:49 PM An: vm-dev@lists.squeakfoundation.org vm-dev@lists.squeakfoundation.org Betreff: Vm-dev Digest, Vol 209, Issue 21
Send Vm-dev mailing list submissions to vm-dev@lists.squeakfoundation.org
To subscribe or unsubscribe via email, send a message with subject or body 'help' to vm-dev-request@lists.squeakfoundation.org
You can reach the person managing the list at vm-dev-owner@lists.squeakfoundation.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Vm-dev digest..."
I don’t think that’s it, because it does work fine on the standard VM, just not on the SqueakJS VM.
In a work space, “self halt” and do-it does not work (buttons are disabled). Instead, “self halt” and debug-it does work (buttons are enabled).
SqueakJS does not implement all primitives, some optional ones are missing. So that could be a reason. Or it could be a bug in a primitive somewhere.
The problem appears to be that the debugger’s interruptedProcess’s myLink is an empty list instead of nil.
Vanessa
On Sat, Nov 25, 2023 at 13:57 Thiede, Christoph < Christoph.Thiede@student.hpi.uni-potsdam.de> wrote:
Hi Vanessa,
I think this might be caused by a known issue that is tracked here: https://github.com/squeak-smalltalk/squeak-object-memory/issues/92
How exactly did you invoke the debugger? How does your process browser look before and after the invocation?
Best, Christoph
*Von:* vm-dev-request@lists.squeakfoundation.org < vm-dev-request@lists.squeakfoundation.org> *Gesendet:* Samstag, November 25, 2023 12:31:49 PM *An:* vm-dev@lists.squeakfoundation.org <vm-dev@lists.squeakfoundation.org
*Betreff:* Vm-dev Digest, Vol 209, Issue 21
Send Vm-dev mailing list submissions to vm-dev@lists.squeakfoundation.org
To subscribe or unsubscribe via email, send a message with subject or body 'help' to vm-dev-request@lists.squeakfoundation.org
You can reach the person managing the list at vm-dev-owner@lists.squeakfoundation.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Vm-dev digest..."
I found the issue:
At some point the semantics of suspending the active process changed. Now, the newly activated process gets its myList set to nil, whereas before, myList was kept.
To wit, in an old VM:
Processor activeProcess suspendingList ==> a LinkedList()
whereas on a current VM
Processor activeProcess suspendingList ==> nil
I'm not sure if old images would care if the list was set to nil, but now SqueakJS does set the list to nil for closure images.
I just committed that one-line fix :)
Vanessa
On Sun, Nov 26, 2023 at 1:38 AM Vanessa Freudenberg vanessa@codefrau.net wrote:
I don’t think that’s it, because it does work fine on the standard VM, just not on the SqueakJS VM.
In a work space, “self halt” and do-it does not work (buttons are disabled). Instead, “self halt” and debug-it does work (buttons are enabled).
SqueakJS does not implement all primitives, some optional ones are missing. So that could be a reason. Or it could be a bug in a primitive somewhere.
The problem appears to be that the debugger’s interruptedProcess’s myLink is an empty list instead of nil.
Vanessa
On Sat, Nov 25, 2023 at 13:57 Thiede, Christoph < Christoph.Thiede@student.hpi.uni-potsdam.de> wrote:
Hi Vanessa,
I think this might be caused by a known issue that is tracked here: https://github.com/squeak-smalltalk/squeak-object-memory/issues/92
How exactly did you invoke the debugger? How does your process browser look before and after the invocation?
Best, Christoph
*Von:* vm-dev-request@lists.squeakfoundation.org < vm-dev-request@lists.squeakfoundation.org> *Gesendet:* Samstag, November 25, 2023 12:31:49 PM *An:* vm-dev@lists.squeakfoundation.org < vm-dev@lists.squeakfoundation.org> *Betreff:* Vm-dev Digest, Vol 209, Issue 21
Send Vm-dev mailing list submissions to vm-dev@lists.squeakfoundation.org
To subscribe or unsubscribe via email, send a message with subject or body 'help' to vm-dev-request@lists.squeakfoundation.org
You can reach the person managing the list at vm-dev-owner@lists.squeakfoundation.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Vm-dev digest..."
Hi Vanessa --
Great! :-)
We had no #isSuspended checks in the Debugger GUI before Squeak6.0. That's probably why this issue did not surface.
Best, Marcel
Am 27.11.2023 23:16:04 schrieb Vanessa Freudenberg vanessa@codefrau.net:
Hi Vanessa,
Thanks for posting this. I think I have been seeing similar symptoms in the debugger with a V3 trunk image on classic interpreter VM, but I did not know where to look for the problem until I read this.
It is hugely convenient that SqueakJS has function names that match the selectors in Squeak VMMaker. I was able to look at https://github.com/codefrau/SqueakJS/commit/4haf915baaaac3a5d078b09eb7c3abd5... to see what needed to be changed in the interpreter VM.
I think that your one line fix needs to go into the interpreter VM too. As you say, it's hard to know if old images will be affected by the change, so I think your approach of changing the semantics only for closure images seems like a safe choice.
Having said that, I don't think there are any recent opensmalltalk-vm changes that affect this. If I'm reading this right, StackInterpreter>>transferTo: has been nilling out myList in Process since at least 2014, so the oscog VMs and the interpreter VM have probably behaved differently in this regard for a long time.
I am guessiing that something in Squeak trunk has changed recently in some way that depends on the opensmalltalk-vm behavior. I don't know what it is, but maybe someone with better understanding the the debugger can confirm?
Based on the the method comment in Process>>suspendingList I would say that opensmalltalk-vm has it right, and the interpreter VM (and SqueakJS) should also nil out myList. I am not sure, but I doubt that any early images will notice the difference, so the check for closure images may not be needed.
Dave
On 2023-11-27 22:13, Vanessa Freudenberg wrote:
I found the issue:
At some point the semantics of suspending the active process changed. Now, the newly activated process gets its myList set to nil, whereas before, myList was kept.
To wit, in an old VM:
Processor activeProcess suspendingList ==> a LinkedList()
whereas on a current VM
Processor activeProcess suspendingList ==> nil I'm not sure if old images would care if the list was set to nil, but now SqueakJS does set the list to nil for closure images.
I just committed that one-line fix :)
Vanessa
On Sun, Nov 26, 2023 at 1:38 AM Vanessa Freudenberg vanessa@codefrau.net wrote:
I don't think that's it, because it does work fine on the standard VM, just not on the SqueakJS VM.
In a work space, "self halt" and do-it does not work (buttons are disabled). Instead, "self halt" and debug-it does work (buttons are enabled).
SqueakJS does not implement all primitives, some optional ones are missing. So that could be a reason. Or it could be a bug in a primitive somewhere.
The problem appears to be that the debugger's interruptedProcess's myLink is an empty list instead of nil.
Vanessa
On Sat, Nov 25, 2023 at 13:57 Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de wrote:
Hi Vanessa,
I think this might be caused by a known issue that is tracked here: https://github.com/squeak-smalltalk/squeak-object-memory/issues/92
How exactly did you invoke the debugger? How does your process browser look before and after the invocation?
Best, Christoph
Von: vm-dev-request@lists.squeakfoundation.org vm-dev-request@lists.squeakfoundation.org Gesendet: Samstag, November 25, 2023 12:31:49 PM An: vm-dev@lists.squeakfoundation.org vm-dev@lists.squeakfoundation.org Betreff: Vm-dev Digest, Vol 209, Issue 21 Send Vm-dev mailing list submissions to vm-dev@lists.squeakfoundation.org
To subscribe or unsubscribe via email, send a message with subject or body 'help' to vm-dev-request@lists.squeakfoundation.org
You can reach the person managing the list at vm-dev-owner@lists.squeakfoundation.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Vm-dev digest..."
On 2023-12-02T23:59:09+00:00, lewis@mail.msen.com wrote:
Hi Vanessa,
Thanks for posting this. I think I have been seeing similar symptoms in the debugger with a V3 trunk image on classic interpreter VM, but I did not know where to look for the problem until I read this.
It is hugely convenient that SqueakJS has function names that match the selectors in Squeak VMMaker. I was able to look at https://github.com/codefrau/SqueakJS/commit/4haf915baaaac3a5d078b09eb7c3abd5... to see what needed to be changed in the interpreter VM.
I think that your one line fix needs to go into the interpreter VM too. As you say, it's hard to know if old images will be affected by the change, so I think your approach of changing the semantics only for closure images seems like a safe choice.
Having said that, I don't think there are any recent opensmalltalk-vm changes that affect this. If I'm reading this right, StackInterpreter>>transferTo: has been nilling out myList in Process since at least 2014, so the oscog VMs and the interpreter VM have probably behaved differently in this regard for a long time.
I am guessiing that something in Squeak trunk has changed recently in some way that depends on the opensmalltalk-vm behavior. I don't know what it is, but maybe someone with better understanding the the debugger can confirm?
I think Jaromir has reworked some of the Process state test selectors recently. The debugger tests for #isSuspended as #isTerminated in Debugger>>#interruptedProcessIsReady. Jaromir, is there a chance that you could help here? :-)
Based on the the method comment in Process>>suspendingList I would say that opensmalltalk-vm has it right, and the interpreter VM (and SqueakJS) should also nil out myList. I am not sure, but I doubt that any early images will notice the difference, so the check for closure images may not be needed.
Dave
On 2023-11-27 22:13, Vanessa Freudenberg wrote:
I found the issue:
At some point the semantics of suspending the active process changed. Now, the newly activated process gets its myList set to nil, whereas before, myList was kept.
To wit, in an old VM:
Processor activeProcess suspendingList ==> a LinkedList()
whereas on a current VM
Processor activeProcess suspendingList ==> nil I'm not sure if old images would care if the list was set to nil, but now SqueakJS does set the list to nil for closure images.
I just committed that one-line fix :)
Vanessa
On Sun, Nov 26, 2023 at 1:38 AM Vanessa Freudenberg <vanessa(a)codefrau.net> wrote:
I don't think that's it, because it does work fine on the standard VM, just not on the SqueakJS VM.
In a work space, "self halt" and do-it does not work (buttons are disabled). Instead, "self halt" and debug-it does work (buttons are enabled).
SqueakJS does not implement all primitives, some optional ones are missing. So that could be a reason. Or it could be a bug in a primitive somewhere.
The problem appears to be that the debugger's interruptedProcess's myLink is an empty list instead of nil.
Vanessa
On Sat, Nov 25, 2023 at 13:57 Thiede, Christoph <Christoph.Thiede(a)student.hpi.uni-potsdam.de> wrote:
Hi Vanessa,
I think this might be caused by a known issue that is tracked here: https://github.com/squeak-smalltalk/squeak-object-memory/issues/92
How exactly did you invoke the debugger? How does your process browser look before and after the invocation?
Best, Christoph
Von: vm-dev-request(a)lists.squeakfoundation.org <vm-dev-request(a)lists.squeakfoundation.org> Gesendet: Samstag, November 25, 2023 12:31:49 PM An: vm-dev(a)lists.squeakfoundation.org <vm-dev(a)lists.squeakfoundation.org> Betreff: Vm-dev Digest, Vol 209, Issue 21 Send Vm-dev mailing list submissions to vm-dev(a)lists.squeakfoundation.org
To subscribe or unsubscribe via email, send a message with subject or body 'help' to vm-dev-request(a)lists.squeakfoundation.org
You can reach the person managing the list at vm-dev-owner(a)lists.squeakfoundation.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Vm-dev digest..."
Best, Christoph
--- Sent from Squeak Inbox Talk
Hi Christoph, Dave, Vanessa,
On 03-Dec-23 1:11:01 AM, christoph.thiede@student.hpi.uni-potsdam.de wrote:
On 2023-12-02T23:59:09+00:00, lewis@mail.msen.com wrote:
Hi Vanessa,
Thanks for posting this. I think I have been seeing similar symptoms in
the debugger with a V3 trunk image on classic interpreter VM, but I did
not know where to look for the problem until I read this.
It is hugely convenient that SqueakJS has function names that match the
selectors in Squeak VMMaker. I was able to look at https://github.com/codefrau/SqueakJS/commit/4haf915baaaac3a5d078b09eb7c3abd5... https://github.com/codefrau/SqueakJS/commit/4haf915baaaac3a5d078b09eb7c3abd55ca66ffdc3
to see what needed to be changed in the interpreter VM.
I think that your one line fix needs to go into the interpreter VM too.
As you say, it's hard to know if old images will be affected by the
change, so I think your approach of changing the semantics only for
closure images seems like a safe choice.
Having said that, I don't think there are any recent opensmalltalk-vm
changes that affect this. If I'm reading this right,
StackInterpreter>>transferTo: has been nilling out myList in Process
since at least 2014, so the oscog VMs and the interpreter VM have
probably behaved differently in this regard for a long time.
I am guessiing that something in Squeak trunk has changed recently in
some way that depends on the opensmalltalk-vm behavior. I don't know
what it is, but maybe someone with better understanding the the debugger
can confirm?
I think Jaromir has reworked some of the Process state test selectors recently. The debugger tests for #isSuspended as #isTerminated in Debugger>>#interruptedProcessIsReady. Jaromir, is there a chance that you could help here? :-)
Not sure I have anything to contribute here; yes, I did some cleaning up in #isTerminated and #isSuspended in 2021 but nothing related to the myList aka suspendingList bahavior. The idea was to make the process states mutually exclusive and make sure the list of the five process states is exhaustive (i.e. a process must be in one of these states at any time: running, ready, blocked, suspended, terminated). I guess the latter is fulfilled but the former may not even be desirable: Squeak's isRunnable includes both running plus ready states, and I'm not sure we can prove a process can't be blocked and suspended at the same time (in Pharo it can). Just to humor you :) However, thanks to your discussion I finally start to understand why Pharo's #isSuspended includes a line `myList isNil or: [ myList isEmpty ]` it must be an obsolete remnant from before 2014 with the old semantics of suspending the active process! Thanks :) Christoph, please correct me if I'm wrong: interruptedProcessIsReady ^ interruptedProcess notNil and: [interruptedProcess isSuspended "do not debug the active process"] and: [interruptedProcess isTerminated not] the test for `interruptedProcess isTerminated not` seems unnecessary to me because it's already contained in the `interruptedProcess isSuspended` part. This may not have been so before 2021 but it is now. Thanks, Jaromir
Based on the the method comment in Process>>suspendingList I would say
that opensmalltalk-vm has it right, and the interpreter VM (and
SqueakJS) should also nil out myList. I am not sure, but I doubt that
any early images will notice the difference, so the check for closure
images may not be needed.
Dave
On 2023-11-27 22:13, Vanessa Freudenberg wrote:
I found the issue:
At some point the semantics of suspending the active process changed.
Now, the newly activated process gets its myList set to nil, whereas
before, myList was kept.
To wit, in an old VM:
Processor activeProcess suspendingList
==> a LinkedList()
whereas on a current VM
Processor activeProcess suspendingList
==> nil
I'm not sure if old images would care if the list was set to nil, but
now SqueakJS does set the list to nil for closure images.
I just committed that one-line fix :)
Vanessa
On Sun, Nov 26, 2023 at 1:38 AM Vanessa Freudenberg
<vanessa(a)codefrau.net> wrote:
I don't think that's it, because it does work fine on the standard VM,
just not on the SqueakJS VM.
In a work space, "self halt" and do-it does not work (buttons are
disabled). Instead, "self halt" and debug-it does work (buttons are
enabled).
SqueakJS does not implement all primitives, some optional ones are
missing. So that could be a reason. Or it could be a bug in a primitive
somewhere.
The problem appears to be that the debugger's interruptedProcess's
myLink is an empty list instead of nil.
Vanessa
On Sat, Nov 25, 2023 at 13:57 Thiede, Christoph
<Christoph.Thiede(a)student.hpi.uni-potsdam.de> wrote:
Hi Vanessa,
I think this might be caused by a known issue that is tracked here:
https://github.com/squeak-smalltalk/squeak-object-memory/issues/92
How exactly did you invoke the debugger? How does your process browser
look before and after the invocation?
Best,
Christoph
Von: vm-dev-request(a)lists.squeakfoundation.org
<vm-dev-request(a)lists.squeakfoundation.org>
Gesendet: Samstag, November 25, 2023 12:31:49 PM
An: vm-dev(a)lists.squeakfoundation.org
<vm-dev(a)lists.squeakfoundation.org>
Betreff: Vm-dev Digest, Vol 209, Issue 21
Send Vm-dev mailing list submissions to
vm-dev(a)lists.squeakfoundation.org
To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
vm-dev-request(a)lists.squeakfoundation.org
You can reach the person managing the list at
vm-dev-owner(a)lists.squeakfoundation.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Vm-dev digest..."
Best,
Christoph
Sent from Squeak Inbox Talk
On Sun, Dec 3, 2023 at 01:10 Jaromir Matas mail@jaromir.net wrote:
However, thanks to your discussion I finally start to understand why Pharo's #isSuspended includes a line `myList isNil or: [ myList isEmpty ]` it must be an obsolete remnant from before 2014 with the old semantics of suspending the active process! Thanks :)
Ah yes if that was the implementation, I’d probably not have noticed the difference in semantics.
However, I suspect that this is still incorrect, because if there was another process runnable on the same priority level, it would still answer false. Wouldn’t it have to be “(myList includes: self) not”?
My guess is that setting myList to nil when activating a process was an optimization by Eliot to avoid that potentially expensive test. This would make sense since Andreas’s Tweak used tons of UI processes, and Cog was developed right around that time. I wonder if a Croquet image of that time would be enlightening …
Eliot, do you remember?
Vanessa
On 03-Dec-23 6:00:05 PM, "Vanessa Freudenberg" vanessa@codefrau.net wrote:
On Sun, Dec 3, 2023 at 01:10 Jaromir Matas mail@jaromir.net wrote:
However, thanks to your discussion I finally start to understand why Pharo's #isSuspended includes a line `myList isNil or: [ myList isEmpty ]` it must be an obsolete remnant from before 2014 with the old semantics of suspending the active process! Thanks :)
Ah yes if that was the implementation, I’d probably not have noticed the difference in semantics.
However, I suspect that this is still incorrect, because if there was another process runnable on the same priority level, it would still answer false. Wouldn’t it have to be “(myList includes: self) not”?
Exactly what I wondered, whether an active process was assigned a _new_ empty list rather than nil (why would that be advantageous?) because otherwise would hold what you said.
Actually, at that time a suspended process test was `myList isNil` so maybe, hypothetically, myList isNil identified a suspended process while myList isEmpty identified the active process :) Eliot must enlighten us.
My guess is that setting myList to nil when activating a process was an optimization by Eliot to avoid that potentially expensive test. This would make sense since Andreas’s Tweak used tons of UI processes, and Cog was developed right around that time. I wonder if a Croquet image of that time would be enlightening …
Eliot, do you remember?
Vanessa
If I understand this correctly, myList can also encode the waiting list for a certain semaphore, not just the current priority list.
Best, Marcel
Am 03.12.2023 18:02:26 schrieb Vanessa Freudenberg vanessa@codefrau.net:
True, but the difference is a Semaphore or Mutex (a condition variable in general) uses a subclass of LinkedList for myList values. Being an instance of LinkedList is a defining property of priority lists - at least this was my understanding but the truth is the current implementation of #isRunnable and #isBlocked allows a condition variable use any list other than a priority list; I've never realized that. Is it just a theoretical possibility or is it really used somewhere? Thanks, Jaromir
On 04-Dec-23 3:53:01 PM, "Taeumel, Marcel" Marcel.Taeumel@hpi.de wrote:
If I understand this correctly, myList can also encode the waiting list for a certain semaphore, not just the current priority list.
Best, Marcel
Am 03.12.2023 18:02:26 schrieb Vanessa Freudenberg vanessa@codefrau.net:
Well, Leon is working on the threaded VM and there is at least a(nother) list for (Squeak) processes being in external calls (aka. OS threads)... :-)
Am 04.12.2023 17:26:00 schrieb Jaromir Matas mail@jaromir.net:
True, but the difference is a Semaphore or Mutex (a condition variable in general) uses a subclass of LinkedList for myList values. Being an instance of LinkedList is a defining property of priority lists - at least this was my understanding but the truth is the current implementation of #isRunnable and #isBlocked allows a condition variable use any list other than a priority list; I've never realized that. Is it just a theoretical possibility or is it really used somewhere? Thanks, Jaromir
On 04-Dec-23 3:53:01 PM, "Taeumel, Marcel" <Marcel.Taeumel@hpi.demailto:Marcel.Taeumel@hpi.de> wrote:
If I understand this correctly, myList can also encode the waiting list for a certain semaphore, not just the current priority list.
Best, Marcel
Am 03.12.2023 18:02:26 schrieb Vanessa Freudenberg <vanessa@codefrau.netmailto:vanessa@codefrau.net>:
vm-dev@lists.squeakfoundation.org