HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.96k stars 432 forks source link

Crash on cpp target when using lime 2.0.0 beta #1378

Closed jeremyfa closed 9 years ago

jeremyfa commented 9 years ago

Hi,

I have no idea whether the issue comes from lime directly or from haxeflixel, but if I use the latest lime version, the app crashes almost right away when using CPP target. I reproduce the issue with the sample project as well (flixel tpl -n "HelloWorld").

I am on Mac OS X Mavericks. The previous version of lime was working fine (2.0.0-alpha8).

Anybody having the same issue? For now I stick with the previous version.

Thanks!

Gama11 commented 9 years ago

This might help debugging the isuse.

jeremyfa commented 9 years ago

Thanks for the link. Unfortunately, it seems that crashdumper is not catching the error (I ensured I set up crashdumper correctly and successfully got crash logs from their example project).

sruloart commented 9 years ago

Most likely an OpenFL thing...

Gama11 commented 9 years ago

@jgranick any ideas?

Tiago-Ling commented 9 years ago

What version of HaxeFlixel are you using? I'm using Lime 2.0.0-beta with the dev version without any problem. I suppose it might be incompatible with the release version.

Gama11 commented 9 years ago

@Tiago-Ling It isn't, I've tested (on windows). Have you tried building on a Mac? My guess is that the latest lime version introduced some mac-specific issues.

Tiago-Ling commented 9 years ago

@Gama11 Good point, that might be it. So Windows works fine with both release and dev, i'm gonna try it on my Mac tonight and will post the results here.

jeremyfa commented 9 years ago

Hi, just letting you know that the crash is also occurring in lime 2.0.0 (just released today).

jeremyfa commented 9 years ago

Update: when using openfl 2.1.6, lime 2.0.0 and flixel 3.3.6 the issue disappeared. I guess it is fixed.

jonongjs commented 9 years ago

@jeremyfa Unfortunately, the issue does not seem to have been resolved. I'm using openfl 2.1.6, lime 2.0.0, flixel 3.3.6 as well, in addition to hxcpp 3.1.39 (with clang-600.0.56 as my compiler). The crash still occurs in my native Mac build of the HelloWorld template project. Do you have any suggestions?

Tiago-Ling commented 9 years ago

I think this is a Lime problem. I can confirm that using the latest lime (2.0.2) there is no way to build for neko and cpp. No error is given, even when building with the -debug flag from the command line. All cases i tested so far crash silently.

I did not find any issues related to this in the lime repository by the way.

jonongjs commented 9 years ago

I agree that this is probably a lower level problem. I suspect it has to do with hxcpp, since debugging with lldb shows the crash occurring within a garbage collection routine. Using the latest development version of hxcpp allows me to run the HelloWorld template without any issues (however, my own project still crashes).

Strangely, though, removing the FlxAssets.init(); line in FlxG.hx seems to have prevented the crash from occurring. I'm not sure what to make of that.

Tiago-Ling commented 9 years ago

Are you embedding your assets (i.e. using <assets path="assets" embed="true" />) ?

Here trying to build with embed assets on native targets resulted in this error with the latest lime:

http://forum.haxepunk.com/index.php?topic=751.0

jonongjs commented 9 years ago

No, I am not embedding my assets. The problem here isn't a compilation issue, but a runtime one. Possibly a garbage collection one?

Unfortunately, I don't have any leads except to say that removing that FlxAssets.init() line prevents the crashing for me on lime 2.0.2 on my Mac (although now I don't have the default flixel font to display text with). All my other assets seem to load fine.

jeremyfa commented 9 years ago

When I reported this issue, it was also a runtime problem. As I remember, I was only having the issue with cpp target to run a mac application. However it seemed to work on iOS, which is also using cpp. Now I don't reproduce the issue, but I also changed my project, so maybe I am just lucky enough.

Tiago-Ling commented 9 years ago

