* [Xenomai-help] Problem with posix skin and Xenomai 2.1.0
@ 2006-04-03 9:17 Jens Niehaus
2006-04-03 12:23 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: Jens Niehaus @ 2006-04-03 9:17 UTC (permalink / raw)
To: xenomai
Hi,
I am experiencing problems with xenomai 2.1.0 and pthread_mutex_init. The second initialization in the following program returns with a value of 16 (EBUSY). What is wrong with the code (or with xenomai)?
Thanks in advance,
Jens
---------------------------------------
#include <pthread.h>
#include <stdio.h>
int main( int argc, char *argv[] )
{
pthread_mutex_t m1;
pthread_mutex_t m2;
int ret;
if ( (ret = pthread_mutex_init( &m1, NULL ) ) )
{
printf("First init failed, ret=%i\n", ret );
return ret;
}
/* sleep(1); */
if ( ( ret = pthread_mutex_init( &m2, NULL ) ) )
{
printf("Second init failed, ret=%i\n", ret );
return ret;
}
printf("Done\n");
return 0;
}
--------------------------------------
I am using xenomai 2.1.0 and kernel 2.6.15.7 compiled with gcc 3.3.5 (SuSE 9.3).
The program does work
- when using xenomai 2.1-rc2
- when compiling without xenomai
- when sleep(1) is inserted between the calls to pthread_mutex_init
The program does not work
- when using kernel 2.6.14.6
- with mutex initialization after pthread_setschedparam( pthread_self(), SCHED_FIFO, ... );
- with mutex initialization in a newly created, SCHED_FIFO enabled thread
- when using pthread_mutexattr_t structures for initialization
- on different processors: Athlon 64 2800+ (build system) and VIA Samuel 2 533Mhz (target system)
Here is some more information, which might be helpful:
root: cat /proc/cmdline
auto BOOT_IMAGE=xenomai rw root=100 init=/linuxrc ramdisk_size=8196 noapic noacpi noapm
root: grep /configure /usr/src/xenomai-build/config.log
$ ../xenomai-2.1.0/configure --enable-x86-tsc --enable-debug
root: zcat /proc/config.gz|grep XENO |grep -v "not set"
CONFIG_XENOMAI=y
CONFIG_XENO_OPT_NUCLEUS=y
CONFIG_XENO_OPT_PERVASIVE=y
CONFIG_XENO_OPT_PIPE=y
CONFIG_XENO_OPT_PIPE_NRDEV=32
CONFIG_XENO_OPT_REGISTRY=y
CONFIG_XENO_OPT_REGISTRY_NRSLOTS=512
CONFIG_XENO_OPT_SYS_HEAPSZ=128
CONFIG_XENO_OPT_STATS=y
CONFIG_XENO_OPT_DEBUG=y
CONFIG_XENO_OPT_TIMING_PERIODIC=y
CONFIG_XENO_OPT_TIMING_PERIOD=0
CONFIG_XENO_OPT_TIMING_TIMERLAT=0
CONFIG_XENO_OPT_TIMING_SCHEDLAT=0
CONFIG_XENO_OPT_TIMER_LIST=y
CONFIG_XENO_HW_FPU=y
CONFIG_XENO_HW_SMI_DETECT=y
CONFIG_XENO_SKIN_NATIVE=y
CONFIG_XENO_OPT_NATIVE_PIPE=y
CONFIG_XENO_OPT_NATIVE_PIPE_BUFSZ=4096
CONFIG_XENO_OPT_NATIVE_SEM=y
CONFIG_XENO_OPT_NATIVE_EVENT=y
CONFIG_XENO_OPT_NATIVE_MUTEX=y
CONFIG_XENO_OPT_NATIVE_COND=y
CONFIG_XENO_OPT_NATIVE_QUEUE=y
CONFIG_XENO_OPT_NATIVE_HEAP=y
CONFIG_XENO_OPT_NATIVE_ALARM=y
CONFIG_XENO_OPT_NATIVE_MPS=y
CONFIG_XENO_SKIN_POSIX=y
CONFIG_XENO_SKIN_RTDM=y
Compilation:
gcc -g $(shell xeno-config --posix-cflags) mutextst.c $(shell xeno-config --posix-ldflags) -o mutextstxeno
gcc -g mutextst.c -lpthread -o mutextst
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Problem with posix skin and Xenomai 2.1.0
2006-04-03 9:17 [Xenomai-help] Problem with posix skin and Xenomai 2.1.0 Jens Niehaus
@ 2006-04-03 12:23 ` Gilles Chanteperdrix
2006-04-03 13:46 ` Jens Niehaus
2006-04-04 7:14 ` Jens Niehaus
0 siblings, 2 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2006-04-03 12:23 UTC (permalink / raw)
To: Jens Niehaus; +Cc: xenomai
Jens Niehaus wrote:
> Hi,
>
> I am experiencing problems with xenomai 2.1.0 and pthread_mutex_init. The second initialization in the following program returns with a value of 16 (EBUSY). What is wrong with the code (or with xenomai)?
There was a bug in syscall.c, which should be fixed by revision 870 in
the trunk and by revision 871 in 2.1 branch.
Thanks for reporting.
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Problem with posix skin and Xenomai 2.1.0
2006-04-03 12:23 ` Gilles Chanteperdrix
@ 2006-04-03 13:46 ` Jens Niehaus
2006-04-04 7:14 ` Jens Niehaus
1 sibling, 0 replies; 4+ messages in thread
From: Jens Niehaus @ 2006-04-03 13:46 UTC (permalink / raw)
To: xenomai
On Mon, 3 Apr 2006 14:23:42 +0200 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> wrote:
> > Hi,
> >
> > I am experiencing problems with xenomai 2.1.0 and pthread_mutex_init.
>
> There was a bug in syscall.c, which should be fixed by revision 870 in
> the trunk and by revision 871 in 2.1 branch.
>
Thank you for the quick response. Unfortunately the bug still occurs with revision 871 (branch).
If you cannot reproduce the bug on your system any more I'd like to help fixing this one. So tell me if you need some more output, configurations or printf/printk-stuff from within xenomai code.
Jens
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Problem with posix skin and Xenomai 2.1.0
2006-04-03 12:23 ` Gilles Chanteperdrix
2006-04-03 13:46 ` Jens Niehaus
@ 2006-04-04 7:14 ` Jens Niehaus
1 sibling, 0 replies; 4+ messages in thread
From: Jens Niehaus @ 2006-04-04 7:14 UTC (permalink / raw)
To: xenomai
> > I am experiencing problems with xenomai 2.1.0 and pthread_mutex_init. The second initialization in the following program returns with a value of 16 (EBUSY). What is wrong with the code (or with xenomai)?
>
> There was a bug in syscall.c, which should be fixed by revision 870 in
> the trunk and by revision 871 in 2.1 branch.
Correctly applied this really solves the problem, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-04-04 7:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-03 9:17 [Xenomai-help] Problem with posix skin and Xenomai 2.1.0 Jens Niehaus
2006-04-03 12:23 ` Gilles Chanteperdrix
2006-04-03 13:46 ` Jens Niehaus
2006-04-04 7:14 ` Jens Niehaus
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.