GemTalk / PharoGemStoneFFI

GemStone GCI access via Pharo FFI
MIT License
1 stars 4 forks source link

gci error handling (part 1 - click on Explorer in launcher) #6

Open dalehenrich opened 3 years ago

dalehenrich commented 3 years ago

In an attempt to test the new GCI Error handling in SparkleFFI, I added Exception new _signalGciError. to RsrSendMessage>>executeFor: (picked at random):

executeFor: aConnection

    | resolver servicesStrongly receiver selector arguments messageSend |
Exception new _signalGciError.

The GCI connection is opened and when I click on the Explorer buttonm I get the following Pharo error:

UndefinedObject(Object)>>doesNotUnderstand: #addDefaultExplorer
UndefinedObject>>doesNotUnderstand: #addDefaultExplorer
SparkleTaskspace>>addDefaultExplorer
SpkGCIConnectionProfile(SpkConnectionProfile)>>openExplorer
SpkConnectionListPresenter>>openExplorer
[ self openExplorer ] in SpkConnectionListPresenter>>initializeToolbar in Block: [ self openExplorer ]
FullBlockClosure(BlockClosure)>>cull:
SpMorphicToolbarButtonAdapter>>execute
[ :anAdapter | anAdapter execute ] in SpToolbarButtonPresenter>>execute in Block: [ :anAdapter | anAdapter execute ]
FullBlockClosure(BlockClosure)>>cull:
SpMorphicToolbarButtonAdapter(ProtoObject)>>ifNotNil:
SpToolbarButtonPresenter(SpAbstractPresenter)>>withAdapterDo:
SpToolbarButtonPresenter>>execute
SpToolbarButtonMorph(PluggableButtonMorph)>>performAction:
[:m |
        (m containsPoint: evt cursorPoint) ifTrue: [m enabled ifTrue: [ m performAction: evt ]]] in SpToolbarButtonMorph(PluggableButtonMorph)>>mouseUp: in Block: [:m |...
Array(SequenceableCollection)>>do:
SpToolbarButtonMorph(PluggableButtonMorph)>>mouseUp:
SpToolbarButtonMorph(Morph)>>handleMouseUp:
MouseButtonEvent>>sentTo:
SpToolbarButtonMorph(Morph)>>handleEvent:
SpToolbarButtonMorph(Morph)>>handleFocusEvent:
[
        result := focusHolder handleFocusEvent: transformedEvent.
    ] in HandMorph>>sendFocusEvent:to:clear: in Block: [...
FullBlockClosure(BlockClosure)>>on:do:
WorldMorph>>becomeActiveDuring:
HandMorph>>sendFocusEvent:to:clear:
HandMorph>>sendEvent:focus:clear:
HandMorph>>sendMouseEvent:
HandMorph>>handleEvent:
[
        (morphicWorld activeHand isNotNil and: [ anEvent hand isNotNil ]) ifTrue: [
            morphicWorld activeHand handleEvent: anEvent
        ]
    ] in OSWindowMorphicEventHandler>>dispatchMorphicEvent: in Block: [...
WorldState>>runStepMethodsIn:

At this point, I'm not sure why the gci error is not being seen ... and can't tell if the explorer or RSR is masking the error or what ... the same thing happens if I put a halt in the same place ...

dalehenrich commented 3 years ago

We're not getting the error from FFI as I was expecting, but while playing around I did see an FFI error come up along with a number of other errors, so the mystery is why is there a delayed or missing response to the GCI error ... I will spend some more time next week digging a bit deeper into things to see what's happening ...

dalehenrich commented 3 years ago

As a first step I left the Exception new _signalGciError. line in and did a direct connection to a server running in topaz and got an immediate error:

waiting for connection
got a connection
-----------------------------------------------------
GemStone: Error         Nonfatal
a Exception occurred (error 2702)
Error Category: 231169 [GemStone] Number: 2702  Arg Count: 1 Context : 20 exception : 125241089
Arg 1: [20 size:0 primitiveSize:0 cls: 76289 UndefinedObject] nil
topaz > exec iferr 1 : stk 
==> 1 RsrSendMessage >> executeFor:                 @4 line 5   [methId 123051521]
2 [] in RsrConnection >> _receivedCommand:      @10 line 7   [methId 115243521]
3 [] in RsrProcessModel >> fork:named:          @7 line 5   [methId 113168641]
4 ExecBlock >> valueWithArguments:              @1 line 7   [methId 5637377]
5 GsProcess >> _start                           @7 line 16   [methId 6437633]
6 GsNMethod class >> _gsReturnToC               @1 line 11   [methId 5464577]
  [GsProcess 125240833]
Stopping at line 60 of /home/dhenrich/rogue/_homes/rogue/_home/server/stones/RSR_l/runSparkleServer.tpz
topaz 1> where
==> 1 RsrSendMessage >> executeFor:                 @4 line 5   [methId 123051521]
2 [] in RsrConnection >> _receivedCommand:      @10 line 7   [methId 115243521]
3 [] in RsrProcessModel >> fork:named:          @7 line 5   [methId 113168641]
4 ExecBlock >> valueWithArguments:              @1 line 7   [methId 5637377]
5 GsProcess >> _start                           @7 line 16   [methId 6437633]
6 GsNMethod class >> _gsReturnToC               @1 line 11   [methId 5464577]
  [GsProcess 125240833]
topaz 1> fr 2
2 [] in RsrConnection >> _receivedCommand:      @10 line 7   [methId 115243521]
    self [125227009 size:0 primitiveSize:8 cls: 108230913 RsrConnection] aRsrConnection
    receiver [125226497 size:0 primitiveSize:5 cls: 127745 ExecBlock0] anExecBlock0
    self [125227009 size:0 primitiveSize:8 cls: 108230913 RsrConnection] aRsrConnection
    aCommand [125223937 size:0 primitiveSize:5 cls: 108201473 RsrSendMessage] aRsrSendMessage
    .t1 [125227265 size:2 primitiveSize:5 cls: 134913 VariableContext] aVariableContext
    .t2 [125223937 size:0 primitiveSize:5 cls: 108201473 RsrSendMessage] aRsrSendMessage
    .t3 [125227009 size:0 primitiveSize:8 cls: 108230913 RsrConnection] aRsrConnection
    _VC [125227265 size:2 primitiveSize:5 cls: 134913 VariableContext] aVariableContext
topaz 1> obj2 @125223937
[125223937 size:0 primitiveSize:5 cls: 108201473 RsrSendMessage] a RsrSendMessage
  snapshots           [125220865 size:1 primitiveSize:1 cls: 66817 Array] a Array
    #1 [125220353 size:0 primitiveSize:3 cls: 108233217 RsrServiceSnapshot] a RsrServiceSnapshot
  transaction         [18446744073709551610 size:0 primitiveSize:0 cls: 74241 SmallInteger] -1 == 0xffffffffffffffff
  receiverReference [125219841 size:0 primitiveSize:1 cls: 108268033 RsrServiceReference] a RsrServiceReference
    sid                 [18446744073709551610 size:0 primitiveSize:0 cls: 74241 SmallInteger] -1 == 0xffffffffffffffff
  selectorReference [125219329 size:0 primitiveSize:1 cls: 108271873 RsrSymbolReference] a RsrSymbolReference
    intermediate        [125218817 size:25 primitiveSize:25 cls: 103425 ByteArray] newDefaultTaskspaceLayout
  argumentReferences [125218305 size:0 primitiveSize:0 cls: 66817 Array] a Array

So at least for a direct connect logic the GCI error is being caught almost immediately ... when the same thing is done from pharo there is no immediate error, but the MNU for #addDefaultExplorer is a side efect of the #newDefaultTakspaceLayout command not returning a value ... and I would have expected that the gci error would have been delivered to the FFI side immediately ?