Yes, it is a runtime problem. When i run the "Hello World" sample from pure OpenFL using Lime 2.0.2, with or without a development build of hxcpp it crashes as soon as it starts, having time to only trace the "Hello World" to the command prompt.

So far no luck making it run. Since it crashes with openfl samples (all from git) i think it is safe to discard a problem with HaxeFlixel.

jonongjs commented 9 years ago

Right, I'll report this as an issue on the lime repo then.

jonongjs commented 9 years ago

Oops, my apologies, but this is most strange: I tested some OpenFL samples and they compiled and ran fine. Specifically, I tested the HelloWorld and SimpleImage samples from lime 2.0.2, and the DisplayingABitmap and BunnyMark samples from openfl-samples 2.1.0.

I didn't have any issues running them, so I don't really have a basis for opening an issue on the Lime repo.

Tiago-Ling commented 9 years ago

Really? What library versions are you using for haxe, openfl, flixel and hxcpp? I can try to reproduce your results here.

jonongjs commented 9 years ago

flixel: [3.3.6] hxcpp: [3.1.39] lime-tools: [1.5.7] lime: [2.0.2] openfl-samples: [2.1.0] openfl: [2.1.8]

Haxe: 3.1.3

Tiago-Ling commented 9 years ago

None of them are development versions? Are you using all release versions?

jonongjs commented 9 years ago

Yes, all release versions.

jgranick commented 9 years ago

Hey guys,

I just downloaded and installed the Lime 2.0.2 build and tested here on OS X Yosemite, works fine in both Neko and C++ (using the current haxelib release of HXCPP). If you have a specific case where it crashes instead of working properly, let me know, this was using OpenFL samples

jgranick commented 9 years ago

I also just tested the Lime "HelloWorld" sample, also working from Neko and C++

EDIT: I also tested Neko in a 10.8 VM, which worked, I'm upgrading it and installing Xcode so I can test C++ as well, but I expect it to work, let me know, thanks :)

Tiago-Ling commented 9 years ago

No luck here. Using the same libraries as Jon i'm still getting insta-crashes when targetting neko and cpp with the HelloWorld example from lime and ActuateExample from Openfl.

I'm running Win 8 Pro x64.

larsiusprime commented 9 years ago

What are the nature of the crashes? Does crashdumper catch anything, and if not does using the "debug hxcpp with Visual Studio" trick catch anything?

https://delahee.wordpress.com/2014/07/10/debugging-haxe-with-visual-studio/

On Mon, Dec 22, 2014 at 11:20 AM, Tiago Ling Alexandre < notifications@github.com> wrote:

No luck here. Using the same libraries as Jon i'm still getting insta-crashes when targetting neko and cpp with the HelloWorld example from lime and ActuateExample from Openfl.

I'm running Win 8 Pro x64.

— Reply to this email directly or view it on GitHub https://github.com/HaxeFlixel/flixel/issues/1378#issuecomment-67863813.

www.fortressofdoors.com -- Games, Art, Design

jgranick commented 9 years ago

Hmm, just got a crash on my Windows VM, but it doesn't have VSC++ so I can rebuild there. Trying a clean rebuild on the build server, and will test again

jgranick commented 9 years ago

Hey guys,

We had a bad build, some recent changes in HXCPP broke the builds, and it wasn't caught as an error. I just rebuilt Lime 2.0.2 and tested on Windows 10, and it works now.

Please do the following:

haxelib remove lime 2.0.2
haxelib install lime
Tiago-Ling commented 9 years ago

I can confirm it is now working in windows 8 x64 for both cpp and neko. Tested both HelloWorld and ActuateExample samples.

@jgranick Thanks a lot!

@larsiusprime crashdumper wasn't working before, the application crashed before anything. The guide from Delahee is great, i'm still trying to setup the cpp project though.

Also, Haxeflixel projects are working fine in Win8 (using the latest dev versions of flixel, flixel-addons, flixel-demos, etc).