The Inbox: Kernel-jar.1375.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Kernel-jar.1375.mcz

commits-2
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-jar.1375.mcz

==================== Summary ====================

Name: Kernel-jar.1375
Author: jar
Time: 28 February 2021, 1:39:18.242036 pm
UUID: 5fa0cf53-5852-2949-b7f0-a13d8729925b
Ancestors: Kernel-codefrau.1374

Fix Process class >> #forContext:priority: potentially crashing image

=============== Diff against Kernel-codefrau.1374 ===============

Item was changed:
  ----- Method: Process class>>forContext:priority: (in category 'instance creation') -----
  forContext: aContext priority: anInteger
  "Answer an instance of me that has suspended aContext at priority
  anInteger."
 
  | newProcess |
  newProcess := self new.
+ newProcess suspendedContext: aContext asContext.
- newProcess suspendedContext: aContext.
  newProcess priority: anInteger.
  ^newProcess!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-jar.1375.mcz

Jaromir Matas
#forContext:priority: may cause image crash when supplying e.g. a block
instead of a context:

(save your image first!)

create a new process:

   p := Process forContext: ["whatever"] priority: Processor activePriority

and then try to start a Process Browser or just do-it:

   p isTerminated

The thing is both Process Browser and #isTerminated send `suspendedContext
isBottomContext` and that fails, starting a debugger and in some cases
windows start popping up...

I guess the easiest and safest fix is to send #asContext to the aContext
argument in #forContext:priority:

If not then a condition has to be added to make sure the aContext argument
really is a context.

regards,



-----
^[^ Jaromir
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

^[^ Jaromir