SEGFAULT: I think that recent versions of Haxe/Lime segfaults when there is text involved

I have been spending half of my day trying to debug this but then I realized that I should also try building AddingText example and even that one segfaults on Linux x64

g++ -D_CRT_SECURE_NO_DEPRECATE -DHX_UNDEFINE_H -c -fvisibility=hidden -O2 -fpic -fPIC -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -m64 -DHXCPP_M64 -I/usr/lib/haxe/lib/hxcpp/3,2,37/include -x c++ -frtti -Wno-invalid-offsetof /usr/lib/haxe/lib/hxcpp/3,2,37/src/Array.cpp -oobj/linux64/57588eaa_Array.o
g++ -D_CRT_SECURE_NO_DEPRECATE -DHX_UNDEFINE_H -c -fvisibility=hidden -O2 -fpic -fPIC -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -m64 -DHXCPP_M64 -I/usr/lib/haxe/lib/hxcpp/3,2,37/include -x c++ -frtti -Wno-invalid-offsetof /usr/lib/haxe/lib/hxcpp/3,2,37/src/hx/Class.cpp -oobj/linux64/f2885469_Class.o
g++ -D_CRT_SECURE_NO_DEPRECATE -DHX_UNDEFINE_H -c -fvisibility=hidden -O2 -fpic -fPIC -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -m64 -DHXCPP_M64 -I/usr/lib/haxe/lib/hxcpp/3,2,37/include -x c++ -frtti -Wno-invalid-offsetof /usr/lib/haxe/lib/hxcpp/3,2,37/src/Dynamic.cpp -oobj/linux64/57588eaa_Dynamic.o
g++ -D_CRT_SECURE_NO_DEPRECATE -DHX_UNDEFINE_H -c -fvisibility=hidden -O2 -fpic -fPIC -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -m64 -DHXCPP_M64 -I/usr/lib/haxe/lib/hxcpp/3,2,37/include -x c++ -frtti -Wno-invalid-offsetof /usr/lib/haxe/lib/hxcpp/3,2,37/src/Enum.cpp -oobj/linux64/57588eaa_Enum.o
g++ -D_CRT_SECURE_NO_DEPRECATE -DHX_UNDEFINE_H -c -fvisibility=hidden -O2 -fpic -fPIC -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -m64 -DHXCPP_M64 -I/usr/lib/haxe/lib/hxcpp/3,2,37/include -x c++ -frtti -Wno-invalid-offsetof /usr/lib/haxe/lib/hxcpp/3,2,37/src/Math.cpp -oobj/linux64/57588eaa_Math.o
g++ -D_CRT_SECURE_NO_DEPRECATE -DHX_UNDEFINE_H -c -fvisibility=hidden -O2 -fpic -fPIC -DHX_LINUX -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -m64 -DHXCPP_M64 -I/usr/lib/haxe/lib/hxcpp/3,2,37/include -x c++ -frtti -Wno-invalid-offsetof /usr/lib/haxe/lib/hxcpp/3,2,37/src/String.cpp -oobj/linux64/57588eaa_String.o
g++ -o ApplicationMain -rdynamic -m64 @obj/linux64//all_objs -lpthread -ldl -ldl
strip -d ApplicationMain
Segmentation fault

Gdb output with debug symbols

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff461bc00 in lime::FILE_HANDLE::isFile() () from /usr/lib/haxe/lib/./lime/2,3,0//ndll/Linux64/./lime.ndll
(gdb) where
#0  0x00007ffff461bc00 in lime::FILE_HANDLE::isFile() () from /usr/lib/haxe/lib/./lime/2,3,0//ndll/Linux64/./lime.ndll
#1  0x00007ffff460d67d in lime::Font::Font(lime::Resource*, int) () from /usr/lib/haxe/lib/./lime/2,3,0//ndll/Linux64/./lime.ndll
#2  0x00007ffff460763f in lime::lime_font_load(_value*) () from /usr/lib/haxe/lib/./lime/2,3,0//ndll/Linux64/./lime.ndll
#3  0x00000000007d783a in ExternalPrimitive::__run (this=0x7ffff7f05790, a=...) at /usr/lib/haxe/lib/hxcpp/3,2,37/src/hx/Lib.cpp:122
#4  0x000000000041e4d5 in Dynamic::operator() (this=0xbbafd8 <lime::text::Font_obj::lime_font_load>, inArg0=...) at /usr/lib/haxe/lib/hxcpp/3,2,37/include/Dynamic.h:187
#5  0x0000000000764508 in lime::text::Font_obj::__fromFile (this=0x7ffff7f224f4, path=...) at ./src/lime/text/Font.cpp:510
#6  0x0000000000761c23 in lime::text::Font_obj::__construct (this=0x7ffff7f224f4, name=...) at ./src/lime/text/Font.cpp:62
#7  0x000000000075f60a in openfl::text::Font_obj::__construct (this=0x7ffff7f224f4, name=...) at ./src/openfl/text/Font.cpp:40
#8  0x000000000075ef5d in __ASSET__OPENFL__assets_katamotzikasi_ttf_obj::__construct (this=0x7ffff7f224f4) at ./src/__ASSET__OPENFL__assets_katamotzikasi_ttf.cpp:23
#9  0x000000000075f0c8 in __ASSET__OPENFL__assets_katamotzikasi_ttf_obj::__Create (inArgs=...) at ./src/__ASSET__OPENFL__assets_katamotzikasi_ttf.cpp:39
#10 0x00000000007fe32c in hx::Class_obj::ConstructArgs (this=0x7ffff7ef6c6c, inArgs=...) at /usr/lib/haxe/lib/hxcpp/3,2,37/src/hx/Class.cpp:196
#11 0x00000000007579f5 in Type_obj::createInstance (cl=..., args=...) at ./src/Type.cpp:116
#12 0x000000000076000e in openfl::text::Font_obj::registerFont (font=...) at ./src/openfl/text/Font.cpp:148
#13 0x0000000000778e73 in DefaultAssetLibrary_obj::__construct (this=0x7ffff7f223ac) at ./src/DefaultAssetLibrary.cpp:86
#14 0x0000000000779442 in DefaultAssetLibrary_obj::__new () at ./src/DefaultAssetLibrary.cpp:149
#15 0x000000000072dc68 in lime::Assets_obj::initialize () at ./src/lime/Assets.cpp:466
#16 0x00000000007a1231 in ApplicationMain_obj::start () at ./src/ApplicationMain.cpp:265
#17 0x00000000007a061d in ApplicationMain_obj::init () at ./src/ApplicationMain.cpp:169
#18 0x00000000007a0692 in __ApplicationMain_objinit () at ./src/ApplicationMain.cpp:176
#19 0x0000000000803ed5 in hx::CStaticFunction0::__run (this=0x7ffff7f21cdc) at /usr/lib/haxe/lib/hxcpp/3,2,37/include/hx/DynamicImpl.h:82
#20 0x000000000049c4c6 in Dynamic::operator() (this=0x7ffff7f21b54) at /usr/lib/haxe/lib/hxcpp/3,2,37/include/Dynamic.h:187
#21 0x00000000006f8490 in lime::app::Preloader_obj::start (this=0x7ffff7f21b44) at ./src/lime/app/Preloader.cpp:66
#22 0x00000000004dda97 in openfl::display::Preloader_obj::display_onComplete (this=0x7ffff7f21b44, event=...) at ./src/openfl/display/Preloader.cpp:155
#23 0x00000000004ddb27 in openfl::display::__Preloader_objdisplay_onComplete (inObj=0x7ffff7f21b44, inArg0=...) at ./src/openfl/display/Preloader.cpp:161
#24 0x0000000000804158 in hx::CMemberFunction1::__run (this=0x7ffff7f21cf0, inArg0=...) at /usr/lib/haxe/lib/hxcpp/3,2,37/include/hx/DynamicImpl.h:138
#25 0x000000000041e4d5 in Dynamic::operator() (this=0x7ffff7f21d58, inArg0=...) at /usr/lib/haxe/lib/hxcpp/3,2,37/include/Dynamic.h:187
#26 0x000000000079d51c in openfl::events::EventDispatcher_obj::dispatchEvent (this=0x7ffff7f207b0, event=...) at ./src/openfl/events/EventDispatcher.cpp:184
#27 0x000000000078c1fb in openfl::display::DisplayObject_obj::dispatchEvent (this=0x7ffff7f207b0, event=...) at ./src/openfl/display/DisplayObject.cpp:172
#28 0x000000000075afcd in NMEPreloader_obj::onLoaded (this=0x7ffff7f207b0) at ./src/NMEPreloader.cpp:204
#29 0x00000000004dd68f in openfl::display::Preloader_obj::start (this=0x7ffff7f21b44) at ./src/openfl/display/Preloader.cpp:114
#30 0x00000000006f8219 in lime::app::Preloader_obj::create (this=0x7ffff7f21b44, config=...) at ./src/lime/app/Preloader.cpp:38
#31 0x00000000007a0085 in ApplicationMain_obj::create () at ./src/ApplicationMain.cpp:125
#32 0x00000000007a0fc2 in ApplicationMain_obj::main () at ./src/ApplicationMain.cpp:223
#33 0x00000000007a2f0e in main (argc=1, argv=0x7fffffffe728) at ./src/__main__.cpp:12

any ideas? I am just sitting here nodding my head ;( Because I do not know how to progress with this.

Ok

I reinstalled all the Haxe stuff and Openfl stuff from scratch and still I am getting segfault with
/openfl-samples/2,2,2/AddingText

I cant believe that I am the only one who is getting this issue :frowning:

Html5 does not swgfault or crash but Neko and Linux does.

Yes, I can confirm your problem on Arch linux 64 bit.

AddingText segfaults with “lime test linux”.

For now I’m using “lime test linux -Dlegacy” and it works, but clearly there are some things not yet working in the 3.0 code.

1 Like

@smiley8088

Thank you so much. I wasted almost 2 days on this, and I was trying to get some answer. Because I started getting this suddenly, and I could not figure out if it was my system update or some haxe update.

I will try the commandline you mentioned when I have time.

@smiley8088

-Dlegacy works for me as well. Thank you for the tip. I wasted so much time on this ;(

Should be fixed on the repository, sorry for the trouble

@singmajesty

No problem, I understand the complextiy of trying to run this project. Keep up the good work please.