Re: Electronic-Design ANDI - xawtv debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hey Adam,

On Sun, 2003-02-09 at 09:52, Adam Szalkowski wrote:
> Program received signal SIGFPE, Arithmetic exception.
> [Switching to Thread 8192 (LWP 1068)]
> 0x080606d5 in mm_queue (h=0x80c3d80) at grab-v4l.c:949
> 949         int frame = h->queue % h->nbuf;
> (gdb) print *h
> [..] nbuf = 0 [..]
> (gdb) bt
> #0  0x080606d5 in mm_queue (h=0x80c3d80) at grab-v4l.c:949
> #1  0x0806093d in mm_probe (h=0x80c3d80, fmtid=13) at grab-v4l.c:1030
> #2  0x08060a11 in mm_setparams (h=0x80c3d80, fmt=0xbffff5c0) at
> grab-v4l.c:1064
> #3  0x08060cfd in v4l_setformat (handle=0x80c3d80, fmt=0xbffff5c0) at
> grab-v4l.c:1158
> #4  0x0805d600 in ng_grabber_setformat (fmt=0x80c3d80, fix_ratio=0) at
> capture.c:303
> #5  0x0805588f in video_gd_configure (width=384, height=288) at
> x11.c:688
> #6  0x0804d0ff in resize_event (widget=0x80ad820, client_data=0x0,
> event=0x0, d=0xbffff6af "\001") at main.c:460
[..etc..]

There's the problem, nbuf is 0 and so "int frame = h->queue % h->nbuf;"
in mm_queue() gives a SIGFPE.

> ioctl: VIDIOCGMBUF(size=262144,frames=0): ok
>   mbuf: size=262144 frames=0
>   v4l: using mapped buffers for capture

Also interesting... frames shouldn't be 0. *looks at source*.
^Q#^censor$@#^#@ I removed that line (why did I do that?), I'm a moron.
This patch should fix it (well, the SIGFPE, that is) - could you test
it?:

Index: zoran_driver.c
===================================================================
RCS file: /cvsroot/mjpeg/driver-zoran/Attic/zoran_driver.c,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 zoran_driver.c
--- zoran_driver.c      15 Jan 2003 18:59:45 -0000      1.1.2.2
+++ zoran_driver.c      11 Feb 2003 10:13:21 -0000
@@ -2224,6 +2224,7 @@
                vmbuf->size =
                    fh->v4l_buffers.num_buffers *
                    fh->v4l_buffers.buffer_size;
+               vmbuf->frames = fh->v4l_buffers.num_buffers;
                for (i = 0; i < vmbuf->frames; i++) {
                        vmbuf->offsets[i] =
                            i * fh->v4l_buffers.buffer_size;

Gerd, should xawtv be protected against moronic driver programmers like
me by checking whether nbuf is zero in mm_queue() (or maybe in
v4l_open()) in libng/plugins/drv-v4l.c?

Ronald

-- 
Ronald Bultje <rbultje@xxxxxxxxxxxxxxxxxxx>
Linux Video/Multimedia developer





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux