[Home]

Summary:ASTERISK-08117: Upon reload of asterisk, cdr_pgsql causes asterisk to seg fault
Reporter:James Lyons (james)Labels:
Date Opened:2006-11-13 15:05:18.000-0600Date Closed:2006-11-13 15:32:43.000-0600
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:CDR/cdr_pgsql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:It would appear as though a bad pointer is being sent to postgresql from asterisk, i've labbed this up on an rPath linux system, although it seems as though this issue can be duplicated on any distribution.

Note: this does not occur on x86_64, only on 32bit

****** ADDITIONAL INFORMATION ******

Parsing '/etc/asterisk/cdr_odbc.conf': Found
   -- Reloading module 'app_meetme.so' (MeetMe conference bridge)
 == Parsing '/etc/asterisk/meetme.conf': Found
   -- Reloading module 'app_osplookup.so' (OSP Lookup)
   -- Reloading module 'cdr_pgsql.so' (PostgreSQL CDR Backend)

Program received signal SIGSEGV, Segmentation fault.
closePGconn (conn=0xffffffff) at fe-connect.c:1955
1955            if (conn->sock >= 0 && conn->status == CONNECTION_OK)
(gdb) bt full
#0  closePGconn (conn=0xffffffff) at fe-connect.c:1955
       notify = (PGnotify *) 0xffffffff
       pstatus = (pgParameterStatus *) 0xffffffff
#1  0xb5ffaf77 in PQfinish (conn=0xffffffff) at fe-connect.c:2023
No locals.
#2  0xb6021d1a in my_unload_module () at cdr_pgsql.c:185
No locals.
#3  0xb602252f in reload () at cdr_pgsql.c:336
No locals.
#4  0x0805c68d in ast_module_reload (name=0xb6022510 "\203�,\211\\$ �\032\001") at loader.c:257
       m = (struct module *) 0x819b580
       reloaded = 2
       oldversion = 1662681958
       reload = (int (*)(void)) 0xb6022510 <reload>
ASTERISK-1  0x0809583c in handle_reload (fd=1, argc=1, argv=0xbfe950b0) at cli.c:159
       x = 135392672
       res = -1
ASTERISK-2  0x08098aeb in ast_cli_command (fd=1, s=0xffffffff <Address 0xffffffff out of bounds>) at cli.c:1364
       argv = {0x8148b38 "reload", 0x0, 0xbfe950d8 "\bQ&#65533;&#65533;\tn\016\b&#65533;&#65533;\023\b",
 0xb7e47ed6 "\211&#65533;\213]&#65533;\211&#65533;\213u&#65533;\213}&#65533;\211&#65533;]&#65533;\220\220\220\220\220\220\220\220\220U\211&#65533;\203&#65533;\030\211}&#65533;\213E\f\213}\b\211]&#65533;\211u&#65533;&#65533;\205&#65533;&#65533;&#65533;\201&#65533;6&#65533;\n", 0x8171120 "reload", 0x813f6d8 "reload", 0x7 <Address 0x7 out of bounds>, 0x818c3f8 ")",
 0x8140db0 "", 0xbfe95238 ")", 0xbfe95108 "&#65533;Q&#40931;x\016\b&#65533;\r\024\b8R&#65533;&#65533;&#65533;&#65533;\023\b\n",
 0x80e6e09 "\211C\004\203&#65533;\020\213V\020\205&#65533;\017\204\216", 0x813f6d8 "reload", 0x0, 0x0, 0x0, 0x0, 0x0,
 0x81465c8 "400/400,0/350,400/225,0/525", 0x813f6d8 "reload", 0xbfe95238 ")", 0xbfe95244 "\a",
 0xbfe951c8 "&#65533;U&#65533;&#65533;&#65533;\024\f\b\001",
 0x80e78a3 "\203&#65533;\020\203&#65533;&#65533;\211&#65533;\017\204U&#65533;&#65533;&#65533;\213>\213]\b\211{\004&#65533;H&#65533;&#65533;&#65533;\215J&#65533;\211M&#65533;&#65533;D\032&#65533;", 0x8140db0 "",
 0xbfe95238 ")", 0x813f6d8 "reload", 0xa <Address 0xa out of bounds>, 0xa <Address 0xa out of bounds>,
 0xb7fcb000 "\r\033[1;30;40m    -- \033[0;37;40mReloading module 'cdr_pgsql.so' (PostgreSQL CDR Backend)\ne)\nl System))\ne mailbox has messages in a given folder.)\n[0;37;40m: 0;37;40m: ", 0xbfe95154 "|Q&#65533;&#65533;b&#65533;&#65533;&#65533;&#65533;\005&#65533;&#65533;",
 0xb7e8b754 "X=\001&#65533;&#65533;&#65533;s\001&#65533;&#65533;\214<\004", 0xa <Address 0xa out of bounds>,
 0xb7e3ea8f "\205&#65533;x3)&#65533;\001&#65533;\205&#65533;\177&#65533;)u\020\213U\b\213zP\213rL\205&#65533;x\021\213E\020\231\001&#65533;\021&#65533;\213U\b\211rL\211zP\213E\020\203&#65533;\024^_]&#65533;\213E\b\203\b &#65533;&#65533;\211t$\b\211|$\004\213@8\211\004$&#65533;)&#65533;\004", 0x1 <Address 0x1 out of bounds>,
 0xb7fcb000 "\r\033[1;30;40m    -- \033[0;37;40mReloading module 'cdr_pgsql.so' (PostgreSQL CDR Backend)\ne)\nl System))\ne mailbox has messages in a given folder.)\n[0;37;40m: 0;37;40m: ", 0xa <Address 0xa out of bounds>, 0x0, 0x0,
 0xb7ef05e0 "\204*&#65533;&#65533;", 0x0, 0xbfe9517c "\214Q&#65533;&#65533;\210&#65533;&#65533;&#65533;\n",
 0xb7e3d462 "\017&#65533;ND\211&#65533;f\205&#65533;\017\225&#65533;1&#65533;\205&#65533;\017\225&#65533;\205&#65533;\017\205\203", 0xb7ef05e0 "\204*&#65533;
 0xb7fcb000 "\r\033[1;30;40m    -- \033[0;37;40mReloading module 'cdr_pgsql.so' (PostgreSQL CDR Backend)\ne)\nl System))\ne mailbox has messages in a given folder.)\n[0;37;40m: 0;37;40m: ", 0xa <Address 0xa out of bounds>, 0x0,
 0xb7fcb000 "\r\033[1;30;40m    -- \033[0;37;40mReloading module 'cdr_pgsql.so' (PostgreSQL CDR Backend)\ne)\nl System))\ne mailbox has messages in a given folder.)\n[0;37;40m: 0;37;40m: ", 0xb7ef6e40 "&#65533;l\021",
 0xa <Address 0xa out of bounds>, 0x0, 0xbfe9518c "&#65533;Q&#65533;&#65533;B&#65533;&#65533;&#65533;&#65533;\005&#65533;&#65533;", 0xb7e3d588 "9&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;t&#65533;\211&#65533;Z^]&#65533;\211&#65533;\215&#65533;'",
 0xa <Address 0xa out of bounds>, 0xb7ef05e0 "\204*&#65533;&#65533;", 0xbfe951b0 "&#65533;Q&#65533;&#65533;R5&#65533;&#65533;&#65533;\005&#65533;&#65533;&#65533;&#65533;\023\b8R&#65533;&#65533;DR&#65533;&#65533;&#65533;U&#65533;&#65533;&#65533;\024\f\b\001",
 0xb7e3e142 "&#65533;^&#65533;&#65533;&#65533;\211&#65533;\215&#65533;'", 0xb7ef05e0 "\204*&#65533;
 0xb7fcb000 "\r\033[1;30;40m    -- \033[0;37;40mReloading module 'cdr_pgsql.so' (PostgreSQL CDR Backend)\ne)\nl System))\ne mailbox has messages in a given folder.)\n[0;37;40m: 0;37;40m: ", 0xa <Address 0xa out of bounds>,
 0xbfe951c8 "&#65533;U&#65533;&#65533;&#65533;\024\f\b\001", 0xb7ef6e40 "&#65533;l\021", 0xb7ef05e0 "\204*&#65533;&#65533;", 0xb7c1d6c0 "&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;\001"}
       e = (struct ast_cli_entry *) 0x811eda0
       x = 1
       dup = 0x8148b38 "reload"
       tws = 0
       __PRETTY_FUNCTION__ = "ast_cli_command"
ASTERISK-3  0x080c14cf in main (argc=2, argv=0xbfe95654) at asterisk.c:1012
---Type <return> to continue, or q <return> to quit---
       title = "Asterisk Console on 'ceres' (pid 3522)\000&#65533;&#65533;&#65533;&#65533;&#65533;\001\000\000\000&#65533;R&#65533;&#65533;\"\226&#65533;&#65533;\224&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;\001\000\000\000\001", '\0' <repeats 11 times>, "pl&#65533;&#65533;&#65533;\000\000\000&ASTERISK-1372;&#65533;&#65533;\000z&ASTERISK-1950;&#65533;k&#65533;&#65533;\034S&#65533;&#65533;\000\000\000\000 \000\000\000\"S&#65533;&#65533;rI&#65533;&#65533;rI&#65533;&#65533;\034S&#65533;&#65533;\000\000\000\000&#65533;U&#65533;&#65533;\201&#65533;&#65533;&#65533;\034S&#65533;&#65533;pI&#65533;&#65533;\034S&#65533;&#65533;\fS&#65533;&#65533;\000\000\000\000\000\000\000\000&#65533;C&#65533;&#65533; U&#65533;&#65533;#\000\000\000 \000\000\000\000\000\200\000&#65533;&#65533;&#65533;&#65533;#1 SMP Tue Oc"...
       c = -1
       filename = "/root/.asterisk_history", '\0' <repeats 56 times>
       hostname = "ceres", '\0' <repeats 58 times>
       tmp = "\033[1;37;40mAsterisk Ready.\n\033[0;37;40m\000U&#65533;&#65533;&#65533;C&#65533;&#65533;&#65533;w&#65533;&#65533;\033\000\000\000W&#65533;&#65533;&#65533;(%\023\b&#65533;&#65533;\f\b&#65533;\n\002\000\033\000\000\000 %\023\b(%\023\b"
       xarg = 0x0
       x = 0
       f = (FILE *) 0x813f6d8
       sigs = {__val = {134238211, 0 <repeats 31 times>}}
       num = 7
       is_child_of_nonroot = -1
       buf = 0x813f6d8 "reload"
       runuser = 0x0
       rungroup = 0x0
       cp = (struct cp_state *) 0x813f6d8
       __PRETTY_FUNCTION__ = "main"
(gdb) quit
Comments:By: Joshua C. Colp (jcolp) 2006-11-13 15:32:43.000-0600

Fixed in 1.2 as of revision 45783, 1.4 as of revision 45784, and trunk as of revision 45785. Thanks James!