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

Uncaught exceptions are not logged on x86_64 #2219

Closed
chelmuth opened this issue Jan 3, 2017 · 2 comments
Closed

Uncaught exceptions are not logged on x86_64 #2219

chelmuth opened this issue Jan 3, 2017 · 2 comments

Comments

@chelmuth
Copy link
Member

chelmuth commented Jan 3, 2017

With this patch

diff --git a/repos/libports/src/test/libc/main.cc b/repos/libports/src/test/libc/main.cc
index 04c35d6..c561de6 100644
--- a/repos/libports/src/test/libc/main.cc
+++ b/repos/libports/src/test/libc/main.cc
@@ -28,6 +28,8 @@ int main(int argc, char **argv)
 {
        printf("--- libC test ---\n");
 
+       struct Fatal { }; throw Fatal();
+
        printf("Does printf work?\n");
        printf("We can find out by printing a floating-point number: %f. How does that work?\n", 1.234
 

I get the expected output on x86_32 for make run/libc KERNEL=linux.

spawn ./core
Genode 16.11-114-gd83ccd3 <local changes>
4095 MiB RAM assigned to init
[init -> test-libc] --- libC test ---
[init -> test-libc] Error: Uncaught exception of type 'main::Fatal'
[init -> test-libc] Warning: abort called - thread: ep
[init] child "test-libc" exited with exit value 1

but only an abort on x86_64.

spawn ./core
Genode 16.11-114-gd83ccd3 <local changes>
17592186044415 MiB RAM assigned to init
[init -> test-libc] --- libC test ---
[init -> test-libc] Warning: abort called - thread: ep
[init] child "test-libc" exited with exit value 1
@chelmuth chelmuth added the bug label Jan 3, 2017
@chelmuth
Copy link
Member Author

chelmuth commented Jan 3, 2017

As @cproc found out by testing make run/log, this issue is related to dynamically linked binaries only (at least with 16.11).

@chelmuth
Copy link
Member Author

chelmuth commented Jan 3, 2017

@ssumpf I have a small ldso puzzle for you. It seems the linker relocation reverts changes already made to a namespace variable in the function Linker::Dynamic::relocate_non_plt(1, 1). The variable in question is __cxxabiv1::__terminate_handler and part of ld.lib.so resp. cxx.lib.a. I'm somewhat lost without any knowledge about this non-plt relocation stuff and hope you may shed some light on it.

chelmuth added a commit to chelmuth/genode that referenced this issue Jan 4, 2017
cproc added a commit to cproc/genode that referenced this issue Jan 5, 2017
Handle only GLOB_DAT relocations in the second relocation pass, like it is
done on x86_32 and ARM.

Fixes genodelabs#2219
@cproc cproc added the fixed label Jan 5, 2017
chelmuth pushed a commit to chelmuth/genode that referenced this issue Jan 9, 2017
Handle only GLOB_DAT relocations in the second relocation pass, like it is
done on x86_32 and ARM.

Fixes genodelabs#2219
chelmuth pushed a commit that referenced this issue Jan 13, 2017
Handle only GLOB_DAT relocations in the second relocation pass, like it is
done on x86_32 and ARM.

Fixes #2219
@nfeske nfeske closed this as completed in 7948a72 Jan 31, 2017
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

2 participants