=?koi8-r?Q?Re=3A_[Gc]_Re=3A_Boehm_GC_on_FreeBSD_trouble,
_and_maybe_fix=3F?=
Ivan Maidanski
ivmai at mail.ru
Sat Feb 12 10:39:48 PST 2011
Hi Dimitry,
Ok, I've modified SIG/CODE_OK as you suggested:
#define SIG_OK (sig == SIGBUS || sig == SIGSEGV)
#define CODE_OK (si -> si_code == BUS_PAGE_FAULT || si -> si_code == SEGV_ACCERR)
and SEGV_ACCERR is defined to 2 if not yet.
Regards.
Sat, 12 Feb 2011 14:53:14 +0100 Dimitry Andric <dim at FreeBSD.org>:
> On 2011-02-03 23:03, Ivan Maidanski wrote:
> > 1. I've already fixed the issue (but in a different way), see
> http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/bdwgc-7_2alpha5-20110107.tar.bz2
> > The mine variant is:
> >
> > # if defined(FREEBSD)
> > # define SIG_OK TRUE
> > # define CODE_OK (si -> si_code == BUS_PAGE_FAULT \
> > || si -> si_code == 2 /* experimentally determined
> */)
>
> Ah yes, at the time I mailed you, I tried to access the bwdgc CVS
> repository to review the latest version of this code, but SourceForge
> had just disabled all their CVS service, due to a security breach. :(
>
> I guess the only 'improvement' to be made here is to use:
>
> # define SIG_OK (sig == SIGBUS || sig == SIGSEGV)
>
> since any other signal should not occur here.
>
>
> > 2. Probably, it's better to use SEGV_ACCERR instead of 2 but I couldn't find
> it at least in FreeBSD r6.2.
>
> That is correct, I should have checked old versions too. The
> SEGV_ACCERR define was introduced in FreeBSD 7.0.
>
>
> > 3. Have you tested your code with some older FreeBSD releases (it can't test
> it right now but it seems that the old code worked before FreeBSD r7).
>
> Actually, your solution is probably the most dependable one. :)
>
> In FreeBSD 6.x and earlier, for a page fault due to invalid permissions,
> the system generated SIGBUS, with the si_code field set to
> BUS_PAGE_FAULT (=12).
>
> In FreeBSD 7.0 and later, the system generates SIGSEGV, with the si_code
> field set to SEGV_ACCERR (=2).
>
> Actually, there is a compatibility sysctl that lets you switch between
> the 'old' SIGBUS+BUS_PAGE_FAULT mode, and the 'new' SIGSEGV+SEGV_ACCERR
> mode. The default setting of this sysctl even autodetects whether a
> pre-7.0 executable is running, in which case it generates SIGBUS. For
> post-7.0 executables, it generates SIGSEGV.
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 4028 bytes
Desc: not available
Url : http://napali.hpl.hp.com/pipermail/gc/attachments/20110212/001e0153/attachment.obj
More information about the Gc
mailing list