Skip to contentSkip to conversation

bttv hang problem on 2.6.8

DISCUSSION Lennert Buytenhek 2 participants 4 messages Oct 25, 2004 – Oct 26, 2004

lore
Share & tools
lore
#0 lore raw

(please CC on replies, I'm not on the list)

Hi,

When there is a background thread doing VIDIOCSYNC in a loop, issuing VIDIOCSPICT in the current thread on the same file descriptor causes it to go into uninterruptable sleep and hang. This is on kernel 2.6.8 using the bttv driver, and appears easily reproducible.

Anyone any ideas?

thanks,
Lennert

#1 lore raw
Quoted 8 lines · Lennert Buytenhek

(please CC on replies, I'm not on the list)

Hi,

When there is a background thread doing VIDIOCSYNC in a loop, issuing VIDIOCSPICT in the current thread on the same file descriptor causes it to go into uninterruptable sleep and hang. This is on kernel 2.6.8 using the bttv driver, and appears easily reproducible.

Don't do that. bttv serializes ioctls with a lock. Well, not all of them, but the ones which change the state of the filehandle, and both VIDIOCSYNC + VIDIOCSPICT fall into that group. You simply can't run them in parallel on the same filehandle.

Gerd

Signature · 1 line
#define printk(args...) fprintf(stderr, ## args)
#2 lore raw
Quoted 9 lines · Gerd Knorr
Quoted 4 lines

When there is a background thread doing VIDIOCSYNC in a loop, issuing VIDIOCSPICT in the current thread on the same file descriptor causes it to go into uninterruptable sleep and hang. This is on kernel 2.6.8 using the bttv driver, and appears easily reproducible.

Don't do that. bttv serializes ioctls with a lock. Well, not all of them, but the ones which change the state of the filehandle, and both VIDIOCSYNC + VIDIOCSPICT fall into that group. You simply can't run them in parallel on the same filehandle.

OK, even though it worked fine on 2.4 I'll buy that, but it still shouldn't result in an unkillable process, should it?

cheers,
Lennert

#3 lore raw
Quoted 7 lines · Lennert Buytenhek
Quoted 5 lines · Gerd Knorr
Quoted 4 lines

When there is a background thread doing VIDIOCSYNC in a loop, issuing VIDIOCSPICT in the current thread on the same file descriptor causes it to go into uninterruptable sleep and hang. This is on kernel 2.6.8 using the bttv driver, and appears easily reproducible.

Quoted 7 lines
Quoted 4 lines

Don't do that. bttv serializes ioctls with a lock. Well, not all of them, but the ones which change the state of the filehandle, and both VIDIOCSYNC + VIDIOCSPICT fall into that group. You simply can't run them in parallel on the same filehandle.

OK, even though it worked fine on 2.4 I'll buy that, but it still shouldn't result in an unkillable process, should it?

Does it? That wasn't clear. One of the two threads (the one waiting for the lock, probably the one doing VIDIOCSPICT) might be unkillable. Try killing the other thread as well, that should work. If it doesn't I'd like to get stack traces for the deadlock case (sysrq-t).

Gerd

Signature · 1 line
#define printk(args...) fprintf(stderr, ## args)