vshaxe / hashlink-debugger

Visual Studio Code Debugger for Haxe/HashLink applications
https://hashlink.haxe.org/
MIT License
57 stars 23 forks source link

Dynamic linking error when trying to debug #48

Closed AaronC81 closed 5 years ago

AaronC81 commented 5 years ago

I get a dynamic linking error from VS Code when trying to launch a debug session on any Haxe project:

image

I'm really not sure what is causing this. The final line of thks extension's JavaScript which is being referred to does in fact load a library; here's the Haxe before it's compiled:

https://github.com/vshaxe/hashlink-debugger/blob/af7789ae7b0e94017d3178c57640fb7f59ce6149/hld/NodeDebugApiLinux.hx#L56-L59

I thought that an LD_LIBRARY_PATH or LD_PRELOAD could be messing with library loading, but according to VS Code's dev tools neither of these variables are defined in process.env.

I'm using Haxe 4.0.0-rc1, HashLink 1.9.0, extension version 0.6.0, VS Code 64-bit 1.32.3, and Ubuntu 18.04.

AaronC81 commented 5 years ago

This issue is now resolved - after some ridiculously lengthy troubleshooting, it turns out the cause was that I was using the Snap version of VS Code.

Snap provides its own libc which the FFI tries to load instead, but the path to this libc isn't the same as the system libc mentioned in the error. While debugging, I attempted to load a library which depended on libc, and the true path to Snap's libc was shown on the new error.

However, I'm now having another issue. Once I begin debugging, I am able to step once or twice before the debugger freezes and stops responding to new step commands, somewhat similar to #22.

mmayla commented 4 years ago

@AaronC81 Thanks you, your comment helped me a lot. I have uninstalled the snap version and installed the official package.