[Vm-dev] [Pharo-users] macOS VM builds with AddressSanitizer/LeakSanitizer

Manuel Leuenberger leuenberger at inf.unibe.ch
Mon Jan 28 23:18:03 UTC 2019


Hi Alistair,

Thanks for the hint, the primitive error is indeed nil. And it seems to my sanitizer flags that cause the trouble, because I cannot reproduce the error when I build the VM without them. I tried different version of clang (Apple clang 9, MacPorts clang 6, MacPorts clang 7, Chromium clang 9) with different sanitizer flags, but could either not even start up the VM properly due to a reported stack-buffer-underflow, or the primitive failed.

Debugging revealed that createManualSurface returns -1 because registerSurface is not initialized. Halting in initSurfacePluginFunctionPointers then shows that findOrLoadModule("SurfacePlugin", 0) is 0, so there seems no plugin to be found. I need to continue digging.

Cheers,
Manuel

> On 28 Jan 2019, at 19:29, Alistair Grant <akgrant0710 at gmail.com> wrote:
> 
> 
> Hi Manuel,
> 
> On Mon, 28 Jan 2019 at 11:51, Manuel Leuenberger
> <leuenberger at inf.unibe.ch> wrote:
>> 
>> BlExternalForm >> primCreateManualSurfaceWidth: width height: height rowPitch: rowPitch depth: depth isMSB: isMSB
>> <primitive: 'primitiveCreateManualSurface' module: 'SqueakFFIPrims'>
>> self primitiveFailed
>> 
>> How can I debug this?
> 
> My first suggestion would be to see if the primitive is returning a
> descriptive error.  The method would become (untested):
> 
> BlExternalForm >> primCreateManualSurfaceWidth: width height: height
> rowPitch: rowPitch depth: depth isMSB: isMSB
>    <primitive: 'primitiveCreateManualSurface' module:
> 'SqueakFFIPrims' error: error>
>    self primitiveFailed
> 
> When the primitive fails, open the debugger, inspect this method in
> the call stack and check the value of error.  If the primitive hasn't
> been found, error will be something like #'not found' (from memory).
> If it's something else other than nil, report back with the value.
> 
> If error is nil it will be a matter of diving in to the Slang / C code
> and figuring it out :-).  If you've successfully built a debug version
> of the VM, maybe the easiest next step is to set a breakpoint in
> primitiveCreateManualSurface and step through?
> 
> Cheers,
> Alistair



More information about the Vm-dev mailing list