Ticket #1155 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

gsmd segfault in network_opers_parse

Reported by: mail@… Owned by: sean_chiang@…
Priority: high Milestone:
Component: gsmd Version: current svn head
Severity: normal Keywords:
Cc: buglog@…, erin_yueh@… Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: PatchReviewResult:
Reproducible:

Description

In a gsmd build that's patched to prevent the #1154 problem I observed a
segfault in the network_opers_parse() function:

Program terminated with signal 11, Segmentation fault.
#0 0x0000f0c0 in network_opers_parse (str=<value optimized out>, out=0x0)

at usock.c:661

661 usock.c: No such file or directory.

in usock.c

(gdb) where
#0 0x0000f0c0 in network_opers_parse (str=<value optimized out>, out=0x0)

at usock.c:661

#1 0x0000f14c in network_opers_cb (cmd=0x30ce8, ctx=0x307e0,

resp=0x401316f8

"\207(???\027\023@?\027\023@?\027\023@?\027\023@?\027\023@?\027\023@?\027\023@@\027\023@")
at usock.c:682
#2 0x0000b634 in atcmd_done (g=0x1e454, cmd=0x30ce8, buf=0x1e4a8 "OK")

at atcmd.c:232

#3 0x0000c440 in atcmd_select_cb (fd=3, what=1, data=<value optimized out>)

at atcmd.c:174

#4 0x0000c888 in gsmd_select_main () at select.c:98
#5 0x0000b098 in main (argc=7, argv=<value optimized out>) at gsmd.c:500

libgsmd package version is: 0.1+svnr3759-r40

Attachments

gsm.log.tail (13.2 KB) - added by mail@… 5 years ago.
Partial /tmp/gsm.log
segfault-when-network_opers_parse.patch (3.4 KB) - added by sean_chiang@… 5 years ago.
refactoring the network_opers_parse() to solve segfault issue

Change History

Changed 5 years ago by mail@…

Partial /tmp/gsm.log

comment:1 Changed 5 years ago by tick@…

  • Owner changed from tick@… to erin_yueh@…

comment:2 Changed 5 years ago by mail@…

Note that the line numbers have changed since I did my build - line 661 in
usock.c is now line 807:

if (n < 10
str[n - 1] != ')')

which can have trouble if n is less than or equal to 0.

comment:3 Changed 5 years ago by erin_yueh@…

  • Cc erin_yueh@… added
  • Owner changed from erin_yueh@… to sean_chiang@…

hi Mike, Thanks a lot for reporting this bug with log file for us.

hi Sean, please help to check this issue. Thanks! -erin

comment:4 Changed 5 years ago by sean_chiang@…

  • Status changed from new to assigned

comment:5 Changed 5 years ago by sean_chiang@…

  • blocked set to 1154

Changed 5 years ago by sean_chiang@…

refactoring the network_opers_parse() to solve segfault issue

comment:6 Changed 5 years ago by sean_chiang@…

  • Status changed from assigned to closed
  • Resolution set to fixed

Refactoring the function network_opers_parse(), fix this issue.

Note: See TracTickets for help on using tickets.