Crash on sockets and Exceptions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Crash on sockets and Exceptions

Holger Freyther
Hi Paolo,

I have a UDP related crash in my work in progress SIP code[1]. I have not yet
debugged it but here is the pseudo code... This is with your event changes
applied. Does the below ring a bell or should I debug some more? I assume that
without the exception things will be okay.


Handler [
        handle: aData [ self notYetImplemented
]

UdpMaster
  | socket queue handler |

        start [
                rx := [
                        next := socket next.
                        handler handle: aData
                ] fork.

                tx := [
                        next := queue next.
                        socket nextPut: next.
                ] fork.
        ]
]


I get this output (sometimes more than once, due multiple datagrams before the
crash)

HandleData not yet implemented
optimized [] in SIPTransport>>handleData: (callagent/SIPCallAgent.st:54)
SystemExceptions.NotYetImplemented(Exception)>>activateHandler:
(ExcHandling.st:516)
SystemExceptions.NotYetImplemented(Exception)>>signal (ExcHandling.st:254)
SystemExceptions.NotYetImplemented class(Exception class)>>signal
(ExcHandling.st:151)
SIPUserAgent(Object)>>notYetImplemented (Object.st:1373)
SIPUserAgent>>transportData:data: (callagent/SIPCallAgent.st:181)
[] in SIPUdpTransport(SIPTransport)>>handleData: (callagent/SIPCallAgent.st:52)
BlockClosure>>on:do: (BlkClosure.st:193)
SIPUdpTransport(SIPTransport)>>handleData: (callagent/SIPCallAgent.st:53)
optimized [] in SIPUdpTransport>>start (callagent/SIPCallAgent.st:109)
[] in Semaphore>>critical: (Semaphore.st:80)
BlockClosure>>ensure: (BlkClosure.st:269)
Semaphore>>critical: (Semaphore.st:60)
optimized [] in SIPUdpTransport>>start (callagent/SIPCallAgent.st:109)
Sockets.Datagram(Object)>>ifNotNil: (Object.st:154)
optimized [] in SIPUdpTransport>>start (callagent/SIPCallAgent.st:108)
BlockClosure>>repeat (BlkClosure.st:318)
optimized [] in SIPUdpTransport>>start (callagent/SIPCallAgent.st:103)
[] in Process>>onBlock:at:suspend: (Process.st:411)
BlockClosure>>on:do: (BlkClosure.st:193)
[] in Process>>onBlock:at:suspend: (Process.st:412)
BlockClosure>>ensure: (BlkClosure.st:269)
[] in Process>>onBlock:at:suspend: (Process.st:390)
[] in BlockClosure>>asContext: (BlkClosure.st:179)
BlockContext class>>fromClosure:parent: (BlkContext.st:68)
HandleData not yet implemented
optimized [] in SIPTransport>>handleData: (callagent/SIPCallAgent.st:54)
SystemExceptions.NotYetImplemented(Exception)>>activateHandler:
(ExcHandling.st:516)
SystemExceptions.NotYetImplemented(Exception)>>signal (ExcHandling.st:254)
SystemExceptions.NotYetImplemented class(Exception class)>>signal
(ExcHandling.st:151)
SIPUserAgent(Object)>>notYetImplemented (Object.st:1373)
SIPUserAgent>>transportData:data: (callagent/SIPCallAgent.st:181)
[] in SIPUdpTransport(SIPTransport)>>handleData: (callagent/SIPCallAgent.st:52)
BlockClosure>>on:do: (BlkClosure.st:193)
SIPUdpTransport(SIPTransport)>>handleData: (callagent/SIPCallAgent.st:53)
optimized [] in SIPUdpTransport>>start (callagent/SIPCallAgent.st:109)
[] in Semaphore>>critical: (Semaphore.st:80)
BlockClosure>>ensure: (BlkClosure.st:269)
Semaphore>>critical: (Semaphore.st:60)
optimized [] in SIPUdpTransport>>start (callagent/SIPCallAgent.st:109)
Sockets.Datagram(Object)>>ifNotNil: (Object.st:154)
optimized [] in SIPUdpTransport>>start (callagent/SIPCallAgent.st:108)
BlockClosure>>repeat (BlkClosure.st:318)
optimized [] in SIPUdpTransport>>start (callagent/SIPCallAgent.ststdin:32: Aborted
stdin:32: Error occurred while not in byte code interpreter!!
/home/ich/install/gst/bin/../lib/libgst.so.7(+0x6ca71)[0x2eea71]
[0xc4e400]
/lib/i386-linux-gnu/libc.so.6(abort+0x17e)[0xdd434e]
/home/ich/install/gst/bin/../lib/libgst.so.7(+0x24626)[0x2a6626]
/usr/lib/libsigsegv.so.0(+0xb04)[0x663b04]
[0xc4e400]
/home/ich/install/gst/bin/../lib/libgst.so.7(+0x2699c)[0x2a899c]
/home/ich/install/gst/bin/../lib/libgst.so.7(+0x54df2)[0x2d6df2]
/home/ich/install/gst/bin/../lib/libgst.so.7(+0x6b057)[0x2ed057]
/home/ich/install/gst/bin/../lib/libgst.so.7(+0x6c04a)[0x2ee04a]
Aborted (core dumped)


#0  0x00c4e416 in __kernel_vsyscall ()
(gdb) bt
#0  0x00c4e416 in __kernel_vsyscall ()
#1  0x00dd0e71 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0x00dd434e in abort () at abort.c:92
#3  0x002a6626 in oldspace_sigsegv_handler (fault_address=0x4, serious=0) at
oop.c:974
#4  0x00663b04 in ?? () from /usr/lib/libsigsegv.so.0
#5  <signal handler called>
#6  0x002ee41c in copy_semaphore_oops () at interp.c:2431
#7  _gst_copy_processor_registers () at interp.c:2410
#8  0x002a899c in copy_oops () at oop.c:1798
#9  _gst_scavenge () at oop.c:1261
#10 0x002d6df2 in alloc_new_chunk (numArgs=0, cull_up_to=17) at interp.c:784
#11 alloc_stack_context (numArgs=0, cull_up_to=17) at interp.c:818
#12 activate_new_context (numArgs=0, cull_up_to=17) at interp.c:841
#13 send_block_value (numArgs=0, cull_up_to=17) at interp-bc.inl:428
#14 0x002ed057 in _gst_interpret (processOOP=0x40397c00) at vm.inl:1431
#15 0x002ee04a in _gst_nvmsg_send (receiver=0x40383800,
sendSelector=0x403e7570, args=0x0, sendArgs=0) at interp.c:2344
#16 0x0029d768 in _gst_execute_statements (receiverOOP=0x40383800,
method=0x867174c, undeclared=15746720, quiet=false) at comp.c:583
#17 0x0028e6c7 in execute_doit (p=0xbf82ff70, temps=0x0, stmts=0x8671710,
receiverOOP=0x40383800, undeclared=true, quiet=false) at gst-parse.c:605
#18 0x00290c96 in parse_doit (p=0xbf82ff70, fail_at_eof=<value optimized out>)
at gst-parse.c:647
#19 0x0029179c in parse_chunks (p=0xbf82ff70) at gst-parse.c:487
#20 0x00291ceb in _gst_parse_chunks (currentNamespace=0x0) at gst-parse.c:462
#21 0x0029385a in _gst_parse_stream (currentNamespace=0x0) at lex.c:1208
#22 0x002befb2 in _gst_process_stdin (prompt=0x8049569 "st> ") at input.c:818
#23 0x0804939d in main (argc=Cannot access memory at address 0x20100
) at main.c:415




[1] http://cgit.osmocom.org/smalltalk/osmo-st-sip

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Crash on sockets and Exceptions

Holger Freyther
On 06/13/2011 04:45 PM, Holger Hans Peter Freyther wrote:
> Hi Paolo,
>
> I have a UDP related crash in my work in progress SIP code[1]. I have not yet
> debugged it but here is the pseudo code... This is with your event changes
> applied. Does the below ring a bell or should I debug some more? I assume that
> without the exception things will be okay.

I get it on normal operation too and I think it is due the event change that
is still pending (couldn't get it to crash without the patch).

holger

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Crash on sockets and Exceptions

Holger Freyther
In reply to this post by Holger Freyther
On 06/13/2011 04:45 PM, Holger Hans Peter Freyther wrote:

> #2  0x00dd434e in abort () at abort.c:92
> #3  0x002a6626 in oldspace_sigsegv_handler (fault_address=0x4, serious=0) at
> oop.c:974
> #4  0x00663b04 in ?? () from /usr/lib/libsigsegv.so.0
> #5  <signal handler called>
> #6  0x002ee41c in copy_semaphore_oops () at interp.c:2431
> #7  _gst_copy_processor_registers () at interp.c:2410
> #8  0x002a899c in copy_oops () at oop.c:1798
> #9  _gst_scavenge () at oop.c:1261
> #10 0x002d6df2 in alloc_new_chunk (numArgs=0, cull_up_to=17) at interp.c:784
> #11 alloc_stack_context (numArgs=0, cull_up_to=17) at interp.c:818
> #12 activate_new_context (numArgs=0, cull_up_to=17) at interp.c:841
> #13 send_block_value (numArgs=0, cull_up_to=17) at interp-bc.inl:428

not the same core (but same backtrace)

(gdb) p sig->data
$4 = (OOP) 0x0
(gdb) p sig->func
$5 = (void (*)(OOP)) 0xa16650 <async_signal_polled_files>

so is IS_OOP(NULL) well defined, giving other code.. I think it is not safe.
So do we add a null check there? or do we use another OOP for aysnc file
notifications?

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Crash on sockets and Exceptions

Holger Freyther
On 06/13/2011 07:28 PM, Holger Hans Peter Freyther wrote:

> so is IS_OOP(NULL) well defined, giving other code.. I think it is not safe.
> So do we add a null check there? or do we use another OOP for aysnc file
> notifications?

diff --git a/libgst/sysdep/posix/events.c b/libgst/sysdep/posix/events.c
index ab2a88e..b40d7aa 100644
--- a/libgst/sysdep/posix/events.c
+++ b/libgst/sysdep/posix/events.c
@@ -342,6 +342,7 @@ file_polling_handler (int sig)
   if (num_used_pollfds > 0)
     {
       static async_queue_entry e = { async_signal_polled_files, NULL, NULL };
+      e.data = _gst_true_oop;
       _gst_async_call_internal (&e);
     }


any feelings on making the NULL, FALSE, TRUE OOP const?

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Crash on sockets and Exceptions

Paolo Bonzini-2
> diff --git a/libgst/sysdep/posix/events.c b/libgst/sysdep/posix/events.c
> index ab2a88e..b40d7aa 100644
> --- a/libgst/sysdep/posix/events.c
> +++ b/libgst/sysdep/posix/events.c
> @@ -342,6 +342,7 @@ file_polling_handler (int sig)
>   if (num_used_pollfds > 0)
>     {
>       static async_queue_entry e = { async_signal_polled_files, NULL, NULL };
> +      e.data = _gst_true_oop;
>       _gst_async_call_internal (&e);
>     }

Looks good, thanks!  Feel free to make a pull request on github so I
don't forget when I'm back.

> any feelings on making the NULL, FALSE, TRUE OOP const?

Could be a good idea.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk