tkshi / lsyncd

Automatically exported from code.google.com/p/lsyncd
GNU General Public License v2.0
0 stars 0 forks source link

lsyncd crashes when it gets a notification from kernel #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compile lsyncd on rhel 5.5 (also compile lua-5.1 and rsync-3.0.8).
2. Run lsyncd -rsync /tmp/foo host:/tmp/foo
3. Initial startup goes well.
4. touch /tmp/foo/me
5. Crash.

What is the expected behavior? What does Lsyncd do instead?

Lsync should work, but instead it crashes. :)

What version of Lsyncd are you using? On what operating system (host and 
target(s)?

We're running linux rhel 5.5. The rhel doesn't have prebuilt packages for lua 
and it's rsync is too old, but I've dodged these issues already.

If applicable please copy/paste your Lsyncd configuration file.

Running on defaults.

If applicable please copy/paste a logfile generated with '-log all' of a 
minimal testcase that raises this problem.

kernels clocks_per_sec=100
Call: configure()
Inotify: inotify fd = 3
Call: initialize()
09:35:36 Function: Inotify.addWatch(/tmp/foo/, (true), (nil), (nil))
09:35:36 Inotify: addwatch(/tmp/foo/)->1
09:35:36 Call: getAlarm()
09:35:36 Alarm: runner.getAlarm returns: (true)
09:35:36 Masterloop: immediately handling delays.
09:35:36 Call: cycle()
09:35:36 Function: invokeActions('Sync1',(Timestamp: 6129235.2))
09:35:36 Normal: recursive startup rsync: /tmp/foo/ -> DSTHOST:/tmp/foo/
09:35:36 Exec: /opt/ami/rsync-3.0.8/bin/rsync [--delete] [-lts] [-r] 
[/tmp/foo/] [DSTHOST:/tmp/foo/]
09:35:36 Call: getAlarm()
09:35:36 Alarm: runner.getAlarm returns: (false)
09:35:36 Masterloop: going into select (no timeout).
09:35:36 Call: collectProcess()
09:35:36 Delay: collected an event
09:35:36 Normal: Startup of '/tmp/foo/' finished.
09:35:36 Delay: Finish of Init on /tmp/foo/ = 0
09:35:36 Call: cycle()
09:35:36 Function: invokeActions('Sync1',(Timestamp: 6129235.53))
09:35:36 Call: getAlarm()
09:35:36 Alarm: runner.getAlarm returns: (false)
09:35:36 Masterloop: going into select (no timeout).
09:36:03 Call: inotifyEvent()
09:36:03 Inotify: got event Create me(1)
09:36:03 Function: delay(Sync1, Create, /me, (nil))
09:36:03 Delay: New Create:/me
09:36:03 Call: cycle()
09:36:03 Function: invokeActions('Sync1',(Timestamp: 6129262.04))
09:36:03 Call: getAlarm()
09:36:03 Alarm: runner.getAlarm returns: (Timestamp: 6129277.04)
PANIC: unprotected error in call to Lua API (bad argument #-1 (Lsyncd.jiffies 
expected, got table))

Please provide any additional information below.

The source directory /tmp/foo is empty at startup. Then I do touch /tmp/foo/me 
and at 09:36:03 lsyncd reacts to that. Then something goes wrong and I get the 
PANIC message.

Original issue reported on code.google.com by atvol3....@gmail.com on 29 Aug 2011 at 6:42

GoogleCodeExporter commented 8 years ago
What version of Lsyncd are you running?
What version of Lua? 5.1 or 5.1.4? If not the later try upgrading that.

For further debugging, we can try to add a stackdump here:

--- lsyncd.c    (revision 587)
+++ lsyncd.c    (working copy)
@@ -1569,7 +1569,7 @@
                if (lua_pcall(L, 0, 1, -2)) {
                        exit(-1); // ERRNO
                }
-
+               l_stackdump(L);
                if (lua_type(L, -1) == LUA_TBOOLEAN) {
                        have_alarm = false;
                        force_alarm = lua_toboolean(L, -1);

Original comment by axk...@gmail.com on 29 Aug 2011 at 7:28

GoogleCodeExporter commented 8 years ago

Original comment by axk...@gmail.com on 16 Sep 2011 at 10:12