Re: Possible bug on libv4l read() emulation

2009-10-16 Thread Pablo Baena
I think I identified the problem, I used code extracted from:
http://www.saillard.org/linux/pwc/files/capture.c, and the code was
like:

  total_read_bytes = 0;
  do {
read_bytes = read(fd, buffers[0].start, buffers[0].length);
if (read_bytes < 0)
{
switch (errno)
{
case EIO:
case EAGAIN:
continue;
default:
errno_exit("read");
}
}
total_read_bytes += read_bytes;
} while (total_read_bytes < buffers[0].length);

I changed the read() call to a v4l2_read() and used libv4l, and that
piece of code was triggering the kernel panic.

To fix it, I just removed the do..while loop. I'm still trying to
figure out what's the problem with that though.

Thanks for the reply.

On Fri, Oct 16, 2009 at 2:42 PM, Hans de Goede  wrote:
> Hi,
>
> On 10/16/2009 12:00 AM, Pablo Baena wrote:
>>
>> I have a program where I use libv4l's read() emulation for simplicity.
>> But with most v4l2 webcams I've tried, I get kernel panics.
>>
>> I have pics of the message if anyone cares to see them, I don't want
>> to flood the mailing list.
>>
>> Basically, the names I see in the kernel panic from a uvcvideo card is:
>>
>> uvc_queue_next_buffer
>> __bad_area_no_semaphore
>> do_page_fault
>>
>> And a lot more.
>>
>
> A panic should never happen, no matter what libv4l does (as libv4l is 100%
> userspace). Please submit a bug report with as much detail as possible to
> the
> driver author.
>
> Regards,
>
> Hans
>



-- 
"Not possessing the gift of reflection, a dog does not know that he
does not know, and does not understand that he understands nothing;
we, on the other hand, are aware of both. If we behave otherwise, it
is from stupidity, or else from self-deception, to preserve our peace
of mind."
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Possible bug on libv4l read() emulation

2009-10-16 Thread Hans de Goede

Hi,

On 10/16/2009 12:00 AM, Pablo Baena wrote:

I have a program where I use libv4l's read() emulation for simplicity.
But with most v4l2 webcams I've tried, I get kernel panics.

I have pics of the message if anyone cares to see them, I don't want
to flood the mailing list.

Basically, the names I see in the kernel panic from a uvcvideo card is:

uvc_queue_next_buffer
__bad_area_no_semaphore
do_page_fault

And a lot more.



A panic should never happen, no matter what libv4l does (as libv4l is 100%
userspace). Please submit a bug report with as much detail as possible to the
driver author.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Possible bug on libv4l read() emulation

2009-10-15 Thread Pablo Baena
I have a program where I use libv4l's read() emulation for simplicity.
But with most v4l2 webcams I've tried, I get kernel panics.

I have pics of the message if anyone cares to see them, I don't want
to flood the mailing list.

Basically, the names I see in the kernel panic from a uvcvideo card is:

uvc_queue_next_buffer
__bad_area_no_semaphore
do_page_fault

And a lot more.

TIA.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html