hpi-swa / RSqueak

A Squeak/Smalltalk VM written in RPython.
BSD 3-Clause "New" or "Revised" License
83 stars 15 forks source link

SystemTracer broken #104

Closed matthias-springer closed 9 years ago

matthias-springer commented 9 years ago

It has something to do with this commit: d392a089dec1a747e247d3e33100a5286248129d

Works when this commit is reverted.

The images produced by the system tracer are broken.

################################################################RPython traceback:
  File "implement.c", line 237, in safe_entry_point
  File "implement.c", line 3168, in entry_point
  File "spyvm_squeakimage.c", line 1172, in ImageReader_read_all
  File "spyvm_squeakimage.c", line 2230, in ImageReader_read_body
  File "spyvm_squeakimage.c", line 6383, in ImageReader_read_object
  File "spyvm_squeakimage.c", line 9424, in ImageReader_read_3wordobjectheader
Fatal RPython error: AssertionError
[1]    73459 abort      ./rsqueak /tmp/imgd000999999999
matthias-springer commented 9 years ago

@krono Any ideas what this could be? Seems to be some edge case. The size of the produced image file looks fine.

krono commented 9 years ago

What about 6e8a4a435e90fb27eee1e8926b9fcd7438f4b69f ?

krono commented 9 years ago

What if you add W_CompiledMethod here?

                if isinstance(w_obj, model.W_AbstractObjectWithClassReference):
matthias-springer commented 9 years ago

Does not solve the problem. In fact, it seems to crash earlier now and the error message changed (ImageReader_read_2wordobjectheader instead of ImageReader_read_3wordobjectheader).

################RPython traceback:
  File "implement.c", line 236, in safe_entry_point
  File "implement.c", line 3170, in entry_point
  File "spyvm_squeakimage.c", line 1167, in ImageReader_read_all
  File "spyvm_squeakimage.c", line 2219, in ImageReader_read_body
  File "spyvm_squeakimage.c", line 6402, in ImageReader_read_object
  File "spyvm_squeakimage.c", line 10147, in ImageReader_read_2wordobjectheader
Fatal RPython error: AssertionError
[1]    85076 abort      ./rsqueak /tmp/imgd333999999999
matthias-springer commented 9 years ago

Also tried replacing W_AbstractObjectWithClassReference with W_Object.

krono commented 9 years ago

Have you looked at what objects get written in the first place?

abstraktor commented 9 years ago

writing images out with current master 1fad9b26 will still make the images crash when opening it

################RPython traceback:
  File "implement.c", line 236, in safe_entry_point
  File "implement.c", line 3172, in entry_point
  File "spyvm_squeakimage.c", line 1173, in ImageReader_read_all
  File "spyvm_squeakimage.c", line 2208, in ImageReader_read_body
  File "spyvm_squeakimage.c", line 6374, in ImageReader_read_object
  File "spyvm_squeakimage.c", line 10128, in ImageReader_read_2wordobjectheader
Fatal RPython error: AssertionError
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x994be69a __pthread_kill + 10
1   libsystem_pthread.dylib         0x95a94f19 pthread_kill + 101
2   libsystem_c.dylib               0x90066eee abort + 156
3   rsqueak                         0x003464d4 pypy_debug_catch_fatal_exception + 68
abstraktor commented 9 years ago

it's resolved in master.

Terminating the ObjectHistory process is necessary. Not doing so will make the image freeze sometimes in general and always when loading a SystemTracer-written image.

timfel commented 9 years ago

:+1: Good work hunting that down