Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SurfacePlugin.DLL is crashing with the headless VM at restart #8655

Closed
VincentBlondeau opened this issue Feb 28, 2021 · 0 comments · Fixed by #8804 or pharo-project/pharo-vm#188
Closed

Comments

@VincentBlondeau
Copy link
Contributor

Describe the bug

  1. Download the latest headless VM and latest image.
  2. Open the image:
    \Pharo\vms\90-x64-headless\Pharo.exe "Pharo 9.0 - 64bit (development version, latest)-test.image" --interactive
  3. Open a browser, go to any class and open the UML diagram
  4. Save and quit the image
  5. Reopen the image
  6. Enjoy the crash

I fear some invalid handles around.

PS: it is working well with the stable non headless vm


CONTEXT:  (.ecxr)
rax=0000000000000000 rbx=000000006fbf9d60 rcx=0000000000000b38
rdx=000000006fbf1d40 rsi=0000000062c816b0 rdi=0000000073afea18
rip=0000000062c816c4 rsp=0000000000657820 rbp=0000000000657930
 r8=000000006fbd9def  r9=0000000000000067 r10=0000000000000009
r11=0000000000657100 r12=000000000065f540 r13=000000000065f598
r14=000000006fbc6150 r15=0000000000000000
iopl=0         nv up ei pl nz na pe nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010202
SurfacePlugin!primitiveCreateManualSurface+0x14:
00000000`62c816c4 ff90c8000000    call    qword ptr [rax+0C8h] ds:00000000`000000c8=????????????????
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 0000000062c816c4 (SurfacePlugin!primitiveCreateManualSurface+0x0000000000000014)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000000
   Parameter[1]: 00000000000000c8
Attempt to read from address 00000000000000c8

PROCESS_NAME:  Pharo.exe

READ_ADDRESS:  00000000000000c8 

ERROR_CODE: (NTSTATUS) 0xc0000005 - L'instruction   0x%p emploie l'adresse m moire 0x%p. L' tat de la m moire ne peut pas  tre %s.

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  0000000000000000

EXCEPTION_PARAMETER2:  00000000000000c8

STACK_TEXT:  
00000000`00657820 00000000`6fb6820e : 00000000`71c6dbb0 00000000`7249b400 00000000`00657930 00000000`7249b400 : SurfacePlugin!primitiveCreateManualSurface+0x14
00000000`00657880 00000000`6fb52d7e : 00000000`6fbf0458 00000000`000003ce 00000000`71c6dbb0 00000000`6fb66dbc : PharoVMCore!callbackEnter+0x54be
00000000`006578d0 00000000`6fb5df04 : 00000000`006579d0 00000000`00000000 00000000`00000000 00000000`00000000 : PharoVMCore!primitivePerformWorkerCall+0x4afbe
00000000`00657980 00000000`6fb4d26c : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : PharoVMCore!primitivePerformWorkerCall+0x56144
00000000`006579b0 00000000`6fb0391b : 00000000`0000000e 00000000`00000003 00000000`00000000 00000000`01021780 : PharoVMCore!primitivePerformWorkerCall+0x454ac
00000000`0065fcf0 00000000`6fb03a8a : 00000000`00000000 00007ffe`8258b358 00000000`010216a0 00000000`00713cc0 : PharoVMCore!vm_main_with_parameters+0x2fb
00000000`0065fd40 00000000`0040157e : 00000000`00000003 00000000`0000000e 00000000`01021780 00000000`00000020 : PharoVMCore!vm_main+0x12a
00000000`0065fe00 00000000`004013c4 : 00000000`00000002 00000000`0000000e 00000000`00407190 00000000`00000000 : Pharo+0x157e
00000000`0065fe30 00000000`004014e6 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : Pharo+0x13c4
00000000`0065ff00 00007ffe`818b7034 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : Pharo+0x14e6
00000000`0065ff30 00007ffe`8369d241 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x14
00000000`0065ff60 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21


SYMBOL_NAME:  SurfacePlugin!primitiveCreateManualSurface+14

MODULE_NAME: SurfacePlugin

IMAGE_NAME:  SurfacePlugin.DLL

Expected behavior
No crash

**Dump **
Pharo.exe.27716.dmp.txt

Version information:

  • OS: win10
  • Version:
    Pharo 9.0.0
    Build information: Pharo-9.0.0+build.1165.sha.4e09ddb24157ac6df6022041c4fc02f5e1985f2d (64 Bit)

Expected development cost
Unknown

Additional context
Vanilla Image

tesonep added a commit to tesonep/pharo that referenced this issue Mar 17, 2021
The old implementation was using just FFI to access the plugin.
This is not good, as the initialization of the plugin is not guarantee when using direct FFI
When combined with the new headless VM.
Fix pharo-project#8655
tesonep added a commit to tesonep/opensmalltalk-vm that referenced this issue Mar 17, 2021
Adding some primitives so the VM can call them and do not use FFI to call the plugin.
Fix pharo-project/pharo#8655
Fix OpenSmalltalk#181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants