Faculty of Information Technology
Software Engineering Group

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#9 closed defect (fixed)

VM SIGSEGV crash when using MOP

Reported by: kursjan Owned by: Jan Vraný
Priority: major Milestone: milestone:
Component: VM support Keywords: VM crash, Lookup
Cc: hlopkmar

Description (last modified by kursjan)

Use case:

  • Run ST/X, build #130
  • load and initialize java
  • Run following tests - they should pass
    testJavaCounter>>testIsKindOf
    testJavaCounter>>testJavaCounter
    
  • Execute following code:
    (Java classForName: 'java.lang.Object') lookupObject: FooLookup instance.
    
  • Run following tests:
    StInJavaTests>>testIsKindOf
    StInJavaTests>>testJavaCounter
    
  • The VM crashes during the second test

Please not that FooLookup object does nothing - it delegates logic to the BuiltinLookup. It should not affect standard lookup anyhow...

Change History (11)

comment:1 Changed 10 years ago by Jan Vraný

It seems that the lookup MOP somehow corrupts context sender chain on C stack - it
pushes one temporary context plus contexts required to execute arbitrary smalltalk code.
Observation: in certain situations context->c_sender contains garbage causing context chain patchup to SEGFAULT. Sometimes it context->c_sender is the context - causing endless loop in VM. I suspect incorrect __thisContext manipulation (jinterpret.c?) when using MOP. However, this is just a wild guess, further investigation needed.

comment:2 Changed 10 years ago by Jan Vraný

Cc: hlopkmar added
Status: newtesting

The librun r27 should contain a fix/workaround for the bug described above. The problem was that the thisContext pointed to garbage after a context switch, but only iff a lookup object was set for a class. The reason why is still unclear to me. The fix/workaround
detects that situation and fixes the thisContext value so the sender chain is valid.
Please, test it...

comment:3 Changed 10 years ago by kursjan

comment:4 Changed 10 years ago by kursjan

Status: testingneeds_work

Rake based build 50, same use case, VM crashes.

comment:5 Changed 10 years ago by kursjan

Description: modified (diff)

comment:6 Changed 10 years ago by Jan Vraný

Milestone: M1 - Maintenance
Status: needs_worktesting
Summary: Strange behaviour while using LookupObjectVM SIGSEGV crash when using MOP

Try out build 160. It seemed that GCC generates a big shit when both -fPIC and -O2 is on, sigh. At least, it works fine on Ubuntu machine Jan provided me. Note, that issue #53 may mave different origin. Will look at it later.

BTW: Tests should pass but they don't.

comment:7 Changed 10 years ago by kursjan

Tried Rake build 62 - It does not start VM - see my report in email.

Tried Standard build 153 (no build 160 found) - still crashes :(

comment:8 in reply to:  7 Changed 10 years ago by kursjan

Replying to kursjan:

Tried Rake build 62 - It does not start VM - see my report in email.

Tried Standard build 153 (no build 160 found) - still crashes :(

Mea Culpa, rake build 62 works.

comment:9 Changed 10 years ago by hlopkmar

everything works for me, VM doesn't crash, tests pass, nothing special written to console output, ticket 53 fixed as well.. It's gonna be a nice day today :)
[edit]
sorry, lookup hook is there, but not after running testIsKindOf and testJavaCounter. Only testJavaCounter2 and testJavaCounterWithStObject write it.

Last edited 10 years ago by hlopkmar (previous) (diff)

comment:10 Changed 10 years ago by Jan Vraný

Resolution: fixed
Status: testingclosed

Fine, closing the ticket, hopefully once forever.

comment:11 Changed 9 years ago by Jan Vraný

Milestone: M1 - Maintenance

Milestone M1 - Maintenance deleted

Note: See TracTickets for help on using tickets.