Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Mar 2005 12:26:49 -0800
From:      jtc@acorntoolworks.com (J.T. Conklin)
To:        freebsd-questions@freebsd.org
Subject:   FreeBSD equivalent for SEGV_MAPERR?
Message-ID:  <87k6o3756e.fsf@orac.acorntoolworks.com>

next in thread | raw e-mail | index | archive | help
I'm working on autoconf support for ACE (A C++ framework) and TAO
(Real-time CORBA ORB).  

The resulting configuration is failing for FreeBSD, something I'd
like before the upcoming ACE/TAO release.  I downloaded FreeBSD 5.3
and installed it under vmware to reproduce (and hopefully fix) this
problem.

The configure script detects that FreeBSD supports SA_SIGINFO, the
siginfo_t struct, and the fact siginfo_t has a si_addr field so it
enables code to check for segmentation errors in the shared memory
pool class.  But that fails to compile due to the lack of a
SEGV_MAPERR macro.  The code in question is:

    else if (!(siginfo->si_code == SEGV_MAPERR
           && siginfo->si_addr < (((char *) this->base_addr_) + offset)
           && siginfo->si_addr >= ((char *) this->base_addr_)))
        ACE_ERROR_RETURN ((LM_ERROR,
                           "(%P|%t) address %u out of range\n",
                           siginfo->si_addr),
                          -1);

I wrote a little test program to force a SIGSEGV, and si_addr seems to
have the correct value.  But I don't know what macro/constant I should
be checking si_code against.

    --jtc

-- 
J.T. Conklin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87k6o3756e.fsf>