Re: raw1394_stop_iso_rcv bug?
Brought to you by:
aeb,
bencollins
From: Andreas B. <and...@mu...> - 2000-04-15 03:10:34
|
On Fri, Apr 14, 2000 at 05:35:23PM +0300, And...@no... wrote: > Hi Andreas, > > I have downloaded the latest subsystem and libraw code from the CVS > repository. I think I may have discovered a bug when disabling iso > reception. If raw1394_stop_iso_rcv() isn't called immediately after > raw1394_loop_iterate() is called, I get a segmentation fault inside > raw1394_stop_iso_rcv(). I haven't had the time to check the code yet but my > theory is that there is some problem with unprocessed messages. That is a possibility, but probably not in libraw's code. The raw1394_stop_iso_rcv() sends the stop request to the kernel and then loops on raw1394_loop_iterate() until it sees the response. During that handlers will be called for all remaining (e.g. iso) packets. If your iso handler doesn't expect that and segfaults the program appears to have crashed on stop_iso_rcv. You could run your program in gdb or let it create a core file and examine it with gdb (the interesting gdb command there is "backtrace" which shows you were it has crashed and the call chain). > I made a small test by adding a delay between the loop_iterate and > stop_iso_rcv calls. Having usleep in the code always results in a > segmentation fault but if it's removed it works fine. > > > while(pkts_received < packets) > raw1394_loop_iterate(handle); > > usleep(50000); > > raw1394_stop_iso_rcv(handle, CHANNEL); I have tried equivalent code with up to 5 seconds delay without problems (and getting remaining iso packets to the handler during the stop call). -- Andreas E. Bombe <and...@mu...> DSA key 0x04880A44 http://home.pages.de/~andreas.bombe/ http://linux1394.sourceforge.net/ |