Hi, We enabled CONFIG_XENO_OPT_DEBUG_NUCLEUS and get the following fatal bug:
[ 26.208785] Xenomai: fatal: bug at kernel/xenomai/nucleus/synch.c:723 (xnthread_get_rescnt(lastowner) < 0) This occurs at different places in our code, one of which is in the rt-serial driver 16550A.c in line 1076. I don't think the code of this driver is using the out_lock in a wrong way, so any idea what can be wrong then? We use Xenomai 2.5.6 on Linux 2.6.32.15 x86 with auto-relax patches from 'head': http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=b75cec19387e561f82ac55595db8c993b049f071 to http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=6653a9e8eb7339b749989bd74adc3ac3bd29e4da and http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=82200f0b66908a5366a72355b3b70472031d68fb http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=becb13774ab687d016857f6a972f4124fbd10c44 Thanks, Henri. On Thu, May 5, 2011 at 4:40 PM, Henri Roosen <[email protected]> wrote: > On Thu, May 5, 2011 at 3:55 PM, Philippe Gerum <[email protected]> wrote: >> On Mon, 2011-05-02 at 10:58 +0200, Henri Roosen wrote: >>> Hi Philippe, >>> >>> Thanks for the patch! Unfortunately this does not resolve the 'stuck >>> in primary of prio 0 after rt_task_send'. >>> >>> I'll attach the basic test application that reproduces it. All prints >>> should contain secondary mode because all tasks are prio 0 and the >>> auto-relax patches are compiled in. >>> >>> The producer which does the rt_task_send() call does not auto-relax to >>> secondary mode. >> >> Your example code works with this added patch on top of both 2.5.x and >> -head: >> http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=82200f0b66908a5366a72355b3b70472031d68fb >> > > Hi Philippe! > I tried this patch and can confirm it results in expected behaviour of > the prio 0 scheduling now, also in our main application. > > Thanks a lot! > Henri > >>> >>> Thanks, >>> Henri. >>> >>> On Sun, May 1, 2011 at 5:01 PM, Philippe Gerum <[email protected]> wrote: >>> > On Mon, 2011-03-28 at 12:56 +0200, Henri Roosen wrote: >>> >> Hi, >>> >> >>> >> We are using the back-ported auto-relax patches of Xenomai-head on the >>> >> 2.5.6 release on Linux 2.6.32.15. >>> >> >>> >> We noticed that our prio-0 shadowed task is not always auto-relaxed >>> >> and traced it back to a problem with rt_task_send/receive/reply. The >>> >> rt_task_send/receive/reply mechanism uses the xnsynch primitive to >>> >> implement its PIP. However, this mechanism only acquires the xysynch >>> >> primitive without releasing it. This results in the resource counter >>> >> never be 0 anymore and thus breaking the auto-relaxed which is based >>> >> on this resource counter. >>> >> >>> >> I guess releasing the xnsynch resets the owner, which is not wanted >>> >> either.. >>> >> Any idea for a fix? >>> > >>> > Could you give a try at this one? TIA, >>> > http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=becb13774ab687d016857f6a972f4124fbd10c44 >>> > >>> >> >>> >> Thanks, >>> >> Henri. >>> >> >>> >> >>> >> On Tue, Oct 12, 2010 at 9:16 AM, Henri Roosen <[email protected]> >>> >> wrote: >>> >> > That was a problem with our build environment. >>> >> > >>> >> > Patches work and the base-prio 0 task nicely switches to the Linux >>> >> > domain and competes with the Linux threads for the processor. Now we >>> >> > don't loose TCP connection to our target anymore. >>> >> > >>> >> > Thanks! >>> >> > >>> >> > Henri >>> >> > >>> >> > On Mon, Oct 11, 2010 at 5:35 PM, Henri Roosen <[email protected]> >>> >> > wrote: >>> >> >> Thanks for the patches Philippe. I applied them to xenomai 2.5.5. >>> >> >> Tests with a basic application look good, however our bigger project >>> >> >> doesn't. I checked already if we release all mutexes; the base prio 0 >>> >> >> thread thread released all of them but stays in primary domain after a >>> >> >> xenomai call. >>> >> >> >>> >> >> I'll setup a clean environment, just to be sure, and will investigate >>> >> >> further tomorrow. >>> >> >> >>> >> >> On Mon, Oct 11, 2010 at 11:31 AM, Andreas Glatz >>> >> >> <[email protected]> wrote: >>> >> >>> >>> >> >>>> >>> >> >>>> The auto-relax feature is now available from -head (upcoming >>> >> >>>> 2.6.x). You >>> >> >>>> will need all commits from >>> >> >>>> http://git.xenomai.org/?p=xenomai- >>> >> >>>> head.git;a=commit;h=b75cec19387e561f82ac55595db8c993b049f071 >>> >> >>>> to >>> >> >>>> http://git.xenomai.org/?p=xenomai- >>> >> >>>> head.git;a=commit;h=6653a9e8eb7339b749989bd74adc3ac3bd29e4da >>> >> >>>> >>> >> >>>> -- >>> >> >>>> Philippe. >>> >> >>>> >>> >> >>>> >>> >> >>> >>> >> >>> Very nice. Will try it out soon on my G4 PB Aluminium. >>> >> >>> >>> >> >>> Andreas >>> >> >>> >>> >> >>> >>> >> >>> _______________________________________________ >>> >> >>> Xenomai-help mailing list >>> >> >>> [email protected] >>> >> >>> https://mail.gna.org/listinfo/xenomai-help >>> >> >>> >>> >> >> >>> >> > >>> > >>> > -- >>> > Philippe. >>> > >>> > >>> > >> >> -- >> Philippe. >> >> >> > _______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
