[Pharo-project] Oops - I put a halt in a startup method
My image appears for an instant and then crashes. Is there any way to recover from this? Thanks. Sean -- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380016... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
On 08.09.2011 23:20, Sean P. DeNigris wrote:
My image appears for an instant and then crashes. Is there any way to recover from this?
Thanks. Sean
-- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380016... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Dropbox? ;) Cheers, Henry
Not sure in which order the startUpList is, but maybe sending a .st to the vm when startin that does "Compiler compile: ... " to overwrite your method... But I guess this code will be called after the startup :( On Thu, Sep 8, 2011 at 11:20 PM, Sean P. DeNigris <sean@clipperadams.com>wrote:
My image appears for an instant and then crashes. Is there any way to recover from this?
Thanks. Sean
-- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380016... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
-- Mariano http://marianopeck.wordpress.com
Mariano Martinez Peck wrote:
maybe sending a .st to the vm when starting
Yeah, I had the same thought, but the .st doesn't get processed before the image crashes. Maybe I can build a debug VM and make perform:with: a no-op... -- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380023... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
or (in a debugger on the VM) set a breakpoint when the interpreter reaches the send instruction and simply increment the instruction pointer. If the halt is only reached once this will work well. On Thu, Sep 8, 2011 at 2:44 PM, Sean P. DeNigris <sean@clipperadams.com>wrote:
Mariano Martinez Peck wrote:
maybe sending a .st to the vm when starting
Yeah, I had the same thought, but the .st doesn't get processed before the image crashes. Maybe I can build a debug VM and make perform:with: a no-op...
-- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380023... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
-- best, Eliot
Okay, I found primitivePerform in the VM. I want to break on this call: FeaturesDB perform: #startUp: with: resuming How will I know which call to skip/break on? Maybe there is there a way, from the VM side, to get the class name as a string? If I knew that the receiver was FeaturesDB, that would be the one... Thanks. Sean -- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380036... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Hmm... I guessed at random until setting "ignore 3 times before stopping" stopped the image from crashing... yay! Except then my whole computer was hijacked by the image. Everything was running in the background e.g. iTunes was playing and I could play/pause. I wonder if it has to do with the image running in fullscreen? Anyway, I already had to hard reset twice, so I'm reluctant to experiment further in that direction. Anyway, I guess now it would be *really* great to know the name of the receiver so that I can put a conditional in the method, since the breakpoint was a no-go... Sean -- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380040... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Huge thanks to Igor and Mariano. I recovered the image. Just in case anyone ever has a similar problem, the solution was: 1. Test for selector in CoInterpreter>>commonSend ... (messageSelector = #halt) ifFalse: [ "the conditional was added" self internalFindNewMethod. self internalExecuteNewMethod ]. self fetchNextBytecode. 2. Manually edit the condition in gcc3x-cointerp.c: char* realSelector = GIV(messageSelector) + BaseHeaderSize; if (strncmp(realSelector, "halt", 4) == 0) puts("Skipping halt..."); else { ... Although I lost the better part of a day, it's a very powerful feeling to start building basic VM skills and know that errors that used to be magical and fatal can now be resolved... Cheers, Sean -- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380293... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
I'm impressed and I should do the same than you. Jumping into fire. Stef On Sep 10, 2011, at 12:20 AM, Sean P. DeNigris wrote:
Huge thanks to Igor and Mariano. I recovered the image. Just in case anyone ever has a similar problem, the solution was:
1. Test for selector in CoInterpreter>>commonSend ... (messageSelector = #halt) ifFalse: [ "the conditional was added" self internalFindNewMethod. self internalExecuteNewMethod ].
self fetchNextBytecode.
2. Manually edit the condition in gcc3x-cointerp.c: char* realSelector = GIV(messageSelector) + BaseHeaderSize; if (strncmp(realSelector, "halt", 4) == 0) puts("Skipping halt..."); else { ...
Although I lost the better part of a day, it's a very powerful feeling to start building basic VM skills and know that errors that used to be magical and fatal can now be resolved...
Cheers, Sean
-- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380293... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
WOW. Sean that is super cool. I have to admit I never thought you were gonna be able to di it. This is awesome and I've been there (but never took the time to solve it). Please, do a blog post! On Sat, Sep 10, 2011 at 12:20 AM, Sean P. DeNigris <sean@clipperadams.com>wrote:
Huge thanks to Igor and Mariano. I recovered the image. Just in case anyone ever has a similar problem, the solution was:
1. Test for selector in CoInterpreter>>commonSend ... (messageSelector = #halt) ifFalse: [ "the conditional was added" self internalFindNewMethod. self internalExecuteNewMethod ].
self fetchNextBytecode.
2. Manually edit the condition in gcc3x-cointerp.c: char* realSelector = GIV(messageSelector) + BaseHeaderSize; if (strncmp(realSelector, "halt", 4) == 0) puts("Skipping halt..."); else { ...
Although I lost the better part of a day, it's a very powerful feeling to start building basic VM skills and know that errors that used to be magical and fatal can now be resolved...
Cheers, Sean
-- View this message in context: http://forum.world.st/Oops-I-put-a-halt-in-a-startup-method-tp3800163p380293... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
-- Mariano http://marianopeck.wordpress.com
Hi Sean--
...it's a very powerful feeling to start building basic VM skills and know that errors that used to be magical and fatal can now be resolved...
Yay! Also note that you can make object memory snapshots at any point from either the VM simulator or gdb... -C -- Craig Latta www.netjam.org/resume +31 6 2757 7177 + 1 415 287 3547
participants (6)
-
Craig Latta -
Eliot Miranda -
Henrik Sperre Johansen -
Mariano Martinez Peck -
Sean P. DeNigris -
Stéphane Ducasse