This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
weird SIGSEGV si_code
- From: Kevin Tew <tewk at cs dot utah dot edu>
- To: libc-help at sourceware dot org
- Date: Thu, 10 Dec 2009 11:20:55 -0700
- Subject: weird SIGSEGV si_code
I'm using a SIGSEGV signal handler to handle mprotect violations for a
generational garbage collector.
I'm getting weird random SIGSEGV signals where si_code is 0 and si_addr
is 0x3e80000270f.
0x3e80000270f is not mapped according to /proc/PID/maps
libc code tends to make me think that si->si_code should always be
SEGV_MAPERR = 1 SEGV_ACCERR=2
Any ideas what could cause this or what 0x3e80000xxxx memory addresses mean?
Kevin Tew
void fault_handler(int sn, struct siginfo *si, void *ctx)
{
void *p = si->si_addr;
int c = si->si_code;
printf("%p %i %i\n", p, sn, c);
...
}
p = 0x3e80000270f
sn = 11
si_code = 0
x86_64 Ubuntu Linux 9.10
# uname -a
Linux tan 2.6.31-16-generic #52-Ubuntu SMP Thu Dec 3 22:07:16 UTC 2009
x86_64 GNU/Linux
$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.4.1-4ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --enable-multiarch --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4
--program-suffix=-4.4 --enable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-objc-gc --disable-werror
--with-arch-32=i486 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8)