Skip to contentSkip to conversation

bug, or is it? - SCHED_RR and FPU related

DISCUSSION Rudo Thomas 3 participants 7 messages Feb 12, 2004 – Feb 13, 2004

lore
Share & tools
lore
#0 lore raw

Hello.

I have stumbled upon a grave bug, I think. I can reproduce a hard lock-up using xmms and a buggy plugin - only SysRq-B helps. I managed to narrow it down to "0.5/NAN"-like operation. It only causes a complete hang when xmms is run with SCHED_RR priority. Otherwise, only xmms hangs. Unfortunately, I was not able to create a working proof-of-concept program.

The question is - is this a kernel bug, OR something that cannot be prevented from happening when using SCHED_RR policy?

Tried with 2.6.3-rc[12] and glibc-2.3.2 (-r9 gentoo) with nptl support (if that matters).

Have a nice day.

Rudo.

#1 lore raw
Quoted 8 lines · Rudo Thomas

Hello.

I have stumbled upon a grave bug, I think. I can reproduce a hard lock-up using xmms and a buggy plugin - only SysRq-B helps. I managed to narrow it down to "0.5/NAN"-like operation. It only causes a complete hang when xmms is run with SCHED_RR priority. Otherwise, only xmms hangs. Unfortunately, I was not able to create a working proof-of-concept program.

Quoted 9 lines

The question is - is this a kernel bug, OR something that cannot be prevented from happening when using SCHED_RR policy?

Tried with 2.6.3-rc[12] and glibc-2.3.2 (-r9 gentoo) with nptl support (if that matters).

Have a nice day.

Hi Rudo,
xmms probably goes into an infinite loop, preventing anything else from being scheduled, right? If that's the case then this is correct behaviour.

#2 lore raw

Hi.

Quoted 2 lines

xmms probably goes into an infinite loop, preventing anything else from being scheduled, right?

Nope. When I turn the suid bit off, xmms (does not run with SCHED_RR and) just hangs consuming no CPU cycles. Strange.

I will look into it tomorrow, the invalid FP division was not the problem, its results are.

Thanks.

Rudo.

#3 lore raw
Quoted 7 lines · Rudo Thomas

Hi.

Quoted 3 lines

xmms probably goes into an infinite loop, preventing anything else from being scheduled, right?

Quoted 7 lines

Nope. When I turn the suid bit off, xmms (does not run with SCHED_RR and) just hangs consuming no CPU cycles. Strange.

I will look into it tomorrow, the invalid FP division was not the problem, its results are.

I think xmms changes the way it runs depending on whether realtime scheduling is set or not, but I could be wrong.

Programs using realtime scheduling need to be coded pretty carefully. Xmms is not something I'd bet my system's stability on.

#4 lore raw

Hello again.

Quoted 2 lines

I think xmms changes the way it runs depending on whether realtime scheduling is set or not, but I could be wrong.

Yes, it does, but I am not sure whether this is the case.

Anyway, you were right, it was not the kernel. Nothing more to be seen here 8-)

Have a nice weekend.

Rudo.

#5 lore raw

Re: bug, or is it? - SCHED_RR and futex related

In reply to Rudo Thomas

Last question.

I tracked it down to an infinite waiting in futex( ..., FUTEX_WAIT, 2, NULL). Can THIS hang the machine hard when running with SCHED_RR policy?

Thanks.

Rudo.

#6 lore raw

Re: bug, or is it? - SCHED_RR and futex related

Quoted 2 lines · Rudo Thomas

I tracked it down to an infinite waiting in futex( ..., FUTEX_WAIT, 2, NULL). Can THIS hang the machine hard when running with SCHED_RR policy?

Do you mean that a task running with SCHED_RR calls futex( ..., FUTEX_WAIT, 2, NULL), and there are no other SCHED_RR or SCHED_FIFO tasks?

That cannot lock the machine hard. When the futex call waits, the task sleeps.

-- Jamie