vshaxe / hashlink-debugger

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

When using heaps, running the launch task gives an Access Violation. Works from command line #36

Closed kfish610 closed 5 years ago

kfish610 commented 5 years ago

Even on very simple apps, running them always results in an Access Violation Exception on line 42 of Window.hl.hx. This doesn't seem to be directly a heaps or hashlink problem, because when running on the command line using hl, it works perfectly, so it seems to just be a vscode debugger problem. Running on hl 1.9.0, haxe 4.0.0-preview.5, heaps 1.5.0, hlsdl 1.8.0, uname -a output: Linux klaptop 4.19.14-1-MANJARO #1 SMP PREEMPT Wed Jan 9 17:17:37 UTC 2019 x86_64 GNU/Linux, build.hxml looks like this:

-cp src
-main Main
-lib heaps
-lib hlsdl
-hl bin/haxe-testing.hl

This bug happens on any heaps program but here is an example

class Main extends hxd.App {
    override function init() {
        var tf = new h2d.Text(hxd.res.DefaultFont.get(), s2d);
        tf.text = "Hello World !";
    }
    static function main() {
        new Main();
    }
}
ncannasse commented 5 years ago

Fixing this will require a bit of extra work on your side :)

First you need to use commandline debugger instead of the vshaxe one, will get more easy to get actual errors. See https://github.com/vshaxe/hashlink-debugger/blob/master/README.md#building-from-source for instructions on how to build it.

Then check if the crash also reproduces. We might want to understand if it's the debugger that is crashing or if it's the app that has the debugger attached.

kfish610 commented 5 years ago

@ncannasse Followed the instructions and ran hl debug.hl ~/Documents/Projects/haxe-testing/game.hl, game ran perfectly. It seems that the problem is indeed in the extension or in vscode somehow.

kfish610 commented 5 years ago

The only reference to the access violation exception I found anywhere was this Dead Cells steam forums post, which is made using hl, haxe, and heaps, so this may be important

ncannasse commented 5 years ago

Could you test with the node commandline debugger? It's actually much more near from the VSCode version than the HL one.

kfish610 commented 5 years ago

@ncannasse I ran it using node, with node debugger.js ~/Documents/Projects/haxe-testing/bin/haxe-testing.hl, it once again ran perfectly.

ncannasse commented 5 years ago

could you try then fully recompiling from sources and copy the output (including your node_modules) directory into the vscode plugin directory to overwrite marketplace version? It might be some incompatibility between precompiled binaries and your vscode.

ncannasse commented 5 years ago

Might be similar to #51, closing