]> granicus.if.org Git - gc/log
gc
5 years agoReduce a time period between GetExitCodeThread and SuspendThread (Win32)
Ivan Maidanski [Thu, 3 Oct 2019 21:38:28 +0000 (00:38 +0300)]
Reduce a time period between GetExitCodeThread and SuspendThread (Win32)
(a cherry-pick of commit 5d7cf8de from 'release-7_4')

* win32_threads.c [!MSWINCE && MPROTECT_VDB] (GC_suspend): Move
AO_test_and_set_acquire() call to be before GetExitCodeThread();
call AO_CLEAR() immediately if GetExitCodeThread() failed.

5 years agoDisable mprotect-based incremental GC if /proc roots are used (Linux)
Ivan Maidanski [Thu, 29 Aug 2019 21:28:23 +0000 (00:28 +0300)]
Disable mprotect-based incremental GC if /proc roots are used (Linux)
(a cherry-pick of commit 79ae7acd from 'master')

The incremental GC is considered incompatible with /proc roots.

* include/private/gcconfig.h [USE_PROC_FOR_LIBRARIES
&& GC_LINUX_THREADS] (MPROTECT_VDB): Undefine; add comment.

5 years agoFix a typo in 'primitives' word in README.changes
Sorawee Porncharoenwase [Tue, 2 Jul 2019 04:52:31 +0000 (21:52 -0700)]
Fix a typo in 'primitives' word in README.changes
(a cherry-pick of commit 63f3006f from 'release-7_4')

* doc/README.changes (6.0alpha7, 6.2alpha4): Fix typo ("primitives").

5 years agoFix 'ACCESS_VIOLATION in marker' GC warning on Win32 async thread start
Ivan Maidanski [Wed, 2 Oct 2019 21:23:31 +0000 (00:23 +0300)]
Fix 'ACCESS_VIOLATION in marker' GC warning on Win32 async thread start
(a cherry-pick of commit 920f9e5d from 'release-7_6')

* mark.c [WRAP_MARK_SOME && (MSWIN32 || MSWINCE) && GC_WIN32_THREADS
&& !__GNUC__] (GC_mark_some): If GC_started_thread_while_stopped()
then goto handle_thr_start instead of handle_ex; define
handle_thr_start label right after WARN() call.

5 years agoPrevent WARN of incompatible incremental GC if default or manual VDB
Ivan Maidanski [Thu, 29 Aug 2019 21:46:43 +0000 (00:46 +0300)]
Prevent WARN of incompatible incremental GC if default or manual VDB
(a cherry-pick of commit 5b5fdf69f from 'release-8_0')

Incremental GC based on mprotect is considered incompatible with /proc
roots but the default and manual VDB modes are OK.

* mark.c [WRAP_MARK_SOME && !MSWIN32 && !MSWINCE] (GC_mark_some):
Do not WARN about incompatibility of incremental GC with /proc roots
if DEFAULT_VDB or MANUAL_VDB.

5 years agoFix GC_new_hblk prototype in a comment
Ivan Maidanski [Fri, 4 Oct 2019 19:08:07 +0000 (22:08 +0300)]
Fix GC_new_hblk prototype in a comment

* new_hblk.c: Specify the 2nd argument (kind) of GC_new_hblk in the
head comment.

5 years agoFix a typo in GC_init comment
Ivan Maidanski [Thu, 29 Aug 2019 05:36:03 +0000 (08:36 +0300)]
Fix a typo in GC_init comment

* misc.c [USE_PROC_FOR_LIBRARIES && GC_LINUX_THREADS] (GC_init): Fix
typo in comment ("will").

5 years agoUpdate ChangeLog
Ivan Maidanski [Mon, 26 Aug 2019 06:45:06 +0000 (09:45 +0300)]
Update ChangeLog

5 years agoFix a typo in control_chars() comment in de_win.c
Ivan Maidanski [Tue, 16 Jul 2019 22:13:18 +0000 (01:13 +0300)]
Fix a typo in control_chars() comment in de_win.c
(a cherry-pick of commit 55244294 from 'release-7_4')

* cord/tests/de_win.c (control_chars): Replace "32" to "64" in comment.

5 years agoFix typo in SMakefile filename in README
Ivan Maidanski [Tue, 16 Jul 2019 07:29:08 +0000 (10:29 +0300)]
Fix typo in SMakefile filename in README

* doc/README.amiga (WHATS NEW): Change SMakefile.smk to SMakefile.amiga.

5 years ago.gitignore: Ignore all *.a files in the base folder
Ivan Maidanski [Tue, 23 Jul 2019 21:42:21 +0000 (00:42 +0300)]
.gitignore: Ignore all *.a files in the base folder

5 years ago.gitignore: Ignore de.dir produced by CMake
Ivan Maidanski [Sun, 7 Jul 2019 07:53:53 +0000 (10:53 +0300)]
.gitignore: Ignore de.dir produced by CMake

5 years agoUpdate ChangeLog
Ivan Maidanski [Sat, 29 Jun 2019 20:13:28 +0000 (23:13 +0300)]
Update ChangeLog

5 years agoFix 'expected function body after declarator' clang error in gc_cpp.cc
Ivan Maidanski [Sat, 29 Jun 2019 20:02:30 +0000 (23:02 +0300)]
Fix 'expected function body after declarator' clang error in gc_cpp.cc
(fix of commit d80935f31)

This commit is only needed for release-7_2 branch whose gc_cpp.cc does
not define GC_DECL_DELETE_THROW.

* gc_cpp.cc [!_MSC_VER && __cplusplus>201103L] (operator delete):
Remove undefined GC_DECL_DELETE_THROW attribute.
* gc_cpp.cc [!_MSC_VER && __cplusplus>201103L && GC_OPERATOR_NEW_ARRAY
&& !CPPCHECK] (operator delete[]): Likewise.

5 years agoUpdate ChangeLog
Ivan Maidanski [Sat, 29 Jun 2019 10:34:28 +0000 (13:34 +0300)]
Update ChangeLog

