Skip to content

Commit

Permalink
Fix fread failure after enable_incremental if malloc redirected (Cher…
Browse files Browse the repository at this point in the history
…iBSD)

Issue #627 (bdwgc).

The failure is observed in cord `refill_cache()` executed by
`cordtest`, `fread()` fails with `EFAULT`.  The fix is to disable
` on FreeBSD when `REDIRECT_MALLOC` is defined (similar
as it was done previously on Linux).

* include/private/gcconfig.h [FREEBSD && !ALPHA && !SPARC]
(MPROTECT_VDB): Do not define if `REDIRECT_MALLOC`.
  • Loading branch information
ivmai committed Dec 28, 2024
1 parent 8ea9f5e commit 5fcc06d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/private/gcconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,11 @@ extern int _modules_data_start[], _apps_bss_end[];
extern char etext[];
# define DATASTART GC_SysVGetDataStart(0x1000, (ptr_t)etext)
# define DATASTART_USES_XGETDATASTART
# define MPROTECT_VDB
# ifndef REDIRECT_MALLOC
# define MPROTECT_VDB
# else
/* Similar as on Linux, fread() might use malloc(). */
# endif
# endif
#endif /* FREEBSD */

Expand Down

0 comments on commit 5fcc06d

Please sign in to comment.