Lime command segfaults after upgrade to Lime 2.2.0 / OpenFL 3.0.0 beta

I just upgraded to Lime 2.2.0 and OpenFL 3.0.0. Unfortunately, after cleaning my project and trying to test it again from scratch, the lime command segfaults:

$ lime test neko
Called from ? line 1
Called from CommandLineTools.hx line 1349
Called from CommandLineTools.hx line 25
Called from a C function
Called from CommandLineTools.hx line 126
Called from CommandLineTools.hx line 567
Called from lime/project/PlatformTarget.hx line 70
Called from lime/tools/platforms/MacPlatform.hx line 313
Called from lime/tools/helpers/IconHelper.hx line 152
Called from lime/graphics/Image.hx line 298
Called from lime/graphics/format/PNG.hx line 28
Uncaught exception - Segmentation fault

Any thoughts on the cause? Should I simply reinstall Lime and OpenFL from scratch?

Thanks.

Would you mind please testing some of the core Lime or OpenFL projects, and see if they work for you? On the Mac here, I do not see this error using those samples.

However, it’s possible that something unique is occurring due to your icon file or project setup. The above is not something that is specific to the new OpenFL code. If you can recreate this in a simple plain sample, I would be more than happy to look into why this is happening. In the meantime, you can also use lime test neko -nocffi which may work, albeit slower

Thanks for responding so quickly (and congratulations on the new release!). It seems like the problem is very basic. That is, I can reproduce it with an empty Lime project:

$ lime create project Test
$ cd Test
$ lime test neko
Called from ? line 1
Called from CommandLineTools.hx line 1349
Called from CommandLineTools.hx line 25
Called from a C function
Called from CommandLineTools.hx line 126
Called from CommandLineTools.hx line 567
Called from lime/project/PlatformTarget.hx line 70
Called from lime/tools/platforms/MacPlatform.hx line 313
Called from lime/tools/helpers/IconHelper.hx line 152
Called from lime/graphics/Image.hx line 298
Called from lime/graphics/format/PNG.hx line 28
Uncaught exception - Segmentation fault

It’s hard for me to diagnose the problem given that I’m not that familiar with the internals of the lime tool. Perhaps the needed icon file is missing for some reason?

Also, the -nocffi option does seem to avoid the segfault. I was able to get PiratePig running that way. An empty OpenFL project brought up a white screen. An empty Lime project brought up a white screen filled with glitchy memory junk (!). When I tried to run my game, I got a couple of warnings:

Lib.hx:114: Warning: Graphics.beginGradientFill is not implemented
Lib.hx:114: Warning: TextField.getLineMetrics is not implemented

And the screen came up empty. I’ll try to figure out if that’s a configuration problem or bug in my code, or something else.

The empty Lime project might look that way because it’s expecting a render command, even a GL clear or something. Lime doesn’t add any rendering commands on its own

Yeah, that’s what I figured. Always fun to get a peek at uninitialized memory, though.

Another couple of tidbits, for the record. Once I successfully build and run a project using -nocffi once, I can omit the option in future runs. So I assume the bug manifests itself at build time only. Furthermore, if I comment out the line <icon path="Assets/openfl.svg" /> in project.xml, then the project will build and run right out of the box.

If the icon files already exist, the tools are designed to allow them to remain, and to move on, speeding up future builds. It’s strange that I don’t get the same error, here, though, even on fresh projects. Perhaps something is being passed to PNG.encode that is not valid.

If you were interested in helping, I would recommend editing lime.graphics.format.PNG and adding some trace or Sys.println statements for things like:

Sys.println (image != null);
Sys.println (image.buffer != null);
Sys.println (image.data != null);
Sys.println (image.width);
Sys.println (image.height);

and make sure that these return true, and the size is larger than 0 x 0.

Run lime rebuild tools to recompile the tools with an edited PNG.hx class

I’m getting this same problem after upgrading to openfl 3, and lime 2.2.0, downgrading openfl didn’t fix it, going to try to find out which version of lime I should get for use with openfl 2.2.8.

EDIT: Downgrading lime to 2.1.3 fixed the issue

Fixed, this was due to an HXCPP change that affected how Neko interacted with the lime.ndll

You guys can download the latest Lime build at http://www.openfl.org/builds/lime/

Use haxelib local <path to lime zip> to install it :wink:

I also just released as Lime 2.2.1 on haxelib, so either path to upgrade should work :success:

Wow, you rock! Thanks for the super-quick fix, which definitely fixed the segfault. Now, I’m still left with a few issues. There’s the fact that Graphics.beginGradientFill and TextField.getLineMetrics are apparently unimplemented (how can I track the reincorporation of those features?). And, uh, there’s the fact that my app no longer does anything. I guess I’ve got to whittle it down to a simpler test to understand why I’m ending up with an empty window.

Anyway, thanks again!

OpenFl 3.0.0-beta
Lime 2.2.1
Haxe 3.1.3

After “lime setup” I got this

hxcpp is up to date
lime-samples is up to date
Called from ? line 1
Called from CommandLineTools.hx line 1349
Called from CommandLineTools.hx line 25
Called from CommandLineTools.hx line 94
Called from CommandLineTools.hx line 1360
Called from utils/PlatformSetup.hx line 406
Called from utils/PlatformSetup.hx line 482
Called from utils/PlatformSetup.hx line 1690
Called from /usr/lib/haxe/std/neko/_std/sys/io/File.hx line 63
Called from /usr/lib/haxe/std/neko/_std/sys/io/File.hx line 54
Uncaught exception - [file_open,C:\HaxeToolkit\haxe\lime.exe]

Does something in your permissions prevent writing “lime.exe”, or perhaps you already have “lime.exe” and it’s in use?

Try haxelib run lime setup to avoid use of the lime.exe shortcut

Thanks! That works. But just “lime” command is still not working.