Segmentation fault when executing gsmd

pHilipp Zabel philipp.zabel at gmail.com
Wed Aug 22 15:32:21 CEST 2007


On 8/21/07, Sean Chiang <sean_chiang at openmoko.com> wrote:
> Hi all,
>
> I just checked out the latest gsmd source from svn. While I executed the
> gsmd in gta01,  I
> can't get respond when send at command through libgsm-tool utility.
>
> Below are the logs for gsmd and libgsm-tool respectively.
>
> <%
> ...
> Thu Jan  1 00:06:51 1970 <1> atcmd.c:415:ml_parse() Clearing mlbuf
> Thu Jan  1 00:06:51 1970 <1> atcmd.c:210:ml_parse() buf=`%CSQ: 1 '(8)
> Thu Jan  1 00:06:51 1970 <1> atcmd.c:372:ml_parse() Appending buf to mlbuf
> Thu Jan  1 00:11:50 1970 <1> gsmd.c:124:alive_interval_tmr_cb() interval
> expired, starting next alive inquiry
> Thu Jan  1 00:11:50 1970 <1> atcmd.c:545:atcmd_submit() submitting
> command `AT'
> Thu Jan  1 00:12:20 1970 <1> gsmd.c:79:alive_tmr_cb() gsmd_alive timer
> expired
> Thu Jan  1 00:12:20 1970 <8> gsmd.c:82:alive_tmr_cb() modem dead!
> %>
>
> <%
> at
> STR=`at'
> RSTR=`'
> ERROR reding from gsm_fd
> %>
>
> After this, I use strace to trace the gsmd, and I got SIGSEGV signal
>
> <%
> ...
> write(2, "buf=`%CSQ: 1 \'(8)\n", 18buf=`%CSQ: 1 '(8)
> )    = 18
> time(NULL)                              = 1305
> write(2, "Thu Jan  1 00:21:45 1970 <1> atc"..., 52Thu Jan  1 00:21:45
> 1970 <1> atcmd.c:372:ml_parse() ) = 52
> write(2, "Appending buf to mlbuf\n", 23Appending buf to mlbuf
> ) = 23
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> sigreturn()                             = ? (mask now [INT])
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> sigreturn()                             = ? (mask now [INT])
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> sigreturn()                             = ? (mask now [INT])
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> sigreturn()                             = ? (mask now [INT])
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> sigreturn()                             = ? (mask now [INT])
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> sigreturn()                             = ? (mask now [INT])
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> sigreturn()                             = ? (mask now [INT])
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> sigreturn()                             = ? (mask now [INT])
> ...
> %>
>
> And using gdbserver+gdb, I found that it seems that we didn't to
> allocate memory for g->mlbuf.

Right, check out the patch in the mail "mlbuf fixup" that I sent earlier today.

cheers
Philipp



More information about the gsmd-devel mailing list