emerging efence fails with a segfault Reproducible: Always Steps to Reproduce: Just 'emerge efence' Actual Results: # emerge efence Calculating dependencies ...done! >>> emerge (1 of 1) dev-util/efence-2.2.2 to / >>> md5 src_uri ;-) ElectricFence-2.2.2.tar.gz >>> Unpacking source... >>> Unpacking ElectricFence-2.2.2.tar.gz to /var/tmp/portage/efence-2.2.2/work >>> Source unpacked. gcc -g -DUSE_SEMAPHORE -fPIC -c efence.c -o efence.o gcc -g -DUSE_SEMAPHORE -fPIC -c page.c -o page.o gcc -g -DUSE_SEMAPHORE -fPIC -c print.c -o print.o gcc -g -DUSE_SEMAPHORE -fPIC -c tstheap.c -o tstheap.o print.c: In function `EF_Printv': print.c:114: warning: `char' is promoted to `int' when passed through `...' print.c:114: warning: (so you should pass `int' not `char' to `va_arg') gcc -g -DUSE_SEMAPHORE -fPIC -c eftest.c -o eftest.o rm -f libefence.a ar crv libefence.a efence.o page.o print.o a - efence.o a - page.o a - print.o gcc -g -shared -Wl,-soname,libefence.so.0 -o libefence.so.0.0 \ efence.o page.o print.o -lpthread -lc rm -f tstheap gcc -g -DUSE_SEMAPHORE -fPIC tstheap.o libefence.a -o tstheap -lpthread libefence.a(page.o)(.text+0x30): In function `stringErrorReport': /var/tmp/portage/efence-2.2.2/work/ElectricFence-2.2.2/page.c:46: warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead libefence.a(page.o)(.text+0x24):/var/tmp/portage/efence-2.2.2/work/ElectricFence-2.2.2/page.c:45: warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead rm -f eftest gcc -g -DUSE_SEMAPHORE -fPIC eftest.o libefence.a -o eftest -lpthread libefence.a(page.o)(.text+0x30): In function `stringErrorReport': /var/tmp/portage/efence-2.2.2/work/ElectricFence-2.2.2/page.c:46: warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead libefence.a(page.o)(.text+0x24):/var/tmp/portage/efence-2.2.2/work/ElectricFence-2.2.2/page.c:45: warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead Testing Electric Fence. After the last test, it should print that the test has PASSED. ./eftest Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com> make: *** [all] Segmentation fault !!! ERROR: dev-util/efence-2.2.2 failed. !!! Function src_compile, Line 20, Exitcode 2 !!! (no error message) If it matters, I'm using gcc 3.2.3-r3
i looked into this once and i think the answer is 'dont even bother' it died horribly for me on newer glibc/gcc systems ... and the fact that it hasnt be updated in YEARS should be enough to make you want to use valgrind in other words, i vote to close this bug as UPSTREAM and just tell users to use valgrind ;)
maybe this should be completly removed from portage tree
I think it's still useful to have it in the tree for systems where it does work. I agree with Spanky though that we should close it as UPSTREAM since there's really not much we can do about it. I'm going to go ahead and do just that as a matter of fact. We can use this bug as a metabug for future efence bugs if necessary.
*** Bug 47403 has been marked as a duplicate of this bug. ***
*** Bug 53559 has been marked as a duplicate of this bug. ***
Created attachment 39718 [details, diff] Bug Fix
Comment on attachment 39718 [details, diff] Bug Fix diff -uNr ElectricFence-2.2.2-orig/eftest.c ElectricFence-2.2.2/eftest.c --- ElectricFence-2.2.2-orig/eftest.c 1995-01-20 05:54:30.000000000 +0100 +++ ElectricFence-2.2.2/eftest.c 2004-09-16 23:35:42.337147736 +0200 @@ -40,13 +40,13 @@ ) { signal(PAGE_PROTECTION_VIOLATED_SIGNAL, SIG_DFL); - longjmp(env, 1); + siglongjmp(env, 1); } static int gotSegmentationFault(int (*test)(void)) { - if ( setjmp(env) == 0 ) { + if ( sigsetjmp(env, 1) == 0 ) { int status; signal(PAGE_PROTECTION_VIOLATED_SIGNAL