]> granicus.if.org Git - gc/commit
Fix the collector hang when it is configured with --enable-gc-debug
authorIvan Maidanski <ivmai@mail.ru>
Thu, 15 Mar 2018 07:10:39 +0000 (10:10 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 16 Apr 2018 21:32:24 +0000 (00:32 +0300)
commit8f63e5b30f0f3d214e35fba17b405c1b05da07c5
tree47c2d3fdd82b20b1f20d7a12acd05db2d07f40dc
parent7881f44ef5412e7cb4a208614e279bde48163a35
Fix the collector hang when it is configured with --enable-gc-debug
(back-port of commits d6ccabe2e8c66c from 'master')

Issue #205 (bdwgc).

* dbg_mlc.c (GC_store_debug_info_inner): Remove comment (as it exists
in the header); change from STATIC to GC_INNER.
* dbg_mlc.c (GC_store_debug_info): Change from GC_INNER to static;
remove GC_ prefix; replace ptr_t to void*; add fn argument;
replace "const char *string, int linenum" with GC_EXTRA_PARAMS;
change "word sz" argument to "size_t lb"; allow p to be null (print
error message in this case); call GC_start_debugging_inner unless
GC_debugging_started; call ADD_CALL_CHAIN.
* dbg_mlc.c (GC_start_debugging): Remove.
* dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page, GC_debug_generic_malloc,
GC_debug_malloc_atomic, GC_debug_malloc_uncollectable): Call
store_debug_info() instead of checking result for null and calling
GC_start_debugging, ADD_CALL_CHAIN, GC_store_debug_info; use OPT_RA.
* dbg_mlc.c [STUBBORN_ALLOC] (GC_debug_malloc_stubborn): Likewise.
* dbg_mlc.c [GC_ATOMIC_UNCOLLECTABLE]
(GC_debug_malloc_atomic_uncollectable): Likewise.
* gcj_mlc.c [GC_GCJ_SUPPORT] (GC_debug_gcj_malloc): Call ADD_CALL_CHAIN
while holding the lock; call GC_store_debug_info_inner (holding the
lock) instead of GC_store_debug_info.
* include/private/dbg_mlc.h (ADD_CALL_CHAIN): Update comment.
* include/private/gc_priv.h (GC_store_debug_info): Replace with
GC_store_debug_info_inner; update comment; change ptr_t to void*.
* os_dep.c [SAVE_CALL_CHAIN] (GC_save_callers): Add assertion that the
allocation lock is held; add comment.
dbg_mlc.c
gcj_mlc.c
include/private/dbg_mlc.h
include/private/gc_priv.h
os_dep.c