Even if I compile a trivial program int "main(){}" with "gcc -lefence -o a a.c" and then run it, I get clock@kestrel:~/pcb-20060321$ ./a ElectricFence Aborting: Semaphore isn't owned by this thread Illegal instruction (core dumped) efence is 2.4.13-r1 clock@kestrel:~$ emerge info Portage 2.0.54 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r2, 2.6.12-gent oo-r10 i686) ================================================================= System uname: 2.6.12-gentoo-r10 i686 Intel(R) Pentium(R) M processor 1.50GHz Gentoo Base System version 1.6.14 dev-lang/python: 2.3.5-r2, 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=pentium3 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share /config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/ mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/sh are/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/te x/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=pentium3 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/ distributions/gentoo" LC_ALL="en_US.UTF-8" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X aac aalib alsa apm arts audiofile avi berkdb bitmap-fonts bzip2 cdr c rypt cups curl dga divx4linux dri dv dvd dvdread eds emboss encode esd ethereal exif expat fam ffmpeg fftw flac flash foomatic foomaticdb fortran ftp gd gdbm gi f glut gnome gpm gstreamer gtk gtk2 gtkhtml guile icq idn imagemagick imap imlib ipv6 jabber jack java javascript jpeg kde lcms ldap libcaca libg++ libwww live matroska mhash mikmod ming mmap mmx mng motif mozilla mp3 mpeg mysql nas ncurses nls ogg oggvorbis opengl oss pam pcre pdflib perl php png python qt quicktime r eadline real recode ruby samba sdl sharedmem shorten slang socks5 speex spell ss e ssl svg svga tcltk tcpd tetex theora threads tiff tls truetype truetype-fonts type1-fonts udev unicode usb vorbis wifi win32codecs wmf xine xinerama xml xml2 xmms xpm xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Electric Fence works for me in this regard. The test program exits normally. But I get another problem: #include <new> #include <efencepp.h> #include <string> int main() {const std::string s;} g++: /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/ext/new_allocator.h: In member function '_Tp* __gnu_cxx::new_allocator<_Tp>::allocate(size_t, const void*)': /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/ext/new_allocator.h:90: error: 'operator new("/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/ext/new_allocator.h", 90)' cannot be used as a function /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/ext/new_allocator.h: In member function 'void __gnu_cxx::new_allocator<_Tp>::construct(_Tp*, const _Tp&)': /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/ext/new_allocator.h:106: error: expected type-specifier before '__p' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/ext/new_allocator.h:106: error: expected `)' before '__p' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/ext/new_allocator.h:106: error: expected `;' before '__p' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_construct.h: In function 'void std::_Construct(_T1*, const _T2&)': /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_construct.h:81: error: expected type-specifier before 'static_cast' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_construct.h:81: error: expected `)' before 'static_cast' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_construct.h:81: error: expected `;' before 'static_cast' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_construct.h: In function 'void std::_Construct(_T1*)': /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_construct.h:96: error: expected type-specifier before 'static_cast' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_construct.h:96: error: expected `)' before 'static_cast' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_construct.h:96: error: expected `;' before 'static_cast' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/memory: In function 'std::pair<_Tp*, int> std::__get_temporary_buffer(ptrdiff_t, _Tp*)': /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/memory:84: error: 'operator new("/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/memory", 83)' cannot be used as a function /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/basic_string.tcc: In static member function 'static typename std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type, const _Alloc&)': /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/basic_string.tcc:589: error: expected type-specifier before '__place' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/basic_string.tcc:589: error: expected `)' before '__place' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/bits/basic_string.tcc:589: error: expected ',' or ';' before '__place'
(In reply to comment #1) > Electric Fence works for me in this regard. The test program exits normally. > But I get another problem: > #include <new> > #include <efencepp.h> > #include <string> > int main() {const std::string s;} > string uses some internal declaration of new which efence change. try use #include <new> #include <string> #include <efencepp.h> it works for me.
Matej, have you tried dev-util/duma? That's the new name for efence... It's good idea to remove efence from the tree as it's three years old and is unsupported by upstream.
plus it doesn't even compile; adding treecleaners
masked for removal, please use dev-util/duma instead
Gone.