Debugging a lime.exe crash

I converted a Flash game to OpenFL but have a problem where it crashes on hxcpp targets. The crash is happening inside lime.ndll and I am not sure what to do now.

These are my debugging related settings in my projects .hxp file:

	haxelibs.push(new Haxelib("hxcpp"));
	haxedefs.set("HXCPP_CHECK_POINTER",1);
	haxedefs.set("HXCPP_DEBUG_LINK",1);
	haxedefs.set("DHXCPP_STACK_TRACE",1);
	haxedefs.set("HXCPP_STACK_LINE",1);
	haxedefs.set("HXCPP_CHECK_POINTER",1);
	haxeflags.push("-D HXCPP_DEBUGGER");
	haxelibs.push(new Haxelib("debugger"));
	haxeflags.push ("-debug");

These are infos from the windows event log, I translated them, hopefully my translation is not too far from the real english terms:

Name of faulty application: nss.exe, Version: 0.0.0.0, Time Stamp: 0x54d0acab
name of faulty module: lime.ndll, Version: 0.0.0.0, Time Stamp: 0x54c2f680
Exception Code: 0xc0000005
Error offset: 0x00014286
ID of fauly process: 0x349c
Start time of fauly application: 0x01d03fa20a7eaafd
path of faulty application: D:\work\projects\nss\project\bin\windows\cpp\bin\nss.exe
path of fauly module: D:\work\projects\nss\project\bin\windows\cpp\bin\lime.ndll

I recompiled the project with the latest haxelib versions.

Can I enable some special debug version of Lime to find out what Lime is trying to do when crashing? I am completely lost with this error and have no idea on what I could do to find it.

I tried https://github.com/openfl/lime/wiki/Debugging-Lime but the article is outdated:

C:\Users\mako>lime rebuild -debug -version -Ddebug
Error: Incorrect number of arguments for command ‘rebuild’

I looked at https://github.com/openfl/lime and decided to add the target mentioned there:

C:\Users\mako>lime rebuild windows -debug -version -Ddebug

No error but also nothing happening. I have Visual Studio 2013 installed if that makes a difference.

Any help would be appreciated.

Does it work on the desktop? If not, that’s probably the simplest place to test. Often, it occurs because of some null reference in your code.

Can you add trace messages to your code, to see how far it gets before it fails? It could tell where it is getting stuck

Continuing the discussion from Debugging a lime.exe crash:

I was hoping for an easier way but then spent some hours with adding lots of traces and finally found the line that caused the crash:

resultBitmapData.copyPixels(bitmapData, tileRect, destinationPoint, null, null, true);

The values according to my log was

TileGrid.hx:309: trying resultBitmapData.copyPixels(BitmapData,(x=-532, y=-532, width=266, height=266),(0, 0),...)

Seems it was a negative cordinate in a BitmapData.copyPixel() call that should have been replaced with a TileLayer replacement long ago.

I was searching in all the wrong places, of course - so would still be interessted in a way to get some extra debugging infos on lime crashes. Would the debug version of Lime help with finding such mistakes/errors?

Thanks for the help.

HXCPP has a debugger, but IDE support is still not broad. I believe there’s an add-on for FlashDevelop that’s in the works, and some support in IntelliJ

I’m have a problem also.

lime rebuild windows

is do nothing, and I can’t build ndll for debugging. In stack-trace I see a couple of ndll calls, and than crash. It happening on loading JPEG image with Loader.loadBytes() on hxcpp mac target. PNG files is decoded normally. Please, let me know if you already know about this issue, or if not - I’ll create an issue on github.

  1. We’re need to provide possibility to use debug ndll versions for better debugging inside native code. It allows us to make contributions or just QA testing more efficiently.

  2. It’d be nice to have more unit tests on loading resources. Now LoaderTest inside openfl project is just empty.

Cheers

@eliasku Do you have a haxelib version of lime or a git one? The haxelib version can’t be rebuild.

I use haxelib release version… yeah, it makes sense for me now… I’ll try to make debug ndll from git repo and check the JPEG issue on native target.

Thank you a lot!