-
Notifications
You must be signed in to change notification settings - Fork 406
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
disclaimtest, weakmaptest or middletest fail in zig build on Linux if enable_gc_debug and enable_redirect_malloc #613
Comments
I failed to reproduce it locally (both cases). |
About weakmap test: |
Source: master (c8c9f6d) |
Probably relates to #288 |
Issue #613 (bdwgc). This might be important for the case of malloc redirection as backtrace() need to be called without the allocator lock held. * dbg_mlc.c (store_debug_info, GC_debug_generic_malloc_inner): Call ADD_CALL_CHAIN() right after GC_store_debug_info_inner() call (instead of before it). * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * dbg_mlc.c (GC_debug_generic_malloc_inner): Declare result local variable.
Issue #613 (bdwgc). As backtrace() might call a redirected malloc, we need to release the allocator lock temporarily before backtrace() call, and we should not call backtrace() at all for the cases where it is not possible to release the allocator lock temporarily (i.e. for internal allocations). * dbg_mlc.c [DBG_HDRS_ALL] (GC_debug_generic_malloc_inner): Call ADD_CALL_CHAIN_INNER() instead of ADD_CALL_CHAIN(). * include/private/dbg_mlc.h [SAVE_CALL_CHAIN && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE] (GC_save_callers_no_unlock): Declare function. * include/private/dbg_mlc.h [DBG_HDRS_ALL] (ADD_CALL_CHAIN_INNER): Define. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL]: Include dbg_mlc.h. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL] (GC_save_callers_no_unlock): Implement. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC] (GC_save_callers): Wrap backtrace() into UNLOCK/LOCK(); add comment.
Probably fixed. Closing for now. |
(a cherry-pick of commit f4f943b from 'master') Issue #613 (bdwgc). This might be important for the case of malloc redirection as backtrace() need to be called without the allocator lock held. * dbg_mlc.c (store_debug_info, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Call ADD_CALL_CHAIN() right after GC_store_debug_info_inner() call (instead of before it). * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * dbg_mlc.c (GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Define base local variable. * gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
(a cherry-pick of commit b37ca67 from 'master') Issue #613 (bdwgc). As backtrace() might call a redirected malloc, we need to release the allocator lock temporarily before backtrace() call, and we should not call backtrace() at all for the cases where it is not possible to release the allocator lock temporarily (i.e. for internal allocations). * dbg_mlc.c [DBG_HDRS_ALL] (GC_debug_generic_malloc_inner): Call ADD_CALL_CHAIN_INNER() instead of ADD_CALL_CHAIN(). * include/private/dbg_mlc.h [SAVE_CALL_CHAIN && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE] (GC_save_callers_no_unlock): Declare function. * include/private/dbg_mlc.h [DBG_HDRS_ALL] (ADD_CALL_CHAIN_INNER): Define. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL]: Include dbg_mlc.h. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL] (GC_save_callers_no_unlock): Implement. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC] (GC_save_callers): Wrap backtrace() into UNLOCK/LOCK(); add comment.
(a cherry-pick of commit f4f943b from 'master') Issue #613 (bdwgc). This might be important for the case of malloc redirection as backtrace() need to be called without the allocator lock held. * dbg_mlc.c (store_debug_info, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Call ADD_CALL_CHAIN() right after GC_store_debug_info_inner() call (instead of before it). * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * dbg_mlc.c (GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Define base local variable. * gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
(a cherry-pick of commit b37ca67 from 'master') Issue #613 (bdwgc). As backtrace() might call a redirected malloc, we need to release the allocator lock temporarily before backtrace() call, and we should not call backtrace() at all for the cases where it is not possible to release the allocator lock temporarily (i.e. for internal allocations). * dbg_mlc.c [DBG_HDRS_ALL] (GC_debug_generic_malloc_inner): Call ADD_CALL_CHAIN_INNER() instead of ADD_CALL_CHAIN(). * include/private/dbg_mlc.h [SAVE_CALL_CHAIN && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE] (GC_save_callers_no_unlock): Declare function. * include/private/dbg_mlc.h [DBG_HDRS_ALL] (ADD_CALL_CHAIN_INNER): Define. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL]: Include dbg_mlc.h. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL] (GC_save_callers_no_unlock): Implement. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC] (GC_save_callers): Wrap backtrace() into UNLOCK/LOCK(); add comment.
(a cherry-pick of commit 70163b7 from 'release-8_0') Issue #613 (bdwgc). This might be important for the case of malloc redirection as backtrace() need to be called without the allocator lock held. * dbg_mlc.c (store_debug_info, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Call ADD_CALL_CHAIN() right after GC_store_debug_info_inner() call (instead of before it). * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * dbg_mlc.c (GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Define base local variable. * gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
(a cherry-pick of commit b37ca67 from 'master') Issue #613 (bdwgc). As backtrace() might call a redirected malloc, we need to release the allocator lock temporarily before backtrace() call, and we should not call backtrace() at all for the cases where it is not possible to release the allocator lock temporarily (i.e. for internal allocations). * dbg_mlc.c [DBG_HDRS_ALL] (GC_debug_generic_malloc_inner): Call ADD_CALL_CHAIN_INNER() instead of ADD_CALL_CHAIN(). * include/private/dbg_mlc.h [SAVE_CALL_CHAIN && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE] (GC_save_callers_no_unlock): Declare function. * include/private/dbg_mlc.h [DBG_HDRS_ALL] (ADD_CALL_CHAIN_INNER): Define. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL]: Include dbg_mlc.h. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL] (GC_save_callers_no_unlock): Implement. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC] (GC_save_callers): Wrap backtrace() into UNLOCK/LOCK(); add comment.
(a cherry-pick of commit 70163b7 from 'release-8_0') Issue #613 (bdwgc). This might be important for the case of malloc redirection as backtrace() need to be called without the allocator lock held. * dbg_mlc.c (store_debug_info, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Call ADD_CALL_CHAIN() right after GC_store_debug_info_inner() call (instead of before it). * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * dbg_mlc.c (GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Define base local variable. * gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
(a cherry-pick of commit b37ca67 from 'master') Issue #613 (bdwgc). As backtrace() might call a redirected malloc, we need to release the allocator lock temporarily before backtrace() call, and we should not call backtrace() at all for the cases where it is not possible to release the allocator lock temporarily (i.e. for internal allocations). * dbg_mlc.c [DBG_HDRS_ALL] (GC_debug_generic_malloc_inner): Call ADD_CALL_CHAIN_INNER() instead of ADD_CALL_CHAIN(). * include/private/dbg_mlc.h [SAVE_CALL_CHAIN && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE] (GC_save_callers_no_unlock): Declare function. * include/private/dbg_mlc.h [DBG_HDRS_ALL] (ADD_CALL_CHAIN_INNER): Define. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL]: Include dbg_mlc.h. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL] (GC_save_callers_no_unlock): Implement. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC] (GC_save_callers): Wrap backtrace() into UNLOCK/LOCK(); add comment.
(a cherry-pick of commit 36a48ec from 'release-7_4') Issue #613 (bdwgc). This might be important for the case of malloc redirection as backtrace() need to be called without the allocator lock held. * dbg_mlc.c (store_debug_info, GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Call ADD_CALL_CHAIN() right after GC_store_debug_info_inner() call (instead of before it). * gcj_mlc.c (GC_debug_gcj_malloc): Likewise. * dbg_mlc.c (GC_debug_generic_malloc_inner, GC_debug_generic_malloc_inner_ignore_off_page): Define base local variable. * gcj_mlc.c (GC_debug_gcj_malloc): Likewise.
(a cherry-pick of commit 7dd72b5 from 'release-7_4') Issue #613 (bdwgc). As backtrace() might call a redirected malloc, we need to release the allocator lock temporarily before backtrace() call, and we should not call backtrace() at all for the cases where it is not possible to release the allocator lock temporarily (i.e. for internal allocations). * dbg_mlc.c [DBG_HDRS_ALL] (GC_debug_generic_malloc_inner): Call ADD_CALL_CHAIN_INNER() instead of ADD_CALL_CHAIN(). * include/private/dbg_mlc.h [SAVE_CALL_CHAIN && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE] (GC_save_callers_no_unlock): Declare function. * include/private/dbg_mlc.h [DBG_HDRS_ALL] (ADD_CALL_CHAIN_INNER): Define. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL]: Include dbg_mlc.h. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC && THREADS && DBG_HDRS_ALL] (GC_save_callers_no_unlock): Implement. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && NARGS==0 && NFRAMES%2==0 && GC_HAVE_BUILTIN_BACKTRACE && REDIRECT_MALLOC] (GC_save_callers): Wrap backtrace() into UNLOCK/LOCK(); add comment.
Source: master (c0936ed)
Build (disclaimtest): https://github.com/ivmai/bdwgc/actions/runs/7504908429/job/20433003879
Build (middletest): https://github.com/ivmai/bdwgc/actions/runs/7504908429/job/20433004753
Host: Linux/x86_64
Zig version: 0.12.0-dev.2076+8fd15c6ca
Occurrence: sometimes
How to build (disclaimtest):
zig build -DBUILD_SHARED_LIBS=false -Denable_gc_assertions -Denable_gc_debug -Denable_redirect_malloc test
How to build (middletest):
zig build -DBUILD_SHARED_LIBS=false -Denable_gc_assertions -Denable_gc_debug -Denable_redirect_malloc -Denable_rwlock -Denable_parallel_mark=false test
Output:
run disclaimtest failure
orrun middletest failure
The text was updated successfully, but these errors were encountered: