[nas] nasd outputs only part of a sample, client stalls -- exceptunder strace

Erik Auerswald auerswal at unix-ag.uni-kl.de
Mon Sep 10 10:00:20 MDT 2007


Hi,

On Mon, Sep 03, 2007 at 01:28:38PM -0600, Jon Trulson wrote:
> On Mon, 3 Sep 2007, Erik Auerswald wrote:
> >On Sun, Sep 02, 2007 at 08:24:18PM -0600, Jon Trulson wrote:
> >>On Sun, 2 Sep 2007, Erik Auerswald wrote:
> >>>On Mon, Jul 23, 2007 at 08:54:00AM -0400, mmurray wrote:
> >>>>
> >>>>To the best of my reasoning, the SIGALRM is being lost in a race
> >>>>somewhere.
> >>>
> >>>This seems to be correct -- sending a SIGALRM to nasd whenever the
> >>>playback hangs results in continued playback.
> 
>   I'll have to see about installing one of these kernels and try to
>   track the problem further (unless someone beats me to it :).

I've written a test program to reproduce the problem. Setting the
interval timer to values used by auvoxware (or to values an order of
magnitude higher or lower) works on every tested kernel (2.6.11, 2.6.18,
2.6.20 and 2.6.22). Ignoring most of the generated SIGALRMs by having a
long running signal handler works as well.

Using sleep() inside the signal handler for SIGALRM shows similar
behaviour to that of auvoxware: After a while the program does not
recieve any SIGALRMs, sending a SIGALRM to the process lets it continue.
According to the man-page of sleep(), sleep can be implemented using
SIGALRM:

--- man page extract ---

BUGS
     sleep()  may  be implemented using SIGALRM; mixing calls to alarm() and
     sleep() is a bad idea.

     Using longjmp() from a signal handler  or  modifying  the  handling  of
     SIGALRM while sleeping will cause undefined results.

--- end ---

I did not see any obvious use of sleep() in auvoxware while audio is
processed (a few sleep()s are used in the code).

The hangs happen with kernel 2.6.22 only, with the test program as well
as nasd. The test program did not hang on an x86_64 2.6.22 kernel (which
does not use the tickless code under suspicion).

If you want to try my test programs: An interval value of 11 corresponds
to auvoxware processing stereo 44.1kHz audio. Only itimertest_sleep is
supposed to hang after a while (possibly a few hours).

Erik
-- 
Full disclosure is the only thing that forces vendors to fix security problems.
                        -- Bruce Schneier
-------------- next part --------------
BZh91AY&SY?=?? N??? ??????????  `?                   ?&?4???a d ?4?  d????4h?C#!?? ?@ ??2h?M??@?M  2@8hh?F?422@ 2
4  ? ?&?4???a d ?4?  d ?"??4aLS?@???S?O?i?	??OS????/?{??q??
?{???XX??-l?????$?KIaZ}?O??????%??Qt?X,???Y)B?R?R?9?v4C(h)???^Yh?RR??S5?`Z?Q?J-,?Dh?_?V????C?>'?Rf??e?????f?7	?< ???:?J]N?)O? ?Q0;??Y$)B???I#?}??l???T?f?'?I??????<?PW)&?S??:'?????K&???u`?????R??/???a??????<?%*)???
????*??????Smd?????:[gL???{?D?H??C?Y????)?z?8????f???3m?'?|??????ca?2b??w'?g?????'?vK?1\???1?mo=i??????f*Y?nt)???v;Wqw?9?4`?lVu??C??.N???-?Y,??g?|?????????0??lYx??Wy[M??d??/d,????0o?:???1LScWB?\?H?/???????
??67	?&?K?w??f??q???????[????h???????????????sqw???Nn?\?kC?N???I??:Vbf??Sv?
???????dd?8.??@?is??{
?????
?????4??8???u86?yU"??4ppf?C?????L?????&k?K?K&X??S??2u;??h?76???9??2????3|?x(???xz63n?V???{?Yv??????s?;O???l=??Nj???k
?CUJ|?,?j>jh??}?|????lP??t???g?????$??0?+&i?e?V62z?R?;[?a????7??w???????F??QM????'O???c'????sjI??K????0~q?I???W??I*??AJR???PT??)D??|j??-7???1??<v???u??6??S?X???q=#?M?z?.u<???:??I?95??j?kGK'?_?????OZOJ???~z?=?????3b?q?I??Q,X?R???|oe)J?(?)J*}????i??{<?????w~???,???W???????v????h?T??g????3)?q????V;?6?yIK2?????N&;r???I?#??3nVuYa?K?mI?B??:%?3Y?2?}?]???yy?^uB??QIb?J??,???"?Q?C{?Y2?d?[???j??U72??8?????*ED??He??i???#?]????X??$?/??9fO?O?H?????c'?Q?Y?`>?????????5~T???|,[???)d?????J|z.?Nca???$????lt?????????h?<?sc{ZYi7?p????*JR?n????6?K????YB?-F?k?)G*4wq]?.?,M?P?Q???e#?v,gP?db2,?)gS?vG???#U???-Oi???????h?`?d?60Iszw*I?r????.?T??,S???f???d??Ie???\??Y#E??ST???c?)B??[Vf??'??rp?J?6k?%?S???b???s?E;[?????GMut83`????L0fb?"?`?d??f???)scj?ZoXc??Y?c3?9?'%??.??H???_k?ZA?V))?MoN??????bF?????+5???Z?W??}???????#?Y?Ox??.??O?O?|????I?)$??|????Y?)??}? ?C???w??SkS????Y?)
V>u???I?d?t??OK&??N+??J?|???C"?F???Qd`????u?i?sSI#i?~?mY?????Y?????{^?)??[?Tb?4Y??vh????#?zt?S1?
Y???M?010j?.???E)??b?N?R???U??JY??t,?????(\?cUO8?????????O?V???e,zWt1k<??W{???S??%?N?+1no`?S?jYu?&&????V?.?i???)F
??<??)?$??L,??????j???h???c9?4????Y???Ifm\Td?h?d?RF???w%*`????TP??,?0\?]R?6??k?jO{??	J1??#zN????Irf???(Q?h?oB?ry?C?wVbpM???j!?N?&??!?{????q
j?6?\???#"??d?????7cU?rY??)???=?Fe=FL?????JH??.?????*??rsG???97??B?n#qI#g#~?cc??Bb?t*S?>??N???[???LW????JyVz?,????%?,K47???)I#??2(????8?Y??=},y?s?????_???f??j?{??S???sh?I?qb?,?YJ%????/f
JZ? ??N??aJE??1d??O+????0b?H?
ooS%?3??P??RM??,?%'???{jS??D?5]?e?0]`?R?,???h0T?x)u???JTQ?Qe	????6??%?v?d??/2F?D??:???J?h?E????#96??M?I)e?QG9??i<qnj8????73??%7?s????)DN??(???~?<67?%"??Py??V<?a???moz???m?(???.EK:?E?????y??8,????cE?z??Qg??5x??vFu))(?#?B?{#x???`????SqL,Y-)J))%????%?RzV?R??Y??1P???d?8b???Hd%??_???dI?y30(???x????I1A?#%'?f?<X2o??\?	?h??R?'??`??{VM??f?(?????MS??QEQE)IJQs5??Jm?T"???,???6??[?p?$j??Y????z?E0ab(??D?)?????`??$?x<??r??vl?>'?0f???0d?ar?5]?%?f)??yf?
^`/(?????RYL_?%?,ZI%?
Y??J`??g???$17????)l$??q??<???{VQ4Y&M?????TF??8Y?H????kS??:lI???S???????qdj?I?wZ?a?p]t??1}???JJOb?.??(??;R7565w?E???JZ?F?q?I?F?I?'KE(?&??
?S??x9?rX???QC????|,?E
C??O?rE8P??=??


More information about the Nas mailing list