5 years agoFix fread failure after enable_incremental if malloc is redirected (Linux)
Ivan Maidanski [Fri, 21 Jun 2019 20:33:32 +0000 (23:33 +0300)]
Fix fread failure after enable_incremental if malloc is redirected (Linux)
(a cherry-pick of commit 596c8890 from 'release-7_6')

The failure is observed in cord refill_cache() executed by cordtest,
fread() fails with EFAULT.  The fix is to disable MPROTECT_VDB on Linux
when REDIRECT_MALLOC is defined.

* include/private/gcconfig.h [(M68K || I386 || ALPHA || IA64
|| X86_64 || HEXAGON) && LINUX] (MPROTECT_VDB): Do not define
if REDIRECT_MALLOC.

5 years ago.gitignore: Ignore various CMake-generated files
Ivan Maidanski [Tue, 4 Jun 2019 07:08:57 +0000 (10:08 +0300)]
.gitignore: Ignore various CMake-generated files
(a cherry-pick of commits b13993c0a7d02edebd6ba7237d5306290aca,
2243b559d from 'master')

5 years agoUpdate ChangeLog
Ivan Maidanski [Fri, 17 May 2019 07:51:45 +0000 (10:51 +0300)]
Update ChangeLog

5 years agoFix word size, data start and alignment for OpenBSD/mips64(el)
Jasper Lievisse Adriaanse [Sat, 27 Jun 2015 13:21:29 +0000 (13:21 +0000)]
Fix word size, data start and alignment for OpenBSD/mips64(el)
(a cherry-pick of commit cffb83d6 from 'release-7_4')

* include/private/gcconfig.h [MIPS && OPENBSD] (CPP_WORDSZ): Define
macro; add comment.
* include/private/gcconfig.h [MIPS && OPENBSD] (ALIGNMENT): Define to 8
(instead of 4).
* include/private/gcconfig.h [MIPS && OPENBSD] (__data_start): Declare
extern variable (instead of _fdata).
* include/private/gcconfig.h [MIPS && OPENBSD] (DATASTART): Use
__data_start.
* include/private/gcconfig.h [MIPS && OPENBSD] (_end): Change the type
to int[].

5 years agoFix incorrect define GC_OPENBSD_THREADS on sparc64
Alexandr Shadchin [Sun, 9 Feb 2014 06:01:54 +0000 (06:01 +0000)]
Fix incorrect define GC_OPENBSD_THREADS on sparc64
(a cherry-pick of commit bc61df96 from 'release-7_6')

* include/gc_config_macros.h [GC_THREADS && __OpenBSD__]
(GC_OPENBSD_THREADS): Define macro regardless of __sparc one.

5 years agoExplicitly zero-initialize trace_buf
Ivan Maidanski [Thu, 25 Apr 2019 07:04:02 +0000 (10:04 +0300)]
Explicitly zero-initialize trace_buf

* mark.c [TRACE_BUF] (GC_trace_buf): Initialize to all zeros.

5 years agoFix first_thread stack_base initialization if custom GC_stackbottom (Win32)
Ivan Maidanski [Mon, 29 Apr 2019 06:44:42 +0000 (09:44 +0300)]
Fix first_thread stack_base initialization if custom GC_stackbottom (Win32)
(a cherry-pick of commit 81825732a from 'release-8_0')

Stack bottom value of the primordial thread should be obtained from
GC_stackbottom.

* win32_threads.c [GC_ASSERTIONS] (GC_thr_init): Remove sb_result local
variable.
* win32_threads.c (GC_thr_init): Initalize sb mem_base and reg_base
fields with GC_stackbottom and GC_register_stackbottom, respectively;
do not call GC_get_stack_base().

5 years agoFix the stack bottom variable name in README
Ivan Maidanski [Fri, 26 Apr 2019 07:23:16 +0000 (10:23 +0300)]
Fix the stack bottom variable name in README

* doc/README (The C Interface to the Allocator): Fix a typo
("GC_stackbottom").

5 years agoFix save_callers for multi-threaded case if built-in backtrace unavailable
Ivan Maidanski [Mon, 22 Apr 2019 21:44:52 +0000 (00:44 +0300)]
Fix save_callers for multi-threaded case if built-in backtrace unavailable
(a cherry-pick of commit 750bfbf6 from 'release-7_4')

GC_stackbottom could be used only in the single-threaded case.

* os_dep.c [SAVE_CALL_CHAIN && (NARGS!=0 || NFRAMES%2!=0
|| !GC_HAVE_BUILTIN_BACKTRACE) && THREADS] (GC_save_callers): Do not
compare fp to GC_stackbottom.
* os_dep.c [SAVE_CALL_CHAIN && (NARGS!=0 || NFRAMES%2!=0
|| !GC_HAVE_BUILTIN_BACKTRACE) && THREADS && STACK_GROWS_UP]
(GC_save_callers): Break the loop if fp is NULL.

5 years agoUpdate ChangeLog
Ivan Maidanski [Sat, 6 Apr 2019 06:25:12 +0000 (09:25 +0300)]
Update ChangeLog

5 years agoFix typos in documentation (regarding 'non-incremental')
Ivan Maidanski [Thu, 4 Apr 2019 21:47:37 +0000 (00:47 +0300)]
Fix typos in documentation (regarding 'non-incremental')
(a cherry-pick of commit 7ddeb9cd from 'release-8_0')

* doc/gcdescr.html (Introduction): Fix typos ("non-incremental",
"this operation").
* mark.c (GC_collection_in_progress): Fix a typo in comment
("non-incremental").

5 years agoFix a typo (GC_NPROCS spelling) in a comment in gc.h
Ivan Maidanski [Wed, 3 Apr 2019 08:00:00 +0000 (11:00 +0300)]
Fix a typo (GC_NPROCS spelling) in a comment in gc.h
(a cherry-pick of commit e7150cd3 from 'release-7_4')

* include/gc.h [GC_THREADS] (GC_parallel): Fix a typo in comment
("GC_NPROCS").

5 years agoRemove a misleading comment about Solaris in gc.h
Ivan Maidanski [Wed, 3 Apr 2019 07:49:59 +0000 (10:49 +0300)]
Remove a misleading comment about Solaris in gc.h

* include/gc.h: Remove a comment about Solaris.

5 years agoUpdate ChangeLog
Ivan Maidanski [Wed, 27 Mar 2019 17:10:20 +0000 (20:10 +0300)]
Update ChangeLog

5 years agoFix printf format specifier in simple_example.html
Ivan Maidanski [Tue, 26 Mar 2019 20:09:49 +0000 (23:09 +0300)]
Fix printf format specifier in simple_example.html
(a cherry-pick of commit e68d819d from 'release-8_0')

* doc/simple_example.html (Writing the program): Adjust printf format
specifier to match the argument type (cast the argument as well).

5 years agoFix configure message about 'AIX gcc optimization fix'
Ivan Maidanski [Sun, 24 Mar 2019 09:03:01 +0000 (12:03 +0300)]
Fix configure message about 'AIX gcc optimization fix'

* configure.ac [$host=*aix*]: Update comment and AC_MSG_CHECKING
message to match the checked condition.

5 years agowindows-untested: Update after include/gc_inl.h removal
Ivan Maidanski [Tue, 19 Mar 2019 19:46:30 +0000 (22:46 +0300)]
windows-untested: Update after include/gc_inl.h removal

5 years agoFix various typos mostly in documentation files
Ivan Maidanski [Fri, 22 Mar 2019 07:04:52 +0000 (10:04 +0300)]
Fix various typos mostly in documentation files
(a cherry-pick of commit e9ef2a01 from 'release-7_4')

* OS2_MAKEFILE: Fix a typo in comment ("it is there").
* doc/README: Fix typos ("is not", "gc_inline.h", "bytes from",
"processed").
* doc/README.OS2: Fix typos ("how", "linking").
* doc/README.amiga: Fix typos ("GC", "e.g.", "GC_*_typed", "i.e.",
"SMakefile.amiga", "communications").
* doc/README.cmake: Fix a typo ("go to").
* doc/README.ews4800: Fix a typo ("a unique").
* doc/README.solaris2: Fix a typo ("toolchain").
* doc/gcdescr.html: Fix typos ("then advances", "is not",
"treated by").
* doc/gcinterface.html: Fix typos ("Build it", "Allocates",
"deallocates", "forces", "Causes", "Replaces", "Registers",
"traceable_alloc", "single_client_traceable_alloc").
* doc/leak.html: Fix typos ("there is").
* doc/porting.html: Add missing ")" symbol; add missing comma; fix
typos ("collector's", "are needed", "GC_save_callers").
* include/private/gc_priv.h: Fix a typo in comment ("gc_inline.h").
* os_dep.c [GWW_VDB] (detect_GetWriteWatch, GC_gww_read_dirty): Fix
abbreviation ("Win2K") in a comment.
* os_dep.c [MSWIN32] (GC_wnt): Likewise.
* os_dep.c [GWW_VDB] (GC_gww_read_dirty): Fix a typo in comment
("behavior").

5 years ago[7.2n] v7.2n
Ivan Maidanski [Fri, 1 Mar 2019 06:56:13 +0000 (09:56 +0300)]
[7.2n]

Bump version to 7.2n in README and Travis CI script; update ChangeLog

* doc/README: Bump version to 7.2n (rev. N).

5 years ago.gitignore: Ignore /out folder
Ivan Maidanski [Tue, 26 Feb 2019 20:11:29 +0000 (23:11 +0300)]
.gitignore: Ignore /out folder

5 years agoUpdate ChangeLog
Ivan Maidanski [Sat, 16 Feb 2019 21:35:08 +0000 (00:35 +0300)]
Update ChangeLog

5 years agoAppVeyor CI: Fix 'no source or binary dir provided' cmake error
Ivan Maidanski [Fri, 15 Feb 2019 20:22:58 +0000 (23:22 +0300)]
AppVeyor CI: Fix 'no source or binary dir provided' cmake error
(a cherry-pick of commit 09b2c162 from 'release-7_4')

The error is fixed by passing "." argument to cmake.

5 years agoFix GetThreadContext stale register values use if WoW64 (Win32)
Hamayama [Thu, 7 Feb 2019 21:51:25 +0000 (00:51 +0300)]
Fix GetThreadContext stale register values use if WoW64 (Win32)
(a cherry-pick of commit 8bba28b6 from 'release-7_6')

Issue #262 (bdwgc).

* win32_threads.c [I386] (isWow64): New static variable.
* win32_threads.c [I386] (GC_push_stack_for): If isWow64 then set also
CONTEXT_EXCEPTION_REQUEST and CONTEXT_SEGMENTS bits in ContextFlags;
if isWow64, and CONTEXT_EXCEPTION_REPORTING and
CONTEXT_EXCEPTION_ACTIVE are set on return from GetThreadContext then
call GetThreadSelectorEntry and use StackLimit of FS selector to set
sp local variable (instead of context.Esp); add comment.
* win32_threads.c [I386 && DEBUG_THREADS] (GC_push_stack_for): Call
GC_log_printf() to report TIB stack limit/base and the case when
CONTEXT_EXCEPTION_REQUEST is not supported.
* win32_threads.c [I386] (GC_thr_init): Set isWow64 by IsWow64Process()
if the later is available.

5 years agoUpdate ChangeLog
Ivan Maidanski [Tue, 29 Jan 2019 08:58:34 +0000 (11:58 +0300)]
Update ChangeLog

5 years agoFix 'unexpected mark stack overflow' abort in push_all_stack
Ivan Maidanski [Mon, 21 Jan 2019 22:01:45 +0000 (01:01 +0300)]
Fix 'unexpected mark stack overflow' abort in push_all_stack
(a cherry-pick of commit 420a4768 from 'release-7_6')

Issue #260 (bdwgc).

* mark.c [!(THREADS && MPROTECT_VDB)]
(GC_push_all_stack): Call GC_push_all_eager() instead of GC_push_all()
if GC_mark_stack_top is rather close to GC_mark_stack_limit.

5 years agoFix BSD_TIME variant of MS_TIME_DIFF for the case of a.tv_usec < b.tv_usec
Ivan Maidanski [Fri, 4 Jan 2019 16:37:50 +0000 (19:37 +0300)]
Fix BSD_TIME variant of MS_TIME_DIFF for the case of a.tv_usec < b.tv_usec
(a cherry-pick of commit 610012f0 from 'release-7_4')

* include/private/gc_priv.h [BSD_TIME] (MS_TIME_DIFF):
Cast the result of a.tv_usec-b.tv_usec to long (so that the result of
the division should be negative if a.tv_usec is less than b.tv_usec).

5 years agoFix invalid initializer of CLOCK_TYPE variables if BSD_TIME
Ivan Maidanski [Sat, 5 Jan 2019 08:52:53 +0000 (11:52 +0300)]
Fix invalid initializer of CLOCK_TYPE variables if BSD_TIME
(a cherry-pick of commit 0e12ebaf from 'release-7_4')

* alloc.c [!SMALL_CONFIG] (GC_start_time): Initialize to
CLOCK_TYPE_INITIALIZER (instead of 0).
* alloc.c [!SMALL_CONFIG] (GC_try_to_collect_inner, GC_stopped_mark,
GC_finish_collection): Initialize local variable of CLOCK_TYPE type to
CLOCK_TYPE_INITIALIZER (instead of 0); remove comment (duplicating that
in gc_priv.h).
* reclaim.c [!SMALL_CONFIG] (GC_reclaim_all): Likewise.
* include/private/gc_priv.h (CLOCK_TYPE_INITIALIZER):
Define macro.

5 years agoFix 'mprotect remapping failed' abort on NetBSD with PaX enabled
Ivan Maidanski [Thu, 20 Dec 2018 21:54:55 +0000 (00:54 +0300)]
Fix 'mprotect remapping failed' abort on NetBSD with PaX enabled
(a cherry-pick of commit 1b28cc4b from 'release-7_4')

Issue #255 (bdwgc).

Without this patch, GC_remap() works on NetBSD which has the PaX feature
only if PaX MPROTECT is off (sysctl -w security.pax.mprotect.enabled=0).

* os_dep.c [USE_MUNMAP && !MSWIN32 && !MSWINCE && NETBSD] (GC_remap):
Call mmap() instead of mprotect().

5 years agoFix executable memory allocation in GC_unix_get_mem
Ivan Maidanski [Thu, 20 Dec 2018 08:12:06 +0000 (11:12 +0300)]
Fix executable memory allocation in GC_unix_get_mem

Previously, sbrk() was used for the memory allocation even if the
executable pages were requested.

* os_dep.c [!OS2 && !PCR && !AMIGA && !USE_WINALLOC && !MACOS
&& !DOS4GW && !NONSTOP && !SN_TARGET_PSP2 && !RTEMS && !__CC_ARM
&& MMAP_SUPPORTED] (GC_unix_get_mem): Do not call GC_unix_sbrk_get_mem
if GC_pages_executable; add comment.

6 years ago[7.2m] v7.2m
Ivan Maidanski [Tue, 11 Dec 2018 19:37:16 +0000 (22:37 +0300)]
[7.2m]

Bump version to 7.2m in README and Travis CI script; update ChangeLog

* doc/README: Bump version to 7.2m (rev. M).

6 years agoTravis CI: Use libatomic_ops-7.2i for make distcheck
Ivan Maidanski [Tue, 11 Dec 2018 19:06:01 +0000 (22:06 +0300)]
Travis CI: Use libatomic_ops-7.2i for make distcheck

Use the latest libatomic_ops release (instead of the latest source
snapshot) in release-7_2 branch when preparing a gc-7.2x release.

6 years agoUpdate ChangeLog
Ivan Maidanski [Mon, 3 Dec 2018 22:19:40 +0000 (01:19 +0300)]
Update ChangeLog

6 years agoGuard against potential buffer overflow in CORD_next and CORD_pos_fetch
Ivan Maidanski [Mon, 12 Nov 2018 17:57:32 +0000 (20:57 +0300)]
Guard against potential buffer overflow in CORD_next and CORD_pos_fetch
(a cherry-pick of commit e4fcf92a from 'release-8_0')

* cord/cordbscs.c (CORD__pos_fetch, CORD__next): Call ABORT() if
CORD_pos_valid() returns false for the argument (do not compute pe
in this case).

6 years agoFix hbp overflow in GC_install_counts
Ivan Maidanski [Sun, 4 Nov 2018 08:59:11 +0000 (11:59 +0300)]
Fix hbp overflow in GC_install_counts
(a cherry-pick of commits 6a32bb436a6d79 from 'master')

Issue #245 (bdwgc).

The overflow resulted in an infinite loop in GC_install_counts on Win32.

* headers.c (GC_install_counts): If hbp+=BOTTOM_SZ overflow is expected
then break the first loop; add comment.

6 years ago.gitignore: Ignore disclaim_weakmap_test executable file
Ivan Maidanski [Fri, 19 Oct 2018 07:09:25 +0000 (10:09 +0300)]
.gitignore: Ignore disclaim_weakmap_test executable file

6 years agoUpdate ChangeLog
Ivan Maidanski [Tue, 2 Oct 2018 22:28:09 +0000 (01:28 +0300)]
Update ChangeLog

6 years agoFix comment typo in CMakeLists.txt
Ivan Maidanski [Thu, 13 Sep 2018 07:58:29 +0000 (10:58 +0300)]
Fix comment typo in CMakeLists.txt

* CMakeLists.txt (CMAKE_USE_PTHREADS_INIT): Fix typo ("lib and includes")
in comment.

6 years agoFix comment typos in backgraph.c, de.c, gcconfig.h
Max Mouratov [Sun, 2 Sep 2018 20:08:43 +0000 (01:08 +0500)]
Fix comment typos in backgraph.c, de.c, gcconfig.h
(back-port of commit 69975e184 from 'release-7_4')

* doc/README.changes (5.0alpha6): Fix typo ("DATASTART").
* include/private/gcconfig.h: Likewise.
* backgraph.c: Fix typo in comment ("If").
* cord/de.c: Fix typo in comment ("Unbounded").

6 years agoFix start_world not resuming all threads on Darwin
Demyan Kimitsa [Tue, 28 Aug 2018 16:40:47 +0000 (19:40 +0300)]
Fix start_world not resuming all threads on Darwin
(back-port of commit c4ac42bc9 from 'release-7_4')

Issue #231 (bdwgc).

This happens due mach thread ports are released in GC_stop_world as
a result in some cases the system creates new one and GC_start_world
will not find the thread to resume; in turn, the threads will stay
suspended.  When this happens to GDC threads, the application is
terminated as the message loop is halt.

The high-level description of the change: thread mach port is not
deallocated when thread is saved in GC_mach_threads as it causes thread
not being resumed as thread port object can be changed; threads are now
being suspended without check of suspend_count (as it can be suspended
by client); the logic of resume is changed, now the primary cycle
iterates threads to resume in GC_mach_threads.

* darwin_stop_world.c (struct GC_mach_thread): Rename already_suspended
field to suspended.
* darwin_stop_world.c [!GC_NO_THREADS_DISCOVERY]
(GC_suspend_thread_list): Add my_task argument; remove info an outCount
local variables; call mach_port_deallocate unless threaded is added to
GC_mach_threads; do not call thread_info; update the relevant comments.
* darwin_stop_world.c [!GC_NO_THREADS_DISCOVERY] (GC_stop_world):
Remove i local variable; do not call mach_port_deallocate for prevlist
items; add comment.
* darwin_stop_world.c (GC_thread_resume): Call WARN instead of ABORT
if thread_resume failed.
* darwin_stop_world.c [!GC_NO_THREADS_DISCOVERY] (GC_start_world):
Initialize j to listcount; iterate over GC_mach_threads in the outer
loop; if thread is suspended then find it in act_list; if found then
resume thread; call mach_port_deallocate for act_list items.

6 years ago[7.2l] v7.2l
Ivan Maidanski [Fri, 10 Aug 2018 15:18:37 +0000 (18:18 +0300)]
[7.2l]

2018-08-10  Ivan Maidanski <ivmai@mail.ru>

    * doc/README: Bump version to 7.2l (rev. L).
    * Makefile.am (libgc_la_LDFLAGS): Bump version-info to 2:4:1.
    * Makefile.am (libgccpp_la_LDFLAGS): Bump version-info to 1:5:0.
    * Makefile.in: Regenerate.

6 years agoUpdate ChangeLog
Ivan Maidanski [Mon, 6 Aug 2018 07:01:16 +0000 (10:01 +0300)]
Update ChangeLog

6 years agoFix incorrect roots order after root removal in remove_roots_subregion
Ivan Maidanski [Fri, 3 Aug 2018 16:43:18 +0000 (19:43 +0300)]
Fix incorrect roots order after root removal in remove_roots_subregion
(fix of commits 38d194ae849b45)

Issue #218 (bdwgc).

* mark_rts.c [USE_PROC_FOR_LIBRARIES] (swap_static_roots): New inline
function.
* mark_rts.c [USE_PROC_FOR_LIBRARIES] (GC_remove_roots_subregion):
Use swap_static_roots (after GC_add_roots_inner); if there is
a temporary root after GC_remove_root_at_pos then swap it with the
appropriate non-temporary one to ensure all temporary roots are
grouped at the end.

6 years agoFix suspend_thread_list in case of thread_suspend is interrupted
Ivan Maidanski [Fri, 27 Jul 2018 10:01:19 +0000 (13:01 +0300)]
Fix suspend_thread_list in case of thread_suspend is interrupted
(fix of commit e8cdc7c)

* darwin_stop_world.c [!GC_NO_THREADS_DISCOVERY]
(GC_suspend_thread_list): Retry thread_suspend if failed with
KERN_ABORTED.

6 years agoPerform thread_suspend in loop as it may be interrupted (Darwin)
Jonathan Chambers [Tue, 24 Jul 2018 20:46:52 +0000 (16:46 -0400)]
Perform thread_suspend in loop as it may be interrupted (Darwin)

* darwin_stop_world.c (GC_stop_world): Retry thread_suspend() on
KERN_ABORTED.

6 years agoUpdate (regenerate) configure files
Ivan Maidanski [Thu, 19 Jul 2018 21:08:13 +0000 (00:08 +0300)]
Update (regenerate) configure files

* configure: Regenerate.
* Makefile.in: Likewise.

6 years agoUpdate ChangeLog
Ivan Maidanski [Thu, 19 Jul 2018 06:55:38 +0000 (09:55 +0300)]
Update ChangeLog

6 years agoTravis CI: test --enable-large-config with assertions on (linux)
Ivan Maidanski [Tue, 24 Apr 2018 23:20:59 +0000 (02:20 +0300)]
Travis CI: test --enable-large-config with assertions on (linux)
(a cherry-pick of commit f905a73a from 'release-7_4')

6 years agoFix GC_is_valid_displacement and GC_is_visible for non-small objects
Ivan Maidanski [Wed, 11 Jul 2018 20:09:00 +0000 (23:09 +0300)]
Fix GC_is_valid_displacement and GC_is_visible for non-small objects
(a cherry-pick of commit d4205267 from 'release-7_4')

* ptr_chck.c (GC_is_valid_displacement): Remove redundant
IS_FORWARDING_ADDR_OR_NIL(hhdr) call if GC_all_interior_pointers.
* ptr_chck.c (GC_is_valid_displacement): Do not goto fail if
p+sz-offset > h+1 but IS_FORWARDING_ADDR_OR_NIL(HDR(h+1)).
* ptr_chck.c (GC_is_visible): Transform comment about GC_base to
a TODO item; set hhdr to HDR(base) instead of HDR(p)
if HBLKPTR(base)!=HBLKPTR(p).

6 years agoFix large object base computation in PUSH_CONTENTS() if MARK_BIT_PER_OBJ
Ivan Maidanski [Thu, 14 Jun 2018 23:27:11 +0000 (02:27 +0300)]
Fix large object base computation in PUSH_CONTENTS() if MARK_BIT_PER_OBJ
(a cherry-pick of commit a213fb52 from 'release-7_4')

Issue #177 (bdwgc).

* include/private/gc_pmark.h [MARK_BIT_PER_OBJ] (PUSH_CONTENTS_HDR):
Do not call LONG_MULT() if inv_sz == LARGE_INV_SZ; set base to
hhdr->hb_block if inv_sz == LARGE_INV_SZ regardless of low_prod>>16
value; use EXPECT(FALSE) for inv_sz == LARGE_INV_SZ expression;
remove FIXME about offset; adjust assertion to allow hb_block==current.

6 years agoFix global operator delete definition for C++14 in gc_cpp
Ivan Maidanski [Mon, 15 Jan 2018 05:20:02 +0000 (08:20 +0300)]
Fix global operator delete definition for C++14 in gc_cpp
(a cherry-pick of commit ede8f8c8 from 'release-7_6')

Issue #195 (bdwgc).

Sized variants of global operator delete should be defined along with
the non-sized ones.  Otherwise compiler might invoke the one from the
standard library (as observed in e.g. Cygwin) leading to a crash.

* gc_cpp.cc [!_MSC_VER && __cplusplus>201103L] (operator delete):
Define sized variant (the size argument is ignored for now).
* gc_cpp.cc [!_MSC_VER && __cplusplus>201103L && GC_OPERATOR_NEW_ARRAY
&& !CPPCHECK] (operator delete[]): Likewise.

6 years agoFix Borland version in documentation to match that in BCC_MAKEFILE
Ivan Maidanski [Thu, 12 Jul 2018 06:26:45 +0000 (09:26 +0300)]
Fix Borland version in documentation to match that in BCC_MAKEFILE
(a cherry-pick of commit 39792c9e from 'release-7_6')

* doc/README.win32: Rename "Borland 4.5" to "Borland C++ Builder".
* doc/README.win32 (Borland Tools): Change version from 4.5 to 5.5.

6 years agoFix 'pointer arithmetic with NULL' code defect in print_callers
Ivan Maidanski [Wed, 11 Jul 2018 06:07:30 +0000 (09:07 +0300)]
Fix 'pointer arithmetic with NULL' code defect in print_callers
(a cherry-pick of commit 18fda2a1 from 'release-7_4')

* os_dep.c [NEED_CALLINFO && LINUX && !SMALL_CONFIG] (GC_print_callers):
If nl is null then pass result_len (instead of nl-result_buf) to strncmp;
adjust code indentation.

6 years agoFix potential null dereference in GC_CONS
Ivan Maidanski [Mon, 7 May 2018 21:47:48 +0000 (00:47 +0300)]
Fix potential null dereference in GC_CONS
(a cherry-pick of commit cff27afd from 'release-7_4')

* include/gc_inline.h (GC_CONS): Store second element only if result
is non-null; store first element along with second one.

6 years agoFix mark stack overflow checking in push_selected
Ivan Maidanski [Fri, 22 Jun 2018 22:17:46 +0000 (01:17 +0300)]
Fix mark stack overflow checking in push_selected
(a cherry-pick of commit 84053cd2 from 'release-7_4')

* mark.c (GC_push_selected): In case of a danger of mark stack overflow
after the first GC_push_all() call then call GC_push_all(bottom, top)
and return; remove redundant checking of GC_mark_stack_top at the end
of the function (overflow is already checked in GC_push_all).

6 years agoFix VirtualQuery call in case of malloc failure (Win32)
Ivan Maidanski [Wed, 20 Jun 2018 07:56:19 +0000 (10:56 +0300)]
Fix VirtualQuery call in case of malloc failure (Win32)

* os_dep.c [!REDIRECT_MALLOC && USE_WINALLOC]
(GC_add_current_malloc_heap): Do not call GC_get_allocation_base(new_l)
if new_l is null; cast malloc() result to the type of new_l.

6 years agoFix comment about inv_sz computation in setup_header
Ivan Maidanski [Thu, 14 Jun 2018 08:50:03 +0000 (11:50 +0300)]
Fix comment about inv_sz computation in setup_header
(a cherry-pick of commit e55f4632 from 'master')

* allchblk.c [MARK_BIT_PER_OBJ] (setup_header): Fix comment
(sz*inv_sz>=2**32).
* allchblk.c [MARK_BIT_PER_OBJ && INV_SZ_COMPUTATION_CHECK]
(setup_header): Add assertion to check the computation of inv_sz.

6 years agoFix result computation in n_set_marks
Ivan Maidanski [Thu, 14 Jun 2018 08:26:41 +0000 (11:26 +0300)]
Fix result computation in n_set_marks

* reclaim.c [!USE_MARK_BYTES] (GC_n_set_marks): Do not decrement the
result variable on return; add comment.

6 years agoFix comments style in configure.ac and Makefile.am
Ivan Maidanski [Fri, 18 May 2018 18:36:37 +0000 (21:36 +0300)]
Fix comments style in configure.ac and Makefile.am
(a cherry-pick of commit 0641f668 from 'release-7_4')

Do not allow the comments that are meaningless in the auto-generated
configure and Makefile.in to be put to these files.

* Makefile.am (EXTRA_DIST,
include doc/doc.am): Change comment style from "#" to "##".
* Makefile.am (CPLUSPLUS): Move "#" inside the conditional block.
* configure.ac: Update the copyright.
* configure.ac: Change comment style from "#" to "dnl" for the comments
that are meaningless in auto-generated configure file.

6 years agoFix infinite restarting of mark_some when a static root disappeared (Linux)
Ivan Maidanski [Mon, 7 May 2018 08:05:15 +0000 (11:05 +0300)]
Fix infinite restarting of mark_some when a static root disappeared (Linux)
(a cherry-pick of commit 67338bbd from 'release-7_6')

Issue #218 (bdwgc).

* dyn_load.c [USE_PROC_FOR_LIBRARIES] (GC_register_map_entries): Call
GC_remove_roots_subregion for each region which has prot starting
with "---"; add comment.
* include/private/gc_priv.h [USE_PROC_FOR_LIBRARIES]
(GC_remove_roots_subregion): Declare function.
* mark_rts.c [USE_PROC_FOR_LIBRARIES] (GC_remove_roots_subregion):
Implement (including partial overlapping).

6 years agoFix typos in ChangeLog
Ivan Maidanski [Thu, 14 Jun 2018 21:00:12 +0000 (00:00 +0300)]
Fix typos in ChangeLog
(a cherry-pick of commit 8f51181a from 'release-7_4')

* ChangeLog: Fix typos ("sections",
"variable", "determining", "config", "initialize").
* doc/README.changes: Fix typos ("getting", "pointerful", "configure").

6 years agoWorkaround 'template-id not supported in this context' compiler error (WCC)
Ivan Maidanski [Fri, 1 Jun 2018 06:36:07 +0000 (09:36 +0300)]
Workaround 'template-id not supported in this context' compiler error (WCC)

* include/gc_allocator.h (GC_selective_alloc<GC_true_type>): Do not
define if __WATCOMC__; add comment.

6 years agoDo not redefine MSWIN32 macro (WCC)
Ivan Maidanski [Thu, 31 May 2018 08:20:34 +0000 (11:20 +0300)]
Do not redefine MSWIN32 macro (WCC)
(a cherry-pick of commit 69c0495c from 'master')

* include/private/gcconfig.h [!_WIN32_WCE && !__CEGCC__
&& !__MINGW32CE__] (MSWIN32): Do not define if already
defined.

6 years agoFix typo in comment for CORD_ec_flush_buf prototype
Ivan Maidanski [Wed, 23 May 2018 08:10:32 +0000 (11:10 +0300)]
Fix typo in comment for CORD_ec_flush_buf prototype
(a cherry-pick of commit ef659100 from 'release-7_4')

* include/ec.h (CORD_ec_flush_buf): Fix a typo ("cord") in comment.

6 years agoFix return type in GC_set_warn_proc API documentation
Ivan Maidanski [Tue, 15 May 2018 07:47:18 +0000 (10:47 +0300)]
Fix return type in GC_set_warn_proc API documentation
(a cherry-pick of commit a63c89e7 from 'master')

* doc/gcinterface.html: Change GC_set_warn_proc return type from
GC_warn_proc to void.

6 years agoFix register_dynamic_libraries on Windows 10
Naoyuki Sawa [Wed, 2 May 2018 04:10:23 +0000 (13:10 +0900)]
Fix register_dynamic_libraries on Windows 10

Issue #219 (bdwgc).

In the past (Windows XP, Windows 7, and older Windows 10), VirtualQuery
always returned PAGE_READWRITE for the data section.
In the April 2018 Update of Windows 10, it seems that PAGE_WRITECOPY
is returned sometimes (thus causing GC_register_dynamic_libraries not
to call GC_cond_add_roots for the section).

* dyn_load.c [MSWIN32 || MSWINCE || CYGWIN32]
(GC_register_dynamic_libraries): Call GC_cond_add_roots()
also for PAGE_EXECUTE_WRITECOPY and PAGE_WRITECOPY pages.

6 years agoInstall gc.3 man page instead of copying gc.man to doc folder (configure)
Ivan Maidanski [Tue, 24 Apr 2018 21:56:36 +0000 (00:56 +0300)]
Install gc.3 man page instead of copying gc.man to doc folder (configure)
(a cherry-pick of commit 034bd970 from 'release-7_4')

* doc/doc.am (dist_doc_DATA): Remove doc/gc.man.
* doc/doc.am (dist_man3_MANS): Set to doc/gc.man.
* doc/gc.man (.TH): Rename GC_MALLOC to BDWGC.

6 years ago.gitignore: Ignore '.vs' folders
Ivan Maidanski [Tue, 19 Jun 2018 21:45:12 +0000 (00:45 +0300)]
.gitignore: Ignore '.vs' folders

6 years ago.gitignore: Ignore gc.def (produced by digimars.mak)
Ivan Maidanski [Thu, 31 May 2018 23:11:41 +0000 (02:11 +0300)]
.gitignore: Ignore gc.def (produced by digimars.mak)

6 years ago.gitignore: Ignore *.tds files (generated by bcc)
Ivan Maidanski [Thu, 31 May 2018 05:44:23 +0000 (08:44 +0300)]
.gitignore: Ignore *.tds files (generated by bcc)

6 years ago[7.2k] v7.2k
Ivan Maidanski [Wed, 18 Apr 2018 22:33:19 +0000 (01:33 +0300)]
[7.2k]

Bump version to 7.2k in README; bump libgc.so version; update ChangeLog

* doc/README: Bump version to 7.2k (rev. K).
* Makefile.am (libgc_la_LDFLAGS): Bump version-info to 2:3:1.
* Makefile.in: Regenerate.

6 years agoUpdate ChangeLog
Ivan Maidanski [Wed, 18 Apr 2018 08:13:46 +0000 (11:13 +0300)]
Update ChangeLog

6 years agoFix data race during apply_to_each_object(reset_back_edge)
Ivan Maidanski [Tue, 10 Apr 2018 08:07:08 +0000 (11:07 +0300)]
Fix data race during apply_to_each_object(reset_back_edge)
(back-port of commit 144 from 'release-7_4')

Issue #144 (bdwgc).

* backgraph.c [MAKE_BACK_GRAPH] (GC_print_back_graph_stats): Add
assertion that the allocation lock is held; store GC_deepest_obj to
obj local variable (while holding the lock); place UNLOCK/LOCK around
GC_print_heap_obj() call; pass obj to GC_print_heap_obj(); replace
GC_printf() to GC_err_printf() call to print the header for
GC_print_heap_obj().
* finalize.c [MAKE_BACK_GRAPH] (GC_notify_or_invoke_finalizers): Remove
UNLOCK/LOCK around GC_print_back_graph_stats() call.

