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
Do not use probing to determining main data root start if dl_iterate_phdr is available (Linux) #432
Labels
Comments
ivmai
added a commit
that referenced
this issue
Mar 10, 2022
Issue #432 (bdwgc). This avoids invocation of GC_find_limit to get GC_data_start value in case of GC_register_data_segments is not called. * misc.c [SEARCH_FOR_DATA_START] (GC_init): Call GC_init_linux_data_start() only if GC_REGISTER_MAIN_STATIC_DATA(); move GC_init_linux_data_start() call down (to be close but precede GC_dirty_init call); add comment.
|
@fweimer-rh, please check the above commit - it should not cause Sigsegv. |
|
/cc @T-J-Teru |
|
I confirm there's no SIGSEGV anymore when running gdb under gdb during the gc initialization |
ivmai
added a commit
that referenced
this issue
Mar 13, 2022
(a cherry-pick of commit c9b3ca8 from 'master') Issue #432 (bdwgc). This avoids invocation of GC_find_limit to get GC_data_start value in case of GC_register_data_segments is not called. * misc.c [SEARCH_FOR_DATA_START] (GC_init): Call GC_init_linux_data_start() only if GC_REGISTER_MAIN_STATIC_DATA(); move GC_init_linux_data_start() call down (to be close but precede GC_dirty_init call); add comment. * misc.c [NETBSD && __ELF__] (GC_init): Call GC_init_netbsd_elf() only if GC_REGISTER_MAIN_STATIC_DATA(); move GC_init_netbsd_elf() call down (to be close but precede GC_dirty_init call). * misc.c [GC_ASSERTIONS && GC_ALWAYS_MULTITHREADED && (SEARCH_FOR_DATA_START || NETBSD)] (GC_init): Move LOCK/UNLOCK down to keep GC_init_linux_data_start and GC_init_netbsd_elf calls wrapped.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On behalf of @fweimer-rh (copied from #409):
dl_iterate_phdr should already give you the segment boundaries, without the need for probing.
These segfaults are really confusing to developers, so we would really like to find a way to eliminate them. Why are they needed?
I'm running on Fedora Linux with glibc 2.30. dl_iterate_phdr is definitely available, I can see GC_register_main_static_data return FALSE, which means that GC_register_dynamic_libraries_dl_iterate_phdr does NOT take the quick exit path, and performs the full scan.
However, I still see a segfault, and this is before GC_register_data_segments is even called. Here's the backtrace at the time of the segfault:
The text was updated successfully, but these errors were encountered: