Quantcast

Oops - I put a halt in a startup method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Oops - I put a halt in a startup method

Sean P. DeNigris
Administrator
My image appears for an instant and then crashes. Is there any way to recover from this?

Thanks.
Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

Henrik Sperre Johansen
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-tp3800163p3800163.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
Dropbox? ;)

Cheers,
Henry

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

Mariano Martinez Peck
In reply to this post by Sean P. DeNigris
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 <[hidden email]> 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-tp3800163p3800163.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

Sean P. DeNigris
Administrator
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...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

Eliot Miranda-2
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 <[hidden email]> 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-tp3800163p3800230.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.




--
best,
Eliot

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

Sean P. DeNigris
Administrator
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
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

Sean P. DeNigris
Administrator
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
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

Sean P. DeNigris
Administrator
In reply to this post by Sean P. DeNigris
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
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

Stéphane Ducasse
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-tp3800163p3802931.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

Mariano Martinez Peck
In reply to this post by Sean P. DeNigris
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 <[hidden email]> 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-tp3800163p3802931.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oops - I put a halt in a startup method

ccrraaiigg
In reply to this post by Sean P. DeNigris

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



Loading...