[OpenSIPS-Devel] [ opensips-Bugs-2787094 ] Crash with db_postgresql and no db connection

SourceForge.net noreply at sourceforge.net
Mon May 11 12:16:01 CEST 2009


Bugs item #2787094, was opened at 2009-05-05 11:45
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2787094&group_id=232389

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: 1.5.x
>Status: Closed
>Resolution: Out of Date
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: Crash with db_postgresql and no db connection

Initial Comment:
Opensips with usrloc and db_postgresql will crash if the db server is unreachable.


Scenario is the following, I have a remote postgres DB server, and had not opened the PG port on the firewall, which causes opensips to be unable to reach the DB server.
on init, opensips times out trying to connect to the DB, and then crash, looking at the logs, it seems to be usrloc module related.

It's easy to reproduce, I can provide as many tracks as needed.

If you need me bogdan, ask on irc ( Gled ).

bt:
#0  0x0000000000425f36 in handle_sigs () at main.c:486
486                                             if (pt[i].pid==chld) break;

#0  0x0000000000425f36 in handle_sigs () at main.c:486
#1  <signal handler called>
#2  0x00000030e6ae0cb7 in munmap () from /lib64/libc.so.6
#3  0x00000000004a4804 in shm_mem_destroy () at mem/shm_mem.c:238
#4  0x00000000004259a6 in cleanup (show_status=0) at main.c:365
#5  0x0000000000428560 in main (argc=<value optimized out>, argv=0x20) at main.c:1324

bt full:
#0  0x0000000000425f36 in handle_sigs () at main.c:486
        chld = 1909
        chld_status = 0
        i = <value optimized out>
        do_exit = 0
        __FUNCTION__ = "handle_sigs"
#1  <signal handler called>
No symbol table info available.
#2  0x00000030e6ae0cb7 in munmap () from /lib64/libc.so.6
No symbol table info available.
#3  0x00000000004a4804 in shm_mem_destroy () at mem/shm_mem.c:238
        __FUNCTION__ = "shm_mem_destroy"
#4  0x00000000004259a6 in cleanup (show_status=0) at main.c:365
No locals.
#5  0x0000000000428560 in main (argc=<value optimized out>, argv=0x20) at main.c:1324
        cfg_log_stderr = 1906
        cfg_stream = (FILE *) 0x772
        c = <value optimized out>
        r = 1
        tmp = 0x4ffe65 "H\205ít\0341Û\017\037@"
        tmp_len = <value optimized out>
        port = <value optimized out>
        proto = <value optimized out>
        ret = -1
        seed = 2320449269
        rfd = <value optimized out>
        __FUNCTION__ = "main"


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

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-05-11 13:16

Message:
OK - good to know :)

Best regards,
Bogdan

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

Comment By: Nobody/Anonymous (nobody)
Date: 2009-05-11 11:56

Message:
Morning Bogdan,

seems like it's fixed in r5678 of branch 1.5, tried again this morning and
I see like you a normal shutdown...

You must have fixed this fixing something else ;)

Regards,

Gled

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

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-05-09 11:46

Message:
Hi Gled,

I tried to reproduce this bug by configuring the usrloc module to use a
postgres DB. I put the URL to point to a bogus IP as I have no postgres
server and because actually the scenario is about unreachable DB
server....

But I got :
May  9 11:27:07 [2171] DBG:db_postgres:db_postgres_new_connection:
PQsetdbLogin(0x82b9770)
May  9 11:27:07 [2171] ERROR:db_postgres:db_postgres_new_connection: could
not connect to server: Connection timed out
        Is the server running on host "192.168.1.254" and accepting
        TCP/IP connections on port 5432?

May  9 11:27:07 [2171] ERROR:db_postgres:db_postgres_new_connection:
cleaning up 0x81b1998=pkg_free()

and a normal shutdown...

Regards,
Bogdan


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2787094&group_id=232389



More information about the Devel mailing list