feenkcom / gt4gemstone-old

The Glamorous Toolkit for remote work with Gemstone/S
MIT License
13 stars 5 forks source link

Remote Debugging Fails - GsGciLostSessionError #53

Open regkrock opened 7 years ago

regkrock commented 7 years ago

I attempted to remote debug (from a remote playground) the code below. The remote debugging failed with a GsGciLostSessionError.

OrderedCollection new add: 1; add: 2; yourself

All of the other remote menu options worked.

Server: a Gt4Gemstone 3.3.3 stone - no GsDevKit tools loaded in the server or client. Client: Pharo 5.0 using the GtGsBareClient.

chisandrei commented 7 years ago

I tried but cannot reproduce this. Can you provide more details? Does it happen every time you log in and execute this code? Does it happen any time you open the debugger?

regkrock commented 7 years ago

Hi Andrei,

I have this problem with any code I execute from inside the workspace.

Let me know what other information I can give you.

Regards,

Reg

==== The following is what I do ========

I open a new Pharo 5 and login.

Then I open a remote playground and enter the code. I can inspect it, print it, etc with no problem. It is when I debug that I get the problem.

Then I receive the session time out.

And this is the end of the stack. (Is Fuel the way to get the entire stack?)

GsGci32xErrSType>>asLocalObjectFor: GsGci32xErrSType>>asLocalObjectFor:ifNotConverted: GsGciSession>>send:to:withArgs: GtGsBareClient(TDMinimalClient)>>send:to:withArgs: GtGsDebuggerSessionProxy>>initializeForGemstoneClient:andNotification: GtGsDebuggerSessionProxy class>>forClient:andNotification:in: GtGsBareClient(GtGsMinimalClient)>>debuggerRequested: TDRuntimeError>>defaultAction UndefinedObject>>handleSignal: TDRuntimeError(Exception)>>signal TDErrorNotification(TDNotification)>>defaultRuntimeError TDErrorNotification(TDNotification)>>defaultAction UndefinedObject>>handleSignal: TDErrorNotification(Exception)>>signal GsGci32xErrSType>>asLocalObjectFor: GsGci32xErrSType>>asLocalObjectFor:ifNotConverted: GsGciSession>>send:to:withArgs: GtGsBareClient(TDMinimalClient)>>send:to:withArgs: GtGsDebuggerSessionProxy>>initializeForGemstoneClient:andNotification: GtGsDebuggerSessionProxy class>>forClient:andNotification:in: GtGsBareClient(GtGsMinimalClient)>>debuggerRequested: TDRuntimeError>>defaultAction UndefinedObject>>handleSignal: TDRuntimeError(Exception)>>signal TDErrorNotification(TDNotification)>>defaultRuntimeError TDErrorNotification(TDNotification)>>defaultAction UndefinedObject>>handleSignal: TDErrorNotification(Exception)>>signal GsGci32xErrSType>>asLocalObjectFor: GsGci32xErrSType>>asLocalObjectFor:ifNotConverted:

On 10 May2017, at 6:08 PM, Andrei Chis <notifications@github.com mailto:notifications@github.com> wrote:

I tried but cannot reproduce this. Can you provide more details? Does it happen every time you log in and execute this code? Does it happen any time you open the debugger?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/feenkcom/gt4gemstone/issues/53#issuecomment-300627154, or mute the thread https://github.com/notifications/unsubscribe-auth/AHM16s2k7qm7mtYhVTUWoPFuDNkir9ghks5r4jVrgaJpZM4NW6vf.

chisandrei commented 7 years ago

What do you mean by 'no GsDevKit tools loaded in the server or client.'?

regkrock commented 7 years ago

HI,

None of the GsDevKit code was loaded in the client(Pharo 5) and in the server. It is just Gt4Gemstone code.

However, I did some more testing and if I connect to a server with GsDevKit code loaded in it the same problem occurs.

Regards,

Reg

On 11 May2017, at 11:03 AM, Andrei Chis <notifications@github.com mailto:notifications@github.com> wrote:

What do you mean by 'no GsDevKit tools loaded in the server or client.'?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/feenkcom/gt4gemstone/issues/53#issuecomment-300817778, or mute the thread https://github.com/notifications/unsubscribe-auth/AHM16r_n47Myj7eKT3d9oiOj0uAjditTks5r4yNYgaJpZM4NW6vf.

