-
Notifications
You must be signed in to change notification settings - Fork 408
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
gctest fails on Serenity OS #688
Comments
Crash with serenity's bdwgc patches before upstreaming:
Crash with the mentioned banch using bdwgc master after upstreaming:
|
Okay, the above 2 crashes are identical. A null pointer dereference occurs.
Hmm, this line contains I recommend, during investigation of this crash, to pass CFLAGS_EXTRA="-O0 -DGC_DISABLE_INCREMENTAL" to cmake or configure, so that not to intercept SIGSEGV by GC_write_fault_handler (as well as turn off compiler optimizations). |
Also, it might be good to start investigation with the minimal version of collector, like this:
If it works, then test it in the multi-threaded mode:
If it works, then test it w/o SMALL_CONFIG, and so on: add -D USE_MUNMAP, add -D GC_GCJ_SUPPORT, add -D ENABLE_DISCLAIM, add -D THREAD_LOCAL_ALLOC. |
Thanks for the guidance! With
errno 22 is EINVAL, the implementation of Looks like only And indeed, this patch makes it work: --- a/os_dep.c
+++ b/os_dep.c
@@ -2770,7 +2770,7 @@ block_unmap_inner(ptr_t start_addr, size_t len)
# ifdef SN_TARGET_PS3
ps3_free_mem(start_addr, len);
# elif defined(AIX) || defined(COSMO) || defined(CYGWIN32) \
- || defined(HPUX) || defined(SERENITY) \
+ || defined(HPUX) \
|| (defined(LINUX) && !defined(PREFER_MMAP_PROT_NONE))
/* On AIX, mmap(PROT_NONE) fails with ENOMEM unless the */
/* environment variable XPG_SUS_ENV is set to ON. */ |
|
Please remove `define MPROTECT_VDB' from SERENITY section in include/private/gcconfig.h |
Also, I wonder about printed "using 1 marker threads" - are you running on multicore? If yes, then there is an issue with getting amount of CPU cores in pthread_support.c. See GC_get_nprocs() implementation, I think you should enable the one based on sysconf(_SC_NPROCESSORS_ONLN), line 1093, if it works. |
Good, but please check that the memory is really returned to OS. For this, you could set a break point in debugger near exit, and check how many memory is committed (compared to virtual process space). See the gctest message "Obtained ... bytes from OS". There are several mechanisms to return (unmap) memory to OS:
I think |
Thanks, that does make gctest work with no additional build flags!
Running with a single core in QEMU, something with enabling SMP seems to be broken in the run script. I wouldn't worry about that for now but good catch :)
I'm not certain that's the case, I can see 10 MiB of committed memory being retained after |
Good! As I understand you did 2 changes (related to madvise and to MRPOTECT_VDB), and now "make check" works, right? Could you please open a PR here? |
This causes a null pointer dereference crash when building without SMALL_CONFIG. See: ivmai#688
SerenityOS only supports MADV_SET_VOLATILE/MADV_SET_NONVOLATILE and returns EINVAL for MADV_DONTNEED: https://github.com/SerenityOS/serenity/blob/b88cd185a0ec40fc10405b555507aa6f0aab8222/Kernel/Syscalls/mmap.cpp#L355-L388 See: ivmai#688
Correct! I have to run the tests manually due to cross-compiling but it all seems to work:
Sure - #689 |
This causes a null pointer dereference crash when building without SMALL_CONFIG. See: ivmai#688
SerenityOS only supports MADV_SET_VOLATILE/MADV_SET_NONVOLATILE and returns EINVAL for MADV_DONTNEED: https://github.com/SerenityOS/serenity/blob/b88cd185a0ec40fc10405b555507aa6f0aab8222/Kernel/Syscalls/mmap.cpp#L355-L388 See: ivmai#688
Having the proposed patches, we do not need https://github.com/SerenityOS/serenity/blob/master/Ports/bdwgc/patches/0005-Make-the-collector-build-with-threads.patch, right? |
The test runner still crashes with anything other than NTHREADS=0 so intend to keep that part of the patchset, but that's definitely a bug in Serenity and should be solved on our end. |
Okay, got it. |
Source: master (437c08c)
Also observed on v8.2.8+patches (SerenityOS/serenity@9201208)
Host: Serenity/x86_64
Reported in issue #685 by @linusg:
The text was updated successfully, but these errors were encountered: