Segfault on cdr.c

Hi all, from some days sometimes Asterisk crash, and from core dump i have:

(gdb) bt
#0 0x0807b1f9 in ast_cdr_submit_batch () at cdr.c:1214
#1 0x0808e223 in ast_cli_completion_matches (
text=0x53 <Address 0x53 out of bounds>,
word=0x3 <Address 0x3 out of bounds>) at cli.c:1879
#2 0x0808ba62 in handle_debuglevel_deprecated (fd=83, argc=-1229788039,
argv=0xb6b2ecb0) at /usr/src/asterisk-1.4.30/include/asterisk/strings.h:169
#3 0x080bcb4b in action_originate (s=0xb6b2f364, m=0xb6b2ed1c)
at manager.c:2010
#4 0x080ba964 in action_extensionstate (s=0x8227e88, m=0x8227e8a)
at manager.c:813
#5 0x080bbc75 in action_originate (s=0xb6b2f364, m=0x813632d) at manager.c:816
#6 0x080bbcc7 in action_originate (s=0x8227dd8, m=0x0) at manager.c:815
#7 0x08101dcb in ast_inet_ntoa (ia={s_addr = 136484440})
at /usr/src/asterisk-1.4.30/include/asterisk/threadstorage.h:136
#8 0xb7f584fb in ?? ()
#9 0x08229658 in ?? ()
#10 0xb6b2f490 in ?? ()
#11 0xb6b2f490 in ?? ()
#12 0xb6b2f490 in ?? ()
#13 0xb6b2f490 in ?? ()
#14 0x00000000 in ?? ()

The server runnings without problem from 1 year, only now i have this problem.
The CDR backend is mysql with 1 million calls (yes, very large), the size could be the problem?
Regards

1 million records are not that much for MySQL. You can check tables of MySQL - there are tools which you could use to see if they are healthy.
You can recompile cdr.c - and add some more debug before line 1214.
And first of all - you can decrease verbose level and debug level to 5 and see what will happen.

This i the output of bt full

(gdb) bt full
#0 0x0807b1f9 in ast_cdr_submit_batch () at cdr.c:1214
enabled = 135615584
cdr_readonly_vars = {0x8129044 “clid”, 0x81290e1 “src”,
0x81290e5 “dst”, 0x81290e9 “dcontext”, 0x8134ebd “channel”,
0x81290f2 “dstchannel”, 0x81290fd “lastapp”, 0x8129105 “lastdata”,
0x81277cd “start”, 0x812a02b “answer”, 0x814473c “end”,
0x812911a “duration”, 0x8129123 “billsec”, 0x812912b “disposition”,
0x8129137 “amaflags”, 0x8129140 “accountcode”, 0x812914c “uniqueid”,
0x8129155 “userfield”, 0x0}
cli_status = {cmda = {0x0, 0x0, 0xb6e11bf0 “stop now”, 0x0, 0x0,
0x814cbe4 “òM\024\b)\227\022\b.\227\022\b”, 0x8144df2 “-char”,
0x8129767 “cked CDR… no choice.”, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0}, handler = 0, summary = 0x0, usage = 0x0, generator = 0,
deprecate_cmd = 0x0, inuse = 0, module = 0x80689d0,
_full_cmd = 0x812970b “”, deprecated = 135582400, _deprecated_by = 0x0,
list = {next = 0x0}}
cdr_sched = 0
cdr_pending_cond = {__data = {__lock = 1734439765,
__futex = 1914714725, __total_seq = 8386112018954871668,
__wakeup_seq = 2314861643389935731, __woken_seq = 8316253091684950048,
__mutex = 0x656c6261, __nwaiters = 1819042080,
__broadcast_seq = 1129599520},
__size = “Usage: rtcp stats off\n Disable all RTCP st”,
—Type to continue, or q to quit—
__align = 8223637126779073365}
sched = (struct sched_context ) 0x813e91f
cdr_thread = 135436011
cli_submit = {cmda = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x8067ec0 “\211T\216\030\211Ú\211D\216\024ëÂ\215t&”,
0x81296f1 “hannel ‘%s’ not posted\n”,
0x814d1a0 “Usage: abort shutdown\n Causes Asterisk to abort an executing shutdown or restart, and resume normal\n call operations.\n”, 0x0,
0x0, 0x0, 0x0, 0xb6e11198 “abort halt”}, handler = 0, summary = 0x0,
usage = 0xb72aec80 "²¼
•Ð¼*•",
generator = 0x8144df2 <PRETTY_FUNCTION.6338+3556>,
deprecate_cmd = 0x8129707, inuse = 0, module = 0x0, _full_cmd = 0x0,
deprecated = 0, _deprecated_by = 0x0, list = {next = 0x0}}
batchmode = 0
batchsize = 0
batchsafeshutdown = 1
cdr_pending_lock = {__data = {__lock = 0, __count = 0, __owner = 0,
__kind = 0, __nusers = 0, {__spins = 0, __list = {__next = 0x0}}},
__size = ‘\0’ <repeats 23 times>, __align = 0}
cdr_batch_lock = {__data = {__lock = 0, __count = 0, __owner = 0,
__kind = 0, __nusers = 0, {__spins = 0, __list = {__next = 0x0}}},
__size = ‘\0’ <repeats 23 times>, __align = 0}
batchtime = 0
—Type to continue, or q to quit—
unanswered = 0
be_list = {first = 0x814cb0c, last = 0x8144df2, lock = {__data = {
__lock = 135436073, __count = 135436078, __owner = 0, __kind = 0,
__nusers = 0, {__spins = 0, __list = {__next = 0x0}}},
__size = “)\227\022\b.\227\022\b”, ‘\0’ <repeats 15 times>,
__align = 135436073}}
batch = (struct ast_cdr_batch ) 0x80d1870
batchscheduleronly = 135763504
ast_default_accountcode = ‘\0’ <repeats 19 times>
ast_default_amaflags = 81
#1 0x0808e223 in ast_cli_completion_matches (
text=0x53 <Address 0x53 out of bounds>,
word=0x3 <Address 0x3 out of bounds>) at cli.c:1879
match_list =
retstr =
prevstr =
match_list_len = 3086334476
max_equal =
which =
i =
matches = 135589120
PRETTY_FUNCTION = “ast_cli_completion_matches”
#2 0x0808ba62 in handle_debuglevel_deprecated (fd=83, argc=-1229788039,
—Type to continue, or q to quit—
argv=0xb6b2ecb0) at /usr/src/asterisk-1.4.30/include/asterisk/strings.h:169
newlevel = 3
filename = 0x3f0 <Address 0x3f0 out of bounds>
#3 0x080bcb4b in action_originate (s=0xb6b2f364, m=0xb6b2ed1c)
at manager.c:2010
name = 0x8233f88 “phonecontext-2008-manager"
exten = 0x8227db8 “\210\237”\b \233”\bnnel"
context = 0x3 <Address 0x3 out of bounds>
priority = 0x812b1a0 ““
timeout = 0xb7e063e1 <Address 0xb7e063e1 out of bounds>
callerid = 0xb7ee7190 “¸?.\b8\233#\b(\211”\b\230Ë”\b@\204(\bPI”\bÈ\237"\bÈ\237"\bøH"\bøH"\b°qî•°qî•\b\005
\b\b\005*\bX\233"\b¸G"\bØD"\b°Ô#\bX\237"\b`\213#\bØqî•Øqî•àqî•àqî•èqî•èqî•ðqî•ðqî•øqî•øqî•“
account = 0x8224d48 “2008"
app = 0x81296d5 “’ CDR backend\n"
appdata = 0xb7e063e1 <Address 0xb7e063e1 out of bounds>
async = 0xb7ee5ff4 “\234¬\024"
id = 0x0
codecs = 0xb7ee7160 ““
vars = (struct ast_variable ) 0xb6b2e758
data =
l = 0xb6b2ebef ""
n = 0xff0a0000 <Address 0xff0a0000 out of bounds>
—Type to continue, or q to quit—
pi = 7369778
res = -1229787974
to = 1283094829
reason = 1768775981
tmp = "¨è²¶\035|æ•ø貶%\000\000\000ø貶%\000\000\000\000\000\000\000Æ\020â•ù(\020\bÜ貶\000\000\000\000%\000\000\000\213
\020\bD4.\bs\v\000\000üú\022\bX鲶\000\000\000\000\fºõ•Ä-\004\000*\232oL\001\000\000\000Z\000\000\000\004\000\004\000D4.\bZ\000\000\000üú\022\bH鲶¼&\v\bÜ}”\bD4.\b\000\000\000\000d\000\000\000üú\022\bX鲶ÿ\000\000\000ô_î•\2133ß•ô_î•\002\000\000\000\n\000\000\000ð貶\000\000\000\000\003\000\000\000ºì²¶°ì²¶S\000\000\000(겶KË\v\bS\000\000\000”…
tmp2 = “2®\b\bº•w• \220”\bX鲶\000\000\000\000ô粶\fºõ•\002\000\000\000\000í\024\b\001\000\000\000\000\000\nÿ\000\000\000\000\000í\024\b°ì²¶ô粶H鲶bº\b\bS\000\000\000\003\000\000\000ô粶D4.\bi4.\b¶?.\b \220”\b¶?.\b\000\000\000\000 \220”\b%\220”\b-\220”\b\000\000\000\000ÿ鲶\000\000\000\000ô_î•\000\000\000¶\000\000\000\000(鲶\004Üß•<貶vC\023\b\000\000\000\000°é²¶\000\000\000\000ÿÿÿÿO\000\000\000\001\200-û°é²¶\000\000\000\000\017\000\000\000\000\000\000\000ºé²¶"…
format = 1953718575
th = 1886221359
attr = {
__size = “Ë6\v\bÜ}”\bºì²¶8겶Ë6\v\bÜ}"\b\027\000\000\000\000\000\000\000ô_î•", __align = 134952651}
PRETTY_FUNCTION = “action_originate”
—Type to continue, or q to quit—
FUNCTION = “action_originate”
#4 0x080ba964 in action_extensionstate (s=0x8227e88, m=0x8227e8a)
at manager.c:813
exten = 0xb6b2ecba "CHINFO-634179863783063100"
context = 0xb6b2ea28 "H첶d©\v\bdó²¶\034í²¶üú\022\bºì²¶ g\025\b\034í²¶üú\022\bºì²¶ g\025\b\034í²¶\230벶\034í²¶d󲶺첶\003"
id = 0xb6e13520 "G]\023\b2]\023\b@*\025\b\020"
idText = ‘\0’ <repeats 172 times>, "Action: \000 \000\000\000\000\000\000Action: \000 \000\000\000\000\000\000Action: \000 ", ‘\0’ <repeats 22 times>, “Action: \000 \000\000\000\000\000\000Comm"
hint = “Ë6\v\bÜ}”\b\027\000\000\000\000\000\000\000ô_î•/tmp/ast-ami-yzL2tp\000\000\000\nÿï벶 5á¶è벶ºì²¶H첶d©\v\bdó²¶\034í²¶üú\022\bºì²¶ g\025\b\034í²¶üú\022\bºì²¶ g\025\b\034í²¶\230벶\034í²¶d󲶺첶\003\000\000\000\003\000\000\000d󲶺첶\003\000\000\000\003\000\000\000dó²¶Ê첶\003\000\000\000\003”, ‘\0’ <repeats 11 times>, “ActionID: CHINFO-634179863783”…
status =
#5 0x080bbc75 in action_originate (s=0xb6b2f364, m=0x813632d) at manager.c:816
name = 0x0
exten = 0x0
context = 0x0
priority = 0x0
timeout = 0x0
callerid = 0x0
—Type to continue, or q to quit—
account =
app =
appdata =
async =
id =
codecs =
vars = (struct ast_variable *) 0x0
data =
l = 0xff0a0000 <Address 0xff0a0000 out of bounds>
n = 0x0
pi = 0
res =
to = 0
reason = 0
tmp = ‘\0’ <repeats 255 times>
tmp2 = ‘\0’ <repeats 255 times>
format = 0
th = 0
attr = {__size = ‘\0’ <repeats 35 times>, __align = 0}
PRETTY_FUNCTION = "action_originate"
FUNCTION = “action_originate”
#6 0x080bbcc7 in action_originate (s=0x8227dd8, m=0x0) at manager.c:815
name = 0x0
—Type to continue, or q to quit—
exten = 0x0
context = 0x0
priority = 0x0
timeout = 0x0
callerid = 0x0
account = 0x0
app =
appdata =
async =
id =
codecs =
vars = (struct ast_variable *) 0x0
data =
l = 0x8227dd8 "\220û²¶“
n = 0x0
pi = -1210294895
res =
to = 136484432
reason = 0
tmp = ‘\0’ <repeats 255 times>
tmp2 = ‘\0’ <repeats 255 times>
format = -1208632820
th = 135581992
—Type to continue, or q to quit—
attr = {
__size = “dó²¶Ø}”\b\220û²¶xó²¶Ç¼\v\bdó²¶-c\023\bxó²¶ ¨\006\b”,
__align = -1229786268}
PRETTY_FUNCTION = "action_originate"
FUNCTION = “action_originate”
#7 0x08101dcb in ast_inet_ntoa (ia={s_addr = 136484440})
at /usr/src/asterisk-1.4.30/include/asterisk/threadstorage.h:136
No locals.
#8 0xb7f584fb in ?? ()
No symbol table info available.
#9 0x08229658 in ?? ()
No symbol table info available.
#10 0xb6b2f490 in ?? ()
No symbol table info available.
#11 0xb6b2f490 in ?? ()
No symbol table info available.
#12 0xb6b2f490 in ?? ()
No symbol table info available.
#13 0xb6b2f490 in ?? ()
No symbol table info available.
#14 0x00000000 in ?? ()
No symbol table info available.