chisandrei commented 7 years ago

What code/instructions did you use to create the client/server?

You can try to debug by putting a breakpoint in GtGsMinimalClient>>debuggerRequested:. If a debugger appears there was an error in the gemstone side. You can then select and execute 'GtGsGenericStackDebugger openBasicStackViewerFor: gsNotification from: self'. This will open a transcript with the gemstone stack. If this also doesn't work then these is a deeper problem. Then after executing the code above you can click proceed in the debugger. If a second debugger opens then there was an error while opening the debugger. You can execute again 'GtGsGenericStackDebugger openBasicStackViewerFor: gsNotification from: self' to see what the error was that prevents the debugger from opening.

regkrock commented 7 years ago

Summary: Gemstone is returning a 2010 error.

I have detailed what is happening. I executed the code you suggested and the results are shown in (B) below. If I missed something please let me know.

Regards,

Reg

This is what is happening:

A) REGULAR DEBUGGER

1) I put a breakpoint in GtGsMinimalClient>>debuggerRequested: 2) In the remote playground, I enter the following code, select it and do a ‘remote debug’. 3) Breakpoint is executed and execution stops in #debuggerRequested: gsNotification —> “a Halt occurred (error 2709)" effectiveApiVersion —> 1.3.0 serverApiVersion —> 1.4.0 4) I then stepped into the code highlighted in red.

GtGsMinimalClient>>debuggerRequested: returnValue
    | gsNotification |
    gsNotification := thisContext sender receiver.

    GtGsGenericStackDebugger useBasicStackViewer 
        ifTrue: [
            GtGsGenericStackDebugger openBasicStackViewerFor: gsNotification from: self ]
        ifFalse: [
            GtGsGenericStackDebugger debugSession: (GtGsDebuggerSessionProxy 
                forClient: self andNotification: gsNotification in: Processor activeProcess).].

^ nil

5) Then into GtGsDebuggerSessionProxy class >>forClient: aGsClient andNotification: gsNotification in: aClientProcess

    ^ self new  
        initializeClientSessionForProcess: aClientProcess;
        initializeForGemstoneClient: aGsClient andNotification: gsNotification;
        yourself

6) Then into GtGsDebuggerSessionProxy>>initializeForGemstoneClient: aGsClient andNotification: aGsNotification | gemstoneDebuggerSessionOopType | gemstoneClient := aGsClient. gemstoneNotification := aGsNotification. gemstoneDebuggerSession := self gemstoneClient objectSerializer fromString: (self gemstoneClient send: #buildDebuggerSessionForException:fromProcess: to: self gemstoneClient todeServerOopType withArgs: {gemstoneNotification exceptionOopType . gemstoneNotification contextOopType}). self logStackToFileIfNeeded. gemstoneDebuggerSessionOopType := gemstoneDebuggerSession selfForwarderOop gciResultToGsOopType: self gemstoneClient session. self gemstoneClient session registerClientObjectForwarderOopType: gemstoneDebuggerSessionOopType for: self. self clientSession ifNotNil: [ :aSession | aSession name: self name ]

7) Then into TDMinimalClient>>send: selector to: receiver withArgs: args | response startTime |

GtGsSessionIntiateRequestSignal asClassIfPresent: [ :signal | signal emitForRequest: selector fromClient: self to: receiver withArgs: args ].

    startTime := DateAndTime now. 
    response := self session send: selector to: receiver withArgs: args. 
    #GtGsSessionResponseSuccessSignal asClassIfPresent: [ :signal | signal emitForRequest: selector fromClient: self to: receiver withArgs: args withResponse: response startedAt: startTime ]. 
    ^ response

    selector —> buildDebuggerSessionForException:fromProcess:

8) Then into GsGciSession>>send: selector to: receiver withArgs: args | receiverOopType arrayOfGsOopTypes result | receiverOopType := receiver localObjectToGciOopType: self. arrayOfGsOopTypes := args collect: [ :each | each localObjectToGciOopType: self ]. result := self gciPerform: receiverOopType selector: selector args: arrayOfGsOopTypes flags: 0 environmentId: 0. ^ result asLocalObjectFor: self ifNotConverted: [:resultGciOopType | resultGciOopType]

    result —> "GemStone Error (2010): a MessageNotUnderstood occurred (error 2010), a GtGsDebuggerStackFrame does not understand  #'theSelf’"

In ErrorToExceptionMap, error 2010 is not defined. Therefore the default error, TDErrorNotification is returned.

B) GtsGenericStackDebugger>>openBasicStackViewerFor:

On 11 May2017, at 4:52 PM, Andrei Chis <notifications@github.com mailto:notifications@github.com> wrote:

What code/instructions did you use to create the client/server?

You can try to debug by putting a breakpoint in GtGsMinimalClient>>debuggerRequested:. If a debugger appears there was an error in the gemstone side. You can then select and execute 'GtGsGenericStackDebugger openBasicStackViewerFor: gsNotification from: self'. This will open a transcript with the gemstone stack. If this also doesn't work then these is a deeper problem. Then after executing the code above you can click proceed in the debugger. If a second debugger opens then there was an error while opening the debugger. You can execute again 'GtGsGenericStackDebugger openBasicStackViewerFor: gsNotification from: self' to see what the error was that prevents the debugger from opening.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/feenkcom/gt4gemstone/issues/53#issuecomment-300913478, or mute the thread https://github.com/notifications/unsubscribe-auth/AHM16kDhMTKQyTVskHHsght95yJ-7xQBks5r43T7gaJpZM4NW6vf.

chisandrei commented 7 years ago

Based on the error it seems that the is some issues with the tODE version. Can you go to $GS_HOME/shared/repos/tode and do a git status. Is the project on the dev branch? If not switch to the dev branch, update and then update gt4gemstone from the client. If the debugger then works I think I'll need to update the installation instructions.

regkrock commented 7 years ago

The git status is:

rk:tode regkrock$ pwd
/Users/regkrock/GsDevKit_home/shared/repos/tode
rk:tode regkrock$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

I am a Git newbie, how do I change the branh.

regkrock commented 7 years ago

My mistake. Re-opened.

chisandrei commented 7 years ago

Try: git checkout dev git pull

regkrock commented 7 years ago

It now works!!!! 1) I changed to the dev stream and pulled the dev stream. 2) I loaded gt4gemstone in the server: gtClient := GtGsMinimalClient forSessionDescriptionNamed: SCIGemStoneServerConfigSpec defaultSessionName. gtClient evaluateCommandStream: 'project load Gt4Gemstone' readStream . gtClient evaluateCommandStream: 'commit' readStream. 3) Debugger now works!!!!!

regkrock commented 7 years ago

IMPACT ON STARTING SEASIDE IN TODE CLIENT

Stone - 3.3.5

1) In a pristine devKit_33 server with only the seaside loaded on top of the virgin stone, I was able to start the seaside server with no problems. /home/seaside/gemServer —start=seaside 2) I loaded the Gt4Gemstone code into an existing GsDevKit stone (devKit_33) I was still able to start the seaside server with no problems. 3) I created a Gt4Gemstone client (Pharo 5.0) following the instructions listed on GitHub. Remote debugging failed. 4) I then applied the patch as described in this issue. a) cd /Users/regkrock/GsDevKit_home/shared/repos/tode b) git status On branch master Your branch is up-to-date with 'origin/master’. nothing to commit, working tree clean c) Changed to dev stream git checkout dev git pull d) I then applied the changes from Gt4Gemstone client from the local playground. gtClient := GtGsMinimalClient forSessionDescriptionNamed: SCIGemStoneServerConfigSpec defaultSessionName. gtClient evaluateCommandStream: 'project load Gt4Gemstone' readStream. gtClient evaluateCommandStream: 'commit' readStream. 5) In TODE1 client I did an abort and tried to start the seaside server /home/seaside/gemServer —start=seaside

The start failed and I needed to comment out the two classes FastCGISeasideGemServer and SwazooSeasideGemServer in order to get script to work

dalehenrich commented 7 years ago

I assume that this is an issue with the dev branch version of tODE and not specifically related to gt4gemstone --- however I have not characterized the problem, yet ... I will try to find time over the weekend to run some experiments and see if I can figure things out