[OpenSER-Devel] [ openser-Bugs-1891453 ] db_text: openser doesn't exit properly if contacts loaded

SourceForge.net noreply at sourceforge.net
Tue Feb 12 17:15:14 CET 2008


Bugs item #1891453, was opened at 2008-02-11 15:43
Message generated for change (Comment added) made by osas
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1891453&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ovidiu Sas (osas)
Assigned to: Daniel-Constantin Mierla (miconda)
Summary: db_text: openser doesn't exit properly if contacts loaded

Initial Comment:
If expired contacts are present in the db_text database when openser starts up, on exit, openser will hang.

How to reproduce the problem?
1. start openser: openserctl start
2. load a contact in the db: openserctl ul add user sip:user at 1.2.3.4 15
3. stop openser: openserctl stop
4. wait more then 15s for the contact to be expired
5. start openser: openserctl start
   the usrloc module will complain about it: ERROR:usrloc:preload_udomain: load end time [1202768230]
6. stop openser: openserctl stop

a ps will show that there are still two openser processes running.

I didn't tested this with other data bases, but the result may be the same.


Regards,
Ovidiu Sas

----------------------------------------------------------------------

>Comment By: Ovidiu Sas (osas)
Date: 2008-02-12 11:15

Message:
Logged In: YES 
user_id=1395524
Originator: YES

(gdb) bt
#0  0x400d3e58 in wait () from /lib/tls/libc.so.6
#1  0x0806225a in handle_sigs () at main.c:460
#2  0x08063bc5 in main_loop () at main.c:864
#3  0x08065708 in main (argc=3, argv=0xbffffd54) at main.c:1318

(gdb) bt
#0  fm_status (qm=0x816f900) at mem/f_malloc.c:513
#1  0x08062de2 in sig_usr (signo=15) at main.c:568
#2  <signal handler called>
#3  0x40112d5a in recvfrom () from /lib/tls/libc.so.6
#4  0x080b3ef9 in udp_rcv_loop () at udp_server.c:396
#5  0x08063873 in main_loop () at main.c:779
#6  0x08065708 in main (argc=3, argv=0xbffffd54) at main.c:1318

----------------------------------------------------------------------

Comment By: Daniel-Constantin Mierla (miconda)
Date: 2008-02-12 10:58

Message:
Logged In: YES 
user_id=1246013
Originator: NO

Can you compile with debugging symbols and send the trace again, to see
the line in the code.

Other option is that one lock is set when the sig term is issued, and
openser blocks when tries to sync back the records to file in the mod
destroy function.

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2008-02-12 10:49

Message:
Logged In: YES 
user_id=1395524
Originator: YES

It is not compiled with memory debug, only debug.
If I don't have a record in the usrloc, openser exits properly.

----------------------------------------------------------------------

Comment By: Daniel-Constantin Mierla (miconda)
Date: 2008-02-12 10:30

Message:
Logged In: YES 
user_id=1246013
Originator: NO

OK, it is not related to usrloc or db module. I guess you have it compiled
with memory debug and takes quite a while to write the shutdown status.

If the memory status is not dumped in 1 min, then openser kills itself
with sig 9, and no further cleanup. Perhaps the cleanups for deleting pid,
a.s.o, should be done before starting printing the memory status -- I need
to check if it is possible.

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2008-02-12 10:25

Message:
Logged In: YES 
user_id=1395524
Originator: YES

After aproximative one minute, the remaining two openser processes exits,
but the openser.pid file is not cleared out.

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2008-02-12 10:16

Message:
Logged In: YES 
user_id=1395524
Originator: YES

# ps -aef --forest | grep openser
root      7822     1  0 11:53 ?        00:00:00 /usr/local/sbin/openser -P
/var/run/openser.pid
root      7824  7822 57 11:53 ?        00:00:05  \_
/usr/local/sbin/openser -P /var/run/openser.pid

# gdb /usr/local/sbin/openser 7822
(gdb) bt
#0  0x400d3e58 in wait () from /lib/tls/libc.so.6
#1  0x0806225a in handle_sigs ()
#2  0x08063bc5 in main_loop ()
#3  0x08065708 in main ()

# gdb /usr/local/sbin/openser 7824
(gdb) bt
#0  0x080b7dda in fm_status ()
#1  0x08062de2 in sig_usr ()
#2  <signal handler called>
#3  0x40112d5a in recvfrom () from /lib/tls/libc.so.6
#4  0x080b3ef9 in udp_rcv_loop ()
#5  0x08063873 in main_loop ()
#6  0x08065708 in main ()

----------------------------------------------------------------------

Comment By: Daniel-Constantin Mierla (miconda)
Date: 2008-02-12 03:48

Message:
Logged In: YES 
user_id=1246013
Originator: NO

Please attach with gdb to the running processes and get the backtrace. It
will help to see where they hung.

----------------------------------------------------------------------

Comment By: Ovidiu Sas (osas)
Date: 2008-02-11 16:03

Message:
Logged In: YES 
user_id=1395524
Originator: YES

Actually, even if the contact is not expired, it will hang.
If there is a record present in the usrloc table at startup, openser will
hang on exit.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1891453&group_id=139143



More information about the Devel mailing list