6 years agoFix the collector hang when it is configured with --enable-gc-debug
Ivan Maidanski [Tue, 17 Apr 2018 21:20:46 +0000 (00:20 +0300)]
Fix the collector hang when it is configured with --enable-gc-debug
(back-port of commit 7d6106bc from 'release-7_4')

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; change p type from
ptr_t to void*.
* dbg_mlc.c [GC_ASSERTIONS] (GC_store_debug_info_inner): Cast p to
ptr_t when passed to CROSSES_HBLK().
* 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_inner): Define as GC_INNER (instead of
STATIC); call GC_register_displacement_inner() instead of
GC_register_displacement().
* 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.
* gcj_mlc.c (GC_debug_gcj_malloc): Call GC_start_debugging_inner
(holding the lock) instead of GC_start_debugging.
* 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*.
* include/private/gc_priv.h (GC_start_debugging): Rename to
GC_start_debugging_inner; improve usage comment.
* os_dep.c [SAVE_CALL_CHAIN] (GC_save_callers): Add assertion that the
allocation lock is held; add comment.

6 years agoFix null dereference in print_callers on backtrace_symbols failure
Ivan Maidanski [Fri, 6 Apr 2018 16:07:50 +0000 (19:07 +0300)]
Fix null dereference in print_callers on backtrace_symbols failure
(back-port of commit e045f6fe from 'release-7_4')

* os_dep.c [NEED_CALLINFO && GC_HAVE_BUILTIN_BACKTRACE
&& !GC_BACKTRACE_SYMBOLS_BROKEN] (GC_print_callers): If sym_name is
NULL then print info[i].ci_pc to buf and set name to buf (instead of
to sym_name[0]).
* os_dep.c [NEED_CALLINFO && GC_HAVE_BUILTIN_BACKTRACE
&& !GC_BACKTRACE_SYMBOLS_BROKEN] (GC_print_callers): Do not call
free(sym_name) if sym_name is NULL.

6 years agoFix missing SIGBUS handler setup for kFreeBSD
Ivan Maidanski [Fri, 6 Apr 2018 06:13:03 +0000 (09:13 +0300)]
Fix missing SIGBUS handler setup for kFreeBSD
(back-port of commit 93105065 from 'release-7_4')

Issue #184 (bdwgc).

* os_dep.c [MPROTECT_VDB && !DARWIN && !MSWIN32 && !MSWINCE && FREEBSD
&& __GLIBC__] (GC_mprotect_dirty_init): Call sigaction(SIGBUS).

6 years agoFix thread_suspend fail for threads registered from key destructor (OS X)
Ivan Maidanski [Fri, 23 Mar 2018 08:13:23 +0000 (11:13 +0300)]
Fix thread_suspend fail for threads registered from key destructor (OS X)

Issue #213 (bdwgc).

* pthread_support.c [GC_DARWIN_THREADS] (GC_register_my_thread):
Reinitialize stop_info.mach_thread if the thread is registered from
the client thread key destructor; add comment.

6 years agoFix assertion violation in DllMain of win32_threads
Ivan Maidanski [Thu, 22 Mar 2018 08:24:04 +0000 (11:24 +0300)]
Fix assertion violation in DllMain of win32_threads
(back-port of commit 2d31ec91 from 'release-7_4')

DllMain(DLL_THREAD_ATTACH) might be called for C runtime threads
before main() is launched, so this commit just removes wrong
assertion in DllMain.

* win32_threads.c [!GC_NO_THREADS_DISCOVERY] (GC_DllMain): Remove
entry_count static variable; remove assertion for entry_count and
parallel_initialized values in DLL_THREAD_ATTACH case.

6 years agoUpdate ChangeLog
Ivan Maidanski [Sun, 4 Mar 2018 13:17:53 +0000 (16:17 +0300)]
Update ChangeLog

6 years agoFix missing GC_generic_malloc_words_small implementation in new_gc_alloc.h
Ivan Maidanski [Thu, 1 Mar 2018 19:47:22 +0000 (22:47 +0300)]
Fix missing GC_generic_malloc_words_small implementation in new_gc_alloc.h

* include/new_gc_alloc.h (GC_generic_malloc_words_small): Replace
prototype with a macro (that uses GC_generic_malloc); remove FIXME item.

6 years agoFix include gc_gcj.h in thread_local_alloc.c
Ivan Maidanski [Wed, 28 Feb 2018 20:16:36 +0000 (23:16 +0300)]
Fix include gc_gcj.h in thread_local_alloc.c
(back-port of commit 60d9632a from 'master')

The #include for the public GC headers should not contain "include/"
prefix.

* thread_local_alloc.c [GC_GCJ_SUPPORT]: Include "gc_gcj.h" instead of
"include/gc_gcj.h".

6 years agoFix typo in AIX macro name
Ivan Maidanski [Wed, 28 Feb 2018 05:26:27 +0000 (08:26 +0300)]
Fix typo in AIX macro name

* include/private/gc_priv.h [AIX] (NEED_FIND_LIMIT): Define macro
(rename AUX to AIX).
* os_dep.c [AIX && !PCR] (GC_SysVGetDataStart): Define function.

6 years agoFix dbg_mlc.c/o file name in documentation
Ivan Maidanski [Tue, 27 Feb 2018 21:35:19 +0000 (00:35 +0300)]
Fix dbg_mlc.c/o file name in documentation
(back-port of commit 0853b708 from 'release-7_4')

* doc/README (Debugging Facilities): Fix file name ("dbg_mlc.c").
* misc.c (GC_debugging_started): Fix file name ("dbg_mlc.o") in
comment.

6 years agoFix man section number (3)
Ivan Maidanski [Mon, 19 Feb 2018 08:02:12 +0000 (11:02 +0300)]
Fix man section number (3)

Library calls should use section 3 (unlike Programs that use section 1).

* doc/gc.man (TH GC_MALLOC): Change section number from 1L to 3.

6 years agoFix arguments delimiter in pcr_interface.c (PCR)
Ivan Maidanski [Thu, 8 Feb 2018 08:45:57 +0000 (11:45 +0300)]
Fix arguments delimiter in pcr_interface.c (PCR)

* extra/pcr_interface.c (GC_enumerate_block): Replace ';' with ',' in
the arguments list.

6 years agoFix typo in comment in specific.h
Jay Krell [Mon, 5 Feb 2018 07:06:59 +0000 (10:06 +0300)]
Fix typo in comment in specific.h

* include/private/specific.h (tse): Fix a typo ("thread") in comment.