Page 1 of 1

Monitor never leaves orange status

Posted: Mon Jan 31, 2005 5:46 pm
by bparker
I just installed zm-1.20.0 and whenever I add a new monitor and change the status to anything besides 'none', it stays orange and zma never starts. Trying to run it manually via 'zma -m <id>' exits with a code of 255. Any ideas? I'm running Debian Sarge, BTW.

Posted: Tue Feb 01, 2005 10:05 pm
by zoneminder
Have you gone through the steps in the troubleshooting guide? ANything in /var/log/messages?

Phil

Posted: Thu Feb 03, 2005 4:28 pm
by bparker
Nothing unusual in the logs, where is the troubleshooting guide at?

This is the last bit of output from strace:

gettimeofday({1107440179, 452009}, {360, 0}) = 0
time([1107440179]) = 1107440179
getpid() = 7879
rt_sigaction(SIGPIPE, {0x4088d7a0, [], SA_RESTORER, 0x40772678}, {SIG_IGN}, 8) = 0
socket(PF_FILE, SOCK_DGRAM, 0) = 4
fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
connect(4, {sa_family=AF_FILE, path="/dev/log"}, 16) = -1 ENOENT (No such file or directory)
close(4) = 0
rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0
exit_group(-1) = ?

Posted: Thu Feb 03, 2005 7:16 pm
by zoneminder
The troubleshooting guide is in the README file.

Phil

Posted: Fri Feb 04, 2005 3:26 pm
by bparker
Running 'zmu -d 0 -q -v -U admin -P admin' segfaults...

Posted: Mon Feb 07, 2005 3:43 pm
by bparker
any ideas on how to diagnose that?

Posted: Mon Feb 07, 2005 6:37 pm
by zoneminder
If you have gdb then do

Code: Select all

gdb zmu
run  -d 0 -q -v -U admin -P admin
then when/if it crashes do

Code: Select all

bt
and post the results.

Phil

Posted: Fri Feb 11, 2005 3:08 pm
by bparker

Code: Select all

Starting program: /usr/local/bin/zmu -d 0 -q -v -U admin -P xxxxxxxx
[Thread debugging using libthread_db enabled]

[New Thread 16384 (LWP 1135)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 1135)]
0x40775ebe in __strtol_internal () from /lib/libc.so.6
(gdb) bt full
#0  0x40775ebe in __strtol_internal () from /lib/libc.so.6
No symbol table info available.
#1  0x08060b3e in User (this=0xd1b1e48, dbrow=@0xbfffb80c) at stdlib.h:316
        monitor_ids_str = 0xbfffb80c "È]\033\rselect Username, Password, Stream+0, Events+0, Monitors+0, System+0, MonitorIds from Users where Username = 'admin' and Password = password('xxxxxxxx') and Enabled = 1"
#2  0x08060d3a in zmLoadUser (username=0xd1b1e48 "admin", password=0x408900cc "@û\205@@\t\206@@\003\206@ \211\207@")
    at zm_user.cpp:133
        sql = "select Username, Password, Stream+0, Events+0, Monitors+0, System+0, MonitorIds from Users where Username = 'admin' and Password = password('xxxxxxxx') and Enabled = 1", '\0' <repeats 8024 times>
        result = (MYSQL_RES *) 0xd1b1de0
        n_users = 1082720460
        dbrow = 0xd1b5dc8
#3  0x0804af31 in main (argc=134642259, argv=0xbffffd54) at zmu.cpp:321
        user = (User *) 0x408900cc
        long_options = {{name = 0x8064632 "device", has_arg = 1, flag = 0x0, val = 100}, {name = 0x8064639 "monitor",
    has_arg = 1, flag = 0x0, val = 109}, {name = 0x8064641 "verbose", has_arg = 0, flag = 0x0, val = 118}, {
    name = 0x8064649 "image", has_arg = 2, flag = 0x0, val = 105}, {name = 0x8069448 "scale", has_arg = 1, flag = 0x0,
    val = 83}, {name = 0x806464f "timestamp", has_arg = 2, flag = 0x0, val = 116}, {name = 0x8064659 "state", has_arg = 0,
    flag = 0x0, val = 115}, {name = 0x806465f "brightness", has_arg = 2, flag = 0x0, val = 66}, {name = 0x806466a "contrast",
    has_arg = 2, flag = 0x0, val = 67}, {name = 0x8064673 "hue", has_arg = 2, flag = 0x0, val = 72}, {
    name = 0x806466a "contrast", has_arg = 2, flag = 0x0, val = 79}, {name = 0x8064677 "read_index", has_arg = 0, flag = 0x0,
    val = 114}, {name = 0x8064682 "write_index", has_arg = 0, flag = 0x0, val = 119}, {name = 0x806a69d "event", has_arg = 0,
    flag = 0x0, val = 101}, {name = 0x806468e "fps", has_arg = 0, flag = 0x0, val = 102}, {name = 0x8064692 "zones",
    has_arg = 0, flag = 0x0, val = 122}, {name = 0x806469a "alarm", has_arg = 0, flag = 0x0, val = 97}, {
    name = 0x8064698 "noalarm", has_arg = 0, flag = 0x0, val = 110}, {name = 0x80646a0 "cancel", has_arg = 0, flag = 0x0,
    val = 99}, {name = 0x80646a7 "query", has_arg = 0, flag = 0x0, val = 113}, {name = 0x80646ad "username", has_arg = 1,
    flag = 0x0, val = 85}, {name = 0x80646b6 "password", has_arg = 1, flag = 0x0, val = 80}, {name = 0x80646bf "help",
    has_arg = 0, flag = 0x0, val = 104}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
        dev_id = 0
        mon_id = 0
        verbose = true
        function = QUERY
        image_idx = -1
        scale = -1
        brightness = -1
        contrast = -1
        hue = -1
        colour = -1
        username = 0xbffffe71 "admin"
        password = 0xbffffe7a "xxxxxxxx"
        auth = 0x0
password was changed to x's, that's all

this is the normal bt output:

Code: Select all

(gdb) bt
#0  0x40775ebe in __strtol_internal () from /lib/libc.so.6
#1  0x08060b3e in User (this=0xd1b1e48, dbrow=@0xbfffb80c) at stdlib.h:316
#2  0x08060d3a in zmLoadUser (username=0xd1b1e48 "admin", password=0x408900cc "@û\205@@\t\206@@\003\206@ \211\207@")
    at zm_user.cpp:133
#3  0x0804af31 in main (argc=134642259, argv=0xbffffd54) at zmu.cpp:321

Posted: Fri Feb 11, 2005 5:27 pm
by zoneminder
Hmm, that looks a little strange. If you do a select on the Users table can you post what values you see (I'm interested in what might be NULL or otherwise). Also what the values of dbrow are in gdb.

Phil

Posted: Fri Feb 11, 2005 6:01 pm
by bparker

Code: Select all

mysql> select * from Users;
+----+----------+------------------+----------+---------+--------+--------+----------+--------+------------+
| Id | Username | Password         | Language | Enabled | Stream | Events | Monitors | System | MonitorIds |
+----+----------+------------------+----------+---------+--------+--------+----------+--------+------------+
|  1 | admin    | 49fc982b75ac5d7a |          |       1 | View   | Edit   | Edit     | Edit   | NULL       |
+----+----------+------------------+----------+---------+--------+--------+----------+--------+------------+
1 row in set (0.00 sec)
How do I get the value of dbrow? I couldn't figure it out...

This also looks interesting, don't know if it means anything:

Code: Select all

(gdb) break 321
Breakpoint 1 at 0x804af19: file zmu.cpp, line 321.
(gdb) run -d 0 -q -v -U admin -P xxxxxxxx
Starting program: /usr/local/bin/zmu -d 0 -q -v -U admin -P xxxxxxxx
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 1296)]
[Switching to Thread 16384 (LWP 1296)]

Breakpoint 1, main (argc=134642259, argv=0xbffffd54) at zmu.cpp:321
321                             user = zmLoadUser( username, password );
(gdb) step
zmLoadUser (username=0x800 <Address 0x800 out of bounds>, password=0xbffffe75 "xxxxxxxx") at zm_user.cpp:108
108             char sql[BUFSIZ] = "";

Posted: Fri Feb 11, 2005 7:51 pm
by zoneminder
Try 'x dbrow' or failing that 'p dbrow[0]', 'p dbrow[1]' etc

Posted: Fri Feb 11, 2005 8:22 pm
by bparker

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 1390)]
0x40775ebe in __strtol_internal () from /lib/libc.so.6
(gdb) x dbrow
No symbol "dbrow" in current context.
(gdb) p dbrow[0]
No symbol "dbrow" in current context.
(gdb) p dbrow[1]
No symbol "dbrow" in current context.
(gdb) up
#1  0x08060b3e in User (this=0xd1b1e48, dbrow=@0xbfffb81c) at stdlib.h:316
316     {
(gdb) x dbrow
0xd1b5de8:      0x696d6461
(gdb) p dbrow[0]
$1 = 0xd1b5de8 "admin"
(gdb) p dbrow[1]
$2 = 0xd1b5dee "49fc982b75ac5d7a"
(gdb) p dbrow[2]
$3 = 0xd1b5dff "2"
(gdb) p dbrow[3]
$4 = 0xd1b5e01 "3"
(gdb) p dbrow[4]
$5 = 0xd1b5e03 "3"
(gdb) p dbrow[5]
$6 = 0xd1b5e05 "3"
(gdb) p dbrow[6]
$7 = 0x0
(gdb) p dbrow[7]
$8 = 0xd1b5e07 ""
(gdb) p dbrow[8]
$9 = 0x696d6461 ""
(gdb) p dbrow[9]
$10 = 0x3934006e <Address 0x3934006e out of bounds>
(gdb)

Posted: Sun Mar 27, 2005 10:00 pm
by bparker
anyone ever find a solution to this?

Posted: Sun Mar 27, 2005 10:07 pm
by cordel
Have you tried the new release yet? Phil might have found the issue and made the changes in hte new release and forgot to post the findings. It's not hard to lose things like that on the forum. I've set up a bug tracker but still have to talk to Phil about it.
Cheers,
Cordel

Posted: Tue Mar 29, 2005 10:33 pm
by zoneminder
I did find an issue relatively recently with uninitialised user data in zmu. This was fixed in 1.21.0 if not before. . I'd forgotten that anyone had mentioned a problem with it so it probably got wrapped up in other change. It's probably worth retrying this issue though on the newer version.

Phil