Closed wschlich closed 11 years ago
Hello Wolfram,
could you, please, run skyldav with valgrind to identify where the illegal access occurs.
Does the problem also occur for the git head?
Best regards
Heinrich
Btw here is the gdb backtrace:
zephyr tmp # gdb $(which skyldav) --core core.*
GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/bin/skyldav...Reading symbols from /usr/lib64/debug/usr/bin/skyldav.debug...done.
done.
[New LWP 19619]
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff0bba9000
Core was generated by `skyldav -m 1'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f4ae6d09cef in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) ()
from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6
(gdb) thread apply all bt full
Thread 1 (Thread 0x7f4ae7561780 (LWP 19619)):
#0 0x00007f4ae6d09cef in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) ()
from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6
No symbol table info available.
#1 0x00007f4ae7183d98 in operator<< <char, std::char_traits<char>, std::allocator<char> > (__str="I", __os=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4/bits/basic_string.h:2698
No locals.
#2 Messaging::message (level=<optimized out>, message="Cache size 1, cache hits 19, cache misses 1.") at Messaging.cc:114
type = "I"
#3 0x00007f4ae718c2cb in ScanCache::~ScanCache (this=<optimized out>, __in_chrg=<optimized out>) at ScanCache.cc:170
pos = <optimized out>
msg = <incomplete type>
#4 0x00007f4ae718c639 in ScanCache::~ScanCache (this=0x16470d0, __in_chrg=<optimized out>) at ScanCache.cc:171
No locals.
#5 0x00007f4ae7183769 in Environment::~Environment (this=0x1646fd0, __in_chrg=<optimized out>) at Environment.cc:72
No locals.
#6 0x0000000000402def in main (argc=<optimized out>, argv=<optimized out>) at main.cc:380
daemonized = 0
e = 0x1646fd0
shalldaemonize = <optimized out>
act = {__sigaction_handler = {sa_handler = 0x403190 <hdl(int)>, sa_sigaction = 0x403190 <hdl(int)>}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x7f4ae66c7c30}
opt = <optimized out>
fp = 0x1647270
messageLevel = 1
blockset = {__val = {512, 0 <repeats 15 times>}}
i = <optimized out>
cfile = 0x403dae "/etc/skyldav.conf"
nThread = <optimized out>
(gdb)
Still want me to run it with valgrind? I'll try git head now.
Also happens with git head.
When running skyldav with valgrind, there's a completely different and quite weird error:
zephyr tmp # valgrind skyldav -m 1
==3128== Memcheck, a memory error detector
==3128== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==3128== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==3128== Command: skyldav -m 1
==3128==
==3128== Syscall param capget(data) points to unaddressable byte(s)
==3128== at 0x5855BD7: capget (in /lib64/libc-2.15.so)
==3128== by 0x504CDC2: cap_init (in /lib64/libcap.so.2.22)
==3128== by 0x504CE55: cap_get_proc (in /lib64/libcap.so.2.22)
==3128== by 0x4029C0: main (in /usr/bin/skyldav)
==3128== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==3128==
Starting on access scanning.
Loading virus database
2565401 signatures loaded
--3128-- WARNING: unhandled syscall: 300
--3128-- You may be able to write your own handler.
--3128-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--3128-- Nevertheless we consider this a bug. Please report
--3128-- it at http://valgrind.org/support/bug_reports.html.
fanotifyOpen: Function not implemented
Failure starting fanotify listener.
Cache size 0, cache hits 0, cache misses 0.
==3128==
==3128== HEAP SUMMARY:
==3128== in use at exit: 3,281,878 bytes in 17,910 blocks
==3128== total heap usage: 436,003 allocs, 418,093 frees, 116,409,594 bytes allocated
==3128==
==3128== LEAK SUMMARY:
==3128== definitely lost: 88 bytes in 2 blocks
==3128== indirectly lost: 856 bytes in 4 blocks
==3128== possibly lost: 2,260,673 bytes in 9,086 blocks
==3128== still reachable: 1,020,261 bytes in 8,818 blocks
==3128== suppressed: 0 bytes in 0 blocks
==3128== Rerun with --leak-check=full to see details of leaked memory
==3128==
==3128== For counts of detected and suppressed errors, rerun with: -v
==3128== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2)
zephyr tmp #
fatrace
also does not seem to work (anymore), so maybe I've broken fanotify for now ;) I'll reboot...
Hello Wolfram,
I would like to reproduce the issue. Could you, please, indicate the version of Gentoo you are using (release, processor, bitness, kernel version) and send me the ebuild script you use. Furthermore, please, indicate the packages I should "emerge".
Best regards
Heinrich
Hi Heinrich!
There is no such thing as a Gentoo version ;-)) I've already posted the most important lines of emerge --info
(which contains all of the information you requested) in this bug report, but here's the complete output: http://paste.frubar.net/15595
If you have more questions, just contact me. Do you use Jabber?
I'm also using native ZFS as my main filesystem on this machine. Does fanotify need any special kind of filesystem support?
Here's a more complete backtrace btw:
[New LWP 13397]
[New LWP 13448]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `skyldav -m 1'.
Program terminated with signal 11, Segmentation fault.
#0 std::basic_ostream<char, std::char_traits<char> >::sentry::sentry (this=0x7fff3e435580, __os=...) at /var/tmp/portage/sys-devel/gcc-4.6.3/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ostream.tcc:53
Thread 2 (Thread 0x7ff5836d0700 (LWP 13448)):
#0 pthread_cond_timedwait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:215
No locals.
#1 0x00007ff597b5434a in bytecode_watchdog (arg=<optimized out>) at bytecode2llvm.cpp:1911
tv = {tv_sec = 1376630863, tv_usec = 719984}
out = {tv_sec = 1376630873, tv_nsec = 719984000}
ret = <optimized out>
err = '\000' <repeats 127 times>
#2 0x00007ff59881dec6 in start_thread (arg=0x7ff5836d0700) at pthread_create.c:305
__res = <optimized out>
pd = 0x7ff5836d0700
now = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 2304027535247353170, 140692524518832, 140692448676288, 140692820275200, 3, -2300624658379889326, -2300567733982780078}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = 0
robust = <optimized out>
pagesize_m1 = <optimized out>
sp = <optimized out>
freesize = <optimized out>
__PRETTY_FUNCTION__ = "start_thread"
#3 0x00007ff598b1c6ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
No locals.
Thread 1 (Thread 0x7ff5998df780 (LWP 13397)):
#0 std::basic_ostream<char, std::char_traits<char> >::sentry::sentry (this=0x7fff3e435580, __os=...) at /var/tmp/portage/sys-devel/gcc-4.6.3/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ostream.tcc:53
No locals.
#1 0x00007ff599087b89 in std::__ostream_insert<char, std::char_traits<char> > (__out=..., __s=0xb4f9d8 "I", __n=1) at /var/tmp/portage/sys-devel/gcc-4.6.3/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ostream_insert.h:82
__cerb = {_M_ok = false, _M_os = @0xb4fd00}
#2 0x00007ff599501d98 in operator<< <char, std::char_traits<char>, std::allocator<char> > (__str="I", __os=...) at /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4/bits/basic_string.h:2698
No locals.
#3 Messaging::message (level=<optimized out>, message="Cache size 1455, cache hits 15694, cache misses 1741.") at Messaging.cc:114
type = "I"
#4 0x00007ff59950a2cb in ScanCache::~ScanCache (this=<optimized out>, __in_chrg=<optimized out>) at ScanCache.cc:170
pos = <optimized out>
msg = {<std::basic_iostream<char, std::char_traits<char> >> = {<std::basic_istream<char, std::char_traits<char> >> = {<std::basic_ios<char, std::char_traits<char> >> = {<std::ios_base> = {_vptr.ios_base = 0x605308 <vtable for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >+104>, static boolalpha = std::_S_boolalpha, static dec = std::_S_dec, static fixed = std::_S_fixed, static hex = std::_S_hex, static internal = std::_S_internal, static left = std::_S_left, static oct = std::_S_oct, static right = std::_S_right, static scientific = std::_S_scientific, static showbase = std::_S_showbase, static showpoint = std::_S_showpoint, static showpos = std::_S_showpos, static skipws = std::_S_skipws, static unitbuf = std::_S_unitbuf, static uppercase = std::_S_uppercase, static adjustfield = std::_S_adjustfield, static basefield = std::_S_basefield, static floatfield = std::_S_floatfield, static badbit = std::_S_badbit, static eofbit = std::_S_eofbit, static failbit = std::_S_
failbit, static goodbit = std::_S_goodbit, static app = std::_S_app, static ate = std::_S_ate, static binary = std::_S_bin, static in = std::_S_in, static out = std::_S_out, static trunc = std::_S_trunc, static beg = std::_S_beg, static cur = std::_S_cur, static end = std::_S_end, _M_precision = 6, _M_width = 0, _M_flags = 4098, _M_exception = std::_S_goodbit, _M_streambuf_state = std::_S_goodbit, _M_callbacks = 0x0, _M_word_zero = {_M_pword = 0x0, _M_iword = 0}, _M_local_word = {{_M_pword = 0x0, _M_iword = 0}, {_M_pword = 0x0, _M_iword = 0}, {_M_pword = 0x0, _M_iword = 0}, {_M_pword = 0x0, _M_iword = 0}, {_M_pword = 0x0, _M_iword = 0}, {_M_pword = 0x0, _M_iword = 0}, {_M_pword = 0x0, _M_iword = 0}, {_M_pword = 0x0, _M_iword = 0}}, _M_word_size = 8, _M_word = 0x7fff3e4356f8, _M_ios_locale = {static none = 0, static ctype = 1, static numeric = 2, static collate = 4, static time = 8, static monetary = 16, static messages = 32, static all = 63, _M_impl = 0x7ff5992dffa0 <(anonymous namespace)::c_locale_impl>,
static _S_classic = 0x7ff5992dffa0 <(anonymous namespace)::c_locale_impl>, static _S_global = 0x7ff5992dffa0 <(anonymous namespace)::c_locale_impl>, static _S_categories = 0x7ff5992d5ce0 <__gnu_cxx::category_names>, static _S_once = 2}}, _M_tie = 0x0, _M_fill = 32 ' ', _M_fill_init = true, _M_streambuf = 0x7fff3e435668, _M_ctype = 0x7ff5992e0220 <(anonymous namespace)::ctype_c>, _M_num_put = 0x7ff5992e0540 <(anonymous namespace)::num_put_c>, _M_num_get = 0x7ff5992e0530 <(anonymous namespace)::num_get_c>}, _vptr.basic_istream = 0x6052b8 <vtable for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >+24>, _M_gcount = 0}, <std::basic_ostream<char, std::char_traits<char> >> = {_vptr.basic_ostream = 0x6052e0 <vtable for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >+64>}, <No data fields>}, _M_stringbuf = {<std::basic_streambuf<char, std::char_traits<char> >> = {_vptr.basic_streambuf = 0x605330 <vtable for std::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >+16>, _M_in_beg = 0xb71368 "Cache size 1455, cache hits 15694, cache misses 1741.\177", _M_in_cur = 0xb71368 "Cache size 1455, cache hits 15694, cache misses 1741.\177", _M_in_end = 0xb71369 "ache size 1455, cache hits 15694, cache misses 1741.\177", _M_out_beg = 0xb71368 "Cache size 1455, cache hits 15694, cache misses 1741.\177", _M_out_cur = 0xb7139d "\177", _M_out_end = 0xb71568 "\241", _M_buf_locale = {static none = 0, static ctype = 1, static numeric = 2, static collate = 4, static time = 8, static monetary = 16, static messages = 32, static all = 63, _M_impl = 0x7ff5992dffa0 <(anonymous namespace)::c_locale_impl>, static _S_classic = 0x7ff5992dffa0 <(anonymous namespace)::c_locale_impl>, static _S_global = 0x7ff5992dffa0 <(anonymous namespace)::c_locale_impl>, static _S_categories = 0x7ff5992d5ce0 <__gnu_cxx::category_names>, static _S_once = 2}}, _M_mode = (std::_S_in | std::_S_out), _M_string = "C"}}
#5 0x00007ff59950a639 in ScanCache::~ScanCache (this=0xb4f0e0, __in_chrg=<optimized out>) at ScanCache.cc:171
No locals.
#6 0x00007ff599501769 in Environment::~Environment (this=0xb4efe0, __in_chrg=<optimized out>) at Environment.cc:72
No locals.
#7 0x0000000000402def in main (argc=<optimized out>, argv=<optimized out>) at main.cc:380
daemonized = 0
e = 0xb4efe0
shalldaemonize = <optimized out>
act = {__sigaction_handler = {sa_handler = 0x403190 <hdl(int)>, sa_sigaction = 0x403190 <hdl(int)>}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x7ff598a45c30}
opt = <optimized out>
fp = 0xb4f280
messageLevel = 1
blockset = {__val = {512, 0 <repeats 15 times>}}
i = <optimized out>
cfile = 0x403dae "/etc/skyldav.conf"
nThread = <optimized out>
The kernel logs this:
[ 4157.977847] skyldav[13397]: segfault at ffffffffffffffe8 ip 00007ff599087471 sp 00007fff3e435550 error 5 in libstdc++.so.6.0.16[7ff598ff0000+e6000]
Cheers, Wolfram
Btw, the segfault does not occur when running skyldav
with -d
:-)
Here's your ebuild, just unpack it to /usr/local/portage
(might need to be created first) and make sure you have PORTDIR_OVERLAY=/usr/local/portage
in /etc/make.conf
(or /etc/portage/make.conf
):
http://dev.gentoo.org/~wschlich/src/app-antivirus_skyldav.tar.bz2
The ebuild also introduces some patches (disables the installation of the examples
folder and moves skyldav
from /usr/bin
to /usr/sbin
(I've seen that some distros symlink /usr/sbin
to /usr/bin
, but we're not doing that :-)).
Cheers, Wolfram
Hmm, now it does also segfault when running skyldav
with -d
, as opposed to my previous comment:
2013-08-16 23:02:07 +02:00; zephyr; user.notice; skyldav[7223]: On access scanning stopped.
2013-08-16 23:02:07 +02:00; zephyr; user.notice; skyldav[7223]: Cache size 5926, cache hits 21606, cache misses 6405.
2013-08-16 23:02:07 +02:00; zephyr; kern.info; kernel: [ 317.440988] skyldav[7223]: segfault at ffffffffffffffe8 ip 00007f7df0954471 sp 00007fff628c04f0 error 5 in libstdc++.so.6.0.16[7f7df08bd000+e6000]
Cheers, Wolfram
Hello Wolfram,
"emerge skyldav" results in an error:
The ebuild selected to satisfy "x11-libs/gtk+3:3" has unmet requirements The following REQUIRED_USE flag constraints are unsatisfied REQUIRED_USE=" || ( aqua wayland X ) xinerama? ( X )"
Best regards
Heinrich
Hi Heinrich!
I'm wondering what depends on x11-libs/gtk+3:3
, because skyldav depends on x11-libs/gtk+:2
.
It's probably easier to just specify USE="-libnotify"
to not build skyldavnotify (and thus not depend on gtk stuff) with my latest skyldav ebuild from my overlay:
emerge -avt layman
layman -a wschlich-testing
If you're not fine with that, please post the full output of emerge -avt skyldav
.
Cheers, Wolfram
Btw, here are my CFLAGS and USE flags:
CFLAGS="-O2 -march=native -pipe -ggdb"
USE="X X509 Xaw3d a52 aac aalib accounting acl acpi aim aliaschain alsa amd64 async audiofile avahi avi bash-completion bcmath bitmap-fonts bluetooth branding bzip2 bzlib cairo calendar cap caps cdda cddb cdinstall cdr cdrom cgi chipcard chroot cjk clamav cli client cnamefix codecs consolekit cpdflib cracklib crypt cryptsetup cscope css ctype cups curl curlwrappers cxx cyrus dbus declarative dedicated devmap dga dhcp distcache divx4linux djbfft dmi dri droproot dts dumb-allegro dv dvby dvd dvdr dvdread dynamic editor emboss encode escreen ethereal evo exif expat extensions fam fastcgi fax fb fbcon fbdev festival ffmpeg firefox flac flash flatfile flood font-server fontconfig foomaticdb freetype ftp fusion fwdzone g3dvl gatos gb gcj gd gdbm gif gimp gimpprint glep gnuplot gpg2-experimental gphoto2 gpm gps graphviz gs gstreamer hbciiconv iconv icq icu idea idled ieee1394 image imagemagick imap imlib imlib2 inifile innodb inotify ipalias ipv6 irc irda isdn isdnlog j2ee jabber java javacomm javadoc javascript jikes jp2 jpeg jpeg2k kde kipi ladcca largeterminal lcd lcms ldap libgda libnotify libwww live lmtp logrotate ltsp lufsusermount lzma mad mailbox maildir maildrop mbox mcal md5sum mdb memlimit messages mew mhash midi mikmod milter mime mimencode ming mixer mjpeg mmap mmx mmx2 mmxext mng mnogosearch modules monkey mozcalendar mozilla moznocompose moznoirc mozp3p mozsvg mozxmlterm mp3 mp4 mpeg mplayer mppe-mppc msn mtp mudflap multi-tty multicall multilib multipleip music mysql mysqli nagios-dns nagios-ntp nagios-ping nagios-ssh nas ncurses net netboot nethack network networkmanager neural nis nls nntp nptl nptlonly nsplugin ntlm oav objcocaml offensive ofx ogg oggvorbis openal opengl openntpd openssh operanom2 oscar ospfapi otr pam pango parse-clocks passfile pcap pcmcia pcntl pcre pda pdf pdfkit pdflib pear-db perl phonon pic pie plasma png pnp policykit posix ppds pppd print procmail profile pthreads pwdb python qt3support qt4 quicktime quotas radius rar rdesktop readline reflection remote resolvconf roundrobin rrdcgi rrdtool rss rtc samba sample sasl scanner screenshot sdk sdl semantic-desktop semanticfix sendfile serial server session sftplogging shaper shorten silc simplexml skey slp smartcard smime smp sms smtp sndfile snmp soap sockets socks5 softquota sox spell spl sqlite sqlite3 sse sse2 sse3 ssl ssse3 startup-notification stats subtitles svg sysfs syslog sysvipc szip taglib tcltk tcpd tcpmd5 tcsim tetex theora threads thumbnail tiff tokenizer transcode transparent-proxy truetype truetype-fonts trusted type1 type1-fonts udev udisks unicode upower usb userlocales uudeview v4l v4l2 vcd vda vdpau vhosts videos vim vim-pager vim-syntax vim-with-x virus-scan vnc vorbis wddx webkit wifi winbind withsamplescripts wma123 wmf wxwidgets wxwindows x264 xanim xattr xcb xcomposite xface xforms xfs xine xinerama xinetd xml xml2 xmlrpc xorg xosd xpm xprint xrandr xscreensaver xsl xulrunner xv xvid yahoo yv12 zip zlib"
This should make it easier to build a Gentoo installation similar to mine.
Cheers, Wolfram
I was not able to setup a Gentoo test system, see Gentoo's Bugzilla – Bug 481690 https://bugs.gentoo.org/show_bug.cgi?id=481690
You have to enable CONFIG_SECURITY :-)
Hello Wolfram,
thanks for the hint. I was able to setup a virtual machine now. When installing skyldav I fould that your ebuild lacks a dependency for clamav.
I was not able to reproduce the error. But looking at the traces I guess the following patch addresses a problem that could lead to the error you observed: https://github.com/xypron/skyldav/commit/821d50dca3951564956f3dce8cc53291354cb43d
Could you, please, retest.
Best regards
Heinrich
Hi Heinrich!
Thanks, funny that I forgot the ClamAV dep! :-) Fixed in http://overlays.gentoo.org/dev/wschlich/browser/testing/app-antivirus/skyldav/skyldav-0.2_rc3_p20130821-r1.ebuild
I can confirm that the segfault issue is fixed now.
Cheers, Wolfram
Hi Heinrich!
I just built a Gentoo ebuild for skyldav 0.2rc3.
Compilation etc. was fine, starting up also, but when closing skyldav, it segfaults:
/etc/skyldav.conf
:Here's some more system info from
emerge --info
:Cheers, Wolfram