ar- / incron

cron-like daemon which handles filesystem events
Other
229 stars 51 forks source link

Consistent segmentation faults upon creating directories #36

Open GSI opened 7 years ago

GSI commented 7 years ago

I can consistently crash incrond 0.5.12 with a single mkdir command.

incrontab:

/tmp/i IN_CREATE echo $@/$# $%

Journal output upon mkdir /tmp/i/del:

incrond[13604]: PATH (/tmp/i) FILE (del) EVENT (IN_CREATE,IN_ISDIR)
systemd[1]: incrond.service: Main process exited, code=dumped, status=11/SEGV
systemd[1]: incrond.service: Unit entered failed state.
systemd[1]: incrond.service: Failed with result 'core-dump'.

Backtrace:

(gdb) bt
#0  0x00007f07242bc3e8 in memchr () from /usr/lib/libc.so.6
#1  0x00007f07249138aa in std::char_traits<char>::find (__a=<synthetic pointer>: <optimized out>, __n=<optimized out>,
    __s=<optimized out>) at /build/gcc-multilib/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/char_traits.h:274
#2  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find (this=<optimized out>, __c=<optimized out>,
    __pos=<optimized out>) at /build/gcc-multilib/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:1209
#3  0x000000000040fd71 in ?? ()
#4  0x000000000041060e in ?? ()
#5  0x0000000000404412 in ?? ()
#6  0x00007f0724259291 in __libc_start_main () from /usr/lib/libc.so.6
#7  0x0000000000405249 in ?? ()

Observations:

UnitedMarsupials-zz commented 7 years ago

Could you build the daemon with -O0 -g flags and reproduce the problem? The gdb stack should be much nicer then...

galaxy4public commented 6 years ago

This is a very consistent bug -- and @GSI provided exact steps to reproduce it. Unfortunately, an year later this issue is still open and is biting people who are trying to use incrond.

The bug is between lines usertable.cpp#L390 and usertable.cpp#L408 where incrond "forgets" and reloads itself, then tries to process an event it just forgot about :)

frayber commented 5 years ago

I have 0.5.12 too on a centos 7, same behaviour,moreover sometimes a huge number of incrond processes appear which freezes the system (load1 up to 2000!), with a lot of messages like these:

auditd[766]: dispatch error reporting limit reached - ending report notification. auditd[766]: dispatch err (pipe full) event lost

Thank you.

Nikoh77 commented 3 years ago

hi guys, i am same problem, is incron stiil in development? This bug is a big bug... can someone investigate and solve please? I am on ubuntu server 20.04 and incron 5.12

patricksebastien commented 1 year ago

Same problem, on verion 0.5.12. Anyone reading this and cannot wait for @ar- to work on this:

checkout this commit from @galaxy4public https://github.com/galaxy4public/incron/commit/134900ea1dd19834ba6e6c7e7e07611a0e0d78a0

make & make install
cp incrond /usr/sbin/incrond