Ticket #188 (closed defect: fixed)

Opened 8 months ago

Last modified 7 months ago

sm crashed on mod_privacy

Reported by: tofu Owned by: smoku
Priority: critical Component: sm
Version: 2.1.19 Keywords:
Cc: Tracforge_linkmap:
Blocking: Blocked By:

Description

here is the gdb backtrace

warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4
Core was generated by `/home/chesspark/production/bin/sm -c /home/chesspark/production/etc/jabberd/sm.'.
Program terminated with signal 11, Segmentation fault.
#0  0xf7b552c1 in _privacy_in_sess (mi=0x8082350, sess=0xb0a4d38, pkt=0x151cea48) at mod_privacy.c:1148
1148                        if(((privacy_t) sscan->module_data[mod->index])->active == old) {

Change History

Changed 7 months ago by smoku

  • status changed from new to infoneeded_new

What are the values of sscan, sscan->module_data, mod, mod->index, sscan->module_data[mod->index] and ((privacy_t) sscan->module_data[mod->index])->active ?

Changed 7 months ago by tofu

  • status changed from infoneeded_new to new

Oops backtrace

#0  0xf7b552c1 in _privacy_in_sess (mi=0x8082350, sess=0xb0a4d38, pkt=0x151cea48) at mod_privacy.c:1148
#1  0x0804e9c4 in mm_in_sess (mm=0x8082378, sess=0xb0a4d38, pkt=0x151cea48) at mm.c:442
#2  0xf7ad6228 in _session_in_router (mi=0x8086f90, pkt=0x151cea48) at mod_session.c:290
#3  0x0804ea31 in mm_in_router (mm=0x8082378, pkt=0x151cea48) at mm.c:470
#4  0x0804d5ee in dispatch (sm=0x8068008, pkt=0x151cea48) at dispatch.c:86
#5  0x080531e6 in sm_sx_callback (s=0x80906c0, e=event_PACKET, data=0x18cb8f20, arg=0x8068008) at sm.c:214
#6  0x08055e1b in __sx_event (file=0x8065820 "io.c", line=153, s=0x80906c0, e=event_PACKET, data=0x18cb8f20) at sx.c:329
#7  0x08055795 in _sx_process_read (s=0x80906c0, buf=0x12044310) at io.c:153
#8  0x08055cca in sx_can_read (s=0x80906c0) at io.c:237
#9  0x08052eb1 in sm_mio_callback (m=0x8090510, a=action_READ, fd=0x80906a8, data=0x0, arg=0x8068008) at sm.c:240
#10 0x0805a891 in _mio_run (m=0x8090510, timeout=5) at mio_impl.h:257
#11 0x0804e428 in main (argc=Cannot access memory at address 0x1
) at main.c:335

Changed 7 months ago by tofu

What frame would those values be in? I guess I can go look at the code. :)

Changed 7 months ago by tofu

  • priority changed from major to critical

It happened again same dump

Core was generated by `/home/chesspark/production/bin/sm -c /home/chesspark/production/etc/jabberd/sm.'.
Program terminated with signal 11, Segmentation fault.
#0  0xf7b502c1 in _privacy_in_sess (mi=0x8082350, sess=0xe97b4c8, pkt=0x2a509400) at mod_privacy.c:1148
1148                        if(((privacy_t) sscan->module_data[mod->index])->active == old) {
(gdb) bt
#0  0xf7b502c1 in _privacy_in_sess (mi=0x8082350, sess=0xe97b4c8, pkt=0x2a509400) at mod_privacy.c:1148
#1  0x0804e9c4 in mm_in_sess (mm=0x8082378, sess=0xe97b4c8, pkt=0x2a509400) at mm.c:442
#2  0xf7ad1228 in _session_in_router (mi=0x8086f90, pkt=0x2a509400) at mod_session.c:290
#3  0x0804ea31 in mm_in_router (mm=0x8082378, pkt=0x2a509400) at mm.c:470
#4  0x0804d5ee in dispatch (sm=0x8068008, pkt=0x2a509400) at dispatch.c:86
#5  0x080531e6 in sm_sx_callback (s=0x80919a8, e=event_PACKET, data=0x2fae1a18, arg=0x8068008) at sm.c:214
#6  0x08055e1b in __sx_event (file=0x8065820 "io.c", line=153, s=0x80919a8, e=event_PACKET, data=0x2fae1a18) at sx.c:329
#7  0x08055795 in _sx_process_read (s=0x80919a8, buf=0x9e100a0) at io.c:153
#8  0x08055cca in sx_can_read (s=0x80919a8) at io.c:237
#9  0x08052eb1 in sm_mio_callback (m=0x8090510, a=action_READ, fd=0x80902f0, data=0x0, arg=0x8068008) at sm.c:240
#10 0x0805a891 in _mio_run (m=0x8090510, timeout=5) at mio_impl.h:257
#11 0x0804e428 in main (argc=Cannot access memory at address 0x1
) at main.c:335

I am at a loss as to get those values, still looking at how to do it with gdb

Changed 7 months ago by smoku

  • status changed from new to infoneeded_new

Just use gdp 'print' command (abbreviated as 'p'), eventually switching stack frames with 'frame' command.

Changed 7 months ago by tofu

  • status changed from infoneeded_new to new

Just got another one :( I have more info below. sscan->module_data[mod->index] is null, would this be a config error?

(gdb) bt
#0  0xf7ac42c1 in _privacy_in_sess (mi=0x8082350, sess=0x953a540, pkt=0x853a0c0) at mod_privacy.c:1148
#1  0x0804e9c4 in mm_in_sess (mm=0x8082378, sess=0x953a540, pkt=0x853a0c0) at mm.c:442
#2  0xf7a45228 in _session_in_router (mi=0x8086f90, pkt=0x853a0c0) at mod_session.c:290
#3  0x0804ea31 in mm_in_router (mm=0x8082378, pkt=0x853a0c0) at mm.c:470
#4  0x0804d5ee in dispatch (sm=0x8068008, pkt=0x853a0c0) at dispatch.c:86
#5  0x080531e6 in sm_sx_callback (s=0x80906c0, e=event_PACKET, data=0x8708f10, arg=0x8068008) at sm.c:214
#6  0x08055e1b in __sx_event (file=0x8065820 "io.c", line=153, s=0x80906c0, e=event_PACKET, data=0x8708f10) at sx.c:329
#7  0x08055795 in _sx_process_read (s=0x80906c0, buf=0x86b5500) at io.c:153
#8  0x08055cca in sx_can_read (s=0x80906c0) at io.c:237
#9  0x08052eb1 in sm_mio_callback (m=0x8090510, a=action_READ, fd=0x80906a8, data=0x0, arg=0x8068008) at sm.c:240
#10 0x0805a891 in _mio_run (m=0x8090510, timeout=5) at mio_impl.h:257
#11 0x0804e428 in main (argc=Cannot access memory at address 0x1
) at main.c:335
(gdb) frame 0
#0  0xf7ac42c1 in _privacy_in_sess (mi=0x8082350, sess=0x953a540, pkt=0x853a0c0) at mod_privacy.c:1148
1148                        if(((privacy_t) sscan->module_data[mod->index])->active == old) {
(gdb) p sscan
$5 = (sess_t) 0x91001c0
(gdb) p sscan->module_data
$6 = (void **) 0x9ad9718
(gdb) p mod->index
$7 = 1
(gdb) p sscan->module_data[mod->index])
Junk after end of expression.
(gdb) p sscan->module_data[mod->index]
$8 = (void *) 0x0
(gdb) p sscan->module_data[mod->index]->active
Attempt to dereference a generic pointer.
(gdb) p old
$9 = (zebra_list_t) 0x8145928
(gdb)
 (gdb) p (privacy_t) sscan->module_data[mod->index])->active
No symbol "privacy_t" in current context.

Changed 7 months ago by smoku

  • status changed from new to closed
  • resolution set to fixed

In [568]: Fixes segfault that happend when there are multiple sessions and privacy list was changed. Fixes #188

Note: See TracTickets for help on using tickets.