Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault at boot screen #9300

Closed
supagu opened this issue Jun 21, 2017 · 15 comments
Closed

Segmentation fault at boot screen #9300

supagu opened this issue Jun 21, 2017 · 15 comments

Comments

@supagu
Copy link
Contributor

supagu commented Jun 21, 2017

I'm working on linux and trying to get my build system setup.

when i build with:
scons -j 4 platform=x11 bits=64 builtin_openssl=yes
I get a working exe

if i use:
scons -j 4 platform=x11 tools=yes target=release_debug bits=64 builtin_openssl=yes
or
scons -j 4 platform=x11 tools=no target=release bits=64 builtin_openssl=yes

the generated exe loads the splash screen then crashes with a segmentation fault.
gdb bt gives me:

#0 0x0000000001bbd520 in atomic_conditional_increment(unsigned int*) ()
#1 0x0000000001bd1f78 in Reference::init_ref() ()
#2 0x0000000001c187c8 in Image::load(String const&) ()
#3 0x00000000008ca56b in Main::start() ()
#4 0x00000000008b46a1 in main ()

I do have a custom boot splash image loaded.

@supagu
Copy link
Contributor Author

supagu commented Jun 21, 2017

upon further investigation this is project specific, I'll have to debug it myself I think

@supagu
Copy link
Contributor Author

supagu commented Jun 21, 2017

in godot/platform/x11/detect.py if i comment out line 131, which causes:
env.Prepend(CCFLAGS=['-g2'])

and build using:
scons -j4 platform=x11 target=release_debug bits=64 builtin_openssl=yes tools=yes

the editor works fine.
IF I revert the change, then the editor crashes as described in #9301.

So this looks to be some linker optimisation bug....

@vnen
Copy link
Member

vnen commented Jun 21, 2017

I assume you are using GCC. If so, which version it is? Have you tried compiling with Clang?

@supagu
Copy link
Contributor Author

supagu commented Jun 22, 2017

gcc (GCC) 7.1.1 20170528
I'll give clang a shot. Any idea how I can specify which compiler is used to build godot?

@karroffel karroffel changed the title [3.0] Segmentation fault at boot screen Segmentation fault at boot screen Jun 22, 2017
@karroffel karroffel added this to the 3.0 milestone Jun 22, 2017
@Calinou
Copy link
Member

Calinou commented Jun 22, 2017

To compile Godot with Clang, install it then add use_llvm=yes to the SCons command line.

@supagu
Copy link
Contributor Author

supagu commented Jun 23, 2017

scons use_llvm=yes platform=x11 builtin_openssl=yes tools=yes target=release_debug bits=64
and
scons use_llvm=yes platform=x11 builtin_openssl=yes tools=no target=release bits=64 -j4

both run fine with the binarys they produce

@vnen
Copy link
Member

vnen commented Jun 23, 2017

Looks like another GCC problem. Seems diferrent from #4623 and #4673.

@hpvb
Copy link
Member

hpvb commented Aug 25, 2017

Can you retest with current master? This is probably fixed with #10581

@supagu
Copy link
Contributor Author

supagu commented Aug 27, 2017

my release build works: "scons -j 4 platform=x11 tools=no target=release bits=64 builtin_openssl=yes"

my release_debug build does not work: "scons -j 4 platform=x11 tools=yes target=release_debug bits=64 builtin_openssl=yes"

I get the following error:

Loading Menu prefab: res://Prefab/UI/Matrix.tscn
_ready called on matrix : /root/MainMenu/Matrix
CERT STR: /CN=*.matrix.org
VALID: 1
CONNECTION RESULT: 1
cert_ok: 1
[New Thread 0x7fffe121f700 (LWP 26087)]
Finished Menu prefabs

Thread 1 "linux_x11_64_de" received signal SIGSEGV, Segmentation fault.
__cxxabiv1::__dynamic_cast (src_ptr=0x0, src_type=0x102c0b158 ,
dst_type=0x102bee250 , src2dst=0) at /build/gcc-multilib/src/gcc/libstdc++-v3/libsupc++/dyncast.cc:50
50 /build/gcc-multilib/src/gcc/libstdc++-v3/libsupc++/dyncast.cc: No such file or directory.
(gdb) bt
#0 __cxxabiv1::__dynamic_cast (src_ptr=0x0, src_type=0x102c0b158 ,
dst_type=0x102bee250 , src2dst=0) at /build/gcc-multilib/src/gcc/libstdc++-v3/libsupc++/dyncast.cc:50
#1 0x000000010129a4bc in Tree::_create_item(Object*) ()
#2 0x0000000100e84c8b in MethodBind1R<Object*, Object*>::call(Object*, Variant const**, int, Variant::CallError&) ()
#3 0x0000000101a0fb8b in Object::call(StringName const&, Variant const**, int, Variant::CallError&) ()
#4 0x0000000101a33ae3 in Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) ()
#5 0x000000010074f44f in GDFunction::call(GDInstance*, Variant const**, int, Variant::CallError&, GDFunction::CallState*) ()
#6 0x0000000100771e75 in GDInstance::_ml_call_reversed(GDScript*, StringName const&, Variant const**, int) ()
#7 0x000000010116f292 in Node::_notification(int) ()
#8 0x0000000101158c74 in CanvasLayer::_notificationv(int, bool) ()
#9 0x0000000101a082c4 in Object::notification(int, bool) ()
#10 0x000000010115f157 in Node::_propagate_ready() ()
#11 0x000000010116d2e7 in Node::_set_tree(SceneTree*) ()
#12 0x000000010116d42c in Node::_add_child_nocheck(Node*, StringName const&) ()
#13 0x000000010116d779 in Node::add_child(Node*, bool) ()
#14 0x00000001006f0220 in MethodBind1<Node*>::call(Object*, Variant const**, int, Variant::CallError&) ()
#15 0x0000000101a0fb8b in Object::call(StringName const&, Variant const**, int, Variant::CallError&) ()
#16 0x0000000101a7465d in MessageQueue::_call_function(Object*, StringName const&, Variant const*, int, bool) ()
#17 0x0000000101a748b3 in MessageQueue::flush() ()
#18 0x000000010066013a in Main::iteration() ()
#19 0x00000001006596c1 in OS_X11::run() ()
#20 0x0000000100652b2c in main ()
(gdb)

@hpvb
Copy link
Member

hpvb commented Aug 27, 2017

Would it be possible for you to send me the project that is causing this crash?

@supagu
Copy link
Contributor Author

supagu commented Aug 27, 2017

Ill take a stab at debugging it when i get a chance. Failing that I'll see if i can get you a build.

@hpvb
Copy link
Member

hpvb commented Aug 27, 2017

What might help is building like this:

cons -j 4 platform=x11 tools=yes target=release_debug debug_release=yes bits=64 builtin_openssl=yes

@hpvb
Copy link
Member

hpvb commented Aug 28, 2017

I think this is now fixed together with another issue in #10701

@supagu
Copy link
Contributor Author

supagu commented Sep 3, 2017

i can confirm there is now boot crash! even the mingw windows builds are working for me!

@hpvb
Copy link
Member

hpvb commented Sep 3, 2017

hurrah!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants