Warning when compiling trunk.
I get this warning when compiling trunk:
checking for __thread... rm: cannot remove `conftest1.dir': Is a directory yes
Signature · 1 line
Gilles.
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yes
That simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Jan
Quoted 7 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yes
Quoted 5 lines
That simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with __thread on ARM in rt_task_trampoline. I am currently testing the SIGWINCH thing, and if __thread is disabled, there is no segfault.
Signature · 1 line
Gilles.
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesThat simple, it's a typo in this line:
Quoted 7 lines
Quoted 3 lines
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.
If a #ifdef 0 xeno_set_current, there is no segfault.
Signature · 1 line
Gilles.
Quoted 10 lines · Gilles Chanteperdrix
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesThat simple, it's a typo in this line:
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.If a #ifdef 0
xeno_set_current, there is no segfault.
Interesting. What about removing the initial-exec attributes? Is __thread otherwise know to work on your platform?
Jan
Quoted 14 lines · Jan Kiszka
Quoted 13 lines · Gilles Chanteperdrix
Quoted 12 lines · Gilles Chanteperdrix
Quoted 11 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesThat simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.If a #ifdef 0
xeno_set_current, there is no segfault.Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?
Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;
When the segfault happens iargs->task is NULL. I suspect you are not supposed to use iargs after the __native_task_create syscall.
Signature · 1 line
Gilles.
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Jan Kiszka
Quoted 18 lines · Gilles Chanteperdrix
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesQuoted 8 lines
Quoted 5 lines
That simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.If a #ifdef 0
xeno_set_current, there is no segfault.
Quoted 7 lines
Quoted 2 lines
Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;When the segfault happens
iargs->taskis NULL. I suspect you are not supposed to use iargs after the__native_task_createsyscall.
Yes, that was the problem.
However, another problem, should not the __thread variables be given the weak attribute too? If a native thread tries to use a pthread mutex, I want pthread_mutex_lock to obtain the current xnhandle_t set by the native skin, not an inexistant one that should have been set by the posix skin but obviously has not.
Signature · 1 line
Gilles.
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Jan Kiszka
Quoted 18 lines · Gilles Chanteperdrix
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesQuoted 8 lines
Quoted 5 lines
That simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.If a #ifdef 0
xeno_set_current, there is no segfault.
Quoted 7 lines
Quoted 2 lines
Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;When the segfault happens
iargs->taskis NULL. I suspect you are not supposed to use iargs after the__native_task_createsyscall.
Don't see the race yet. iargs is provided by the trampoline creator, and with that one we synchronize with the barrier AFTER this access - or does the compiler some fancy reordering here?
Jan
Quoted 21 lines · Gilles Chanteperdrix
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Jan Kiszka
Quoted 18 lines · Gilles Chanteperdrix
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesQuoted 8 lines
Quoted 5 lines
That simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.If a #ifdef 0
xeno_set_current, there is no segfault.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;When the segfault happens
iargs->taskis NULL. I suspect you are not supposed to use iargs after the__native_task_createsyscall.Yes, that was the problem.
What did you change? Can you explain the why to me?
Quoted 7 lines
However, another problem, should not the
__threadvariables be given the weak attribute too? If a native thread tries to use a pthread mutex, I wantpthread_mutex_lockto obtain the currentxnhandle_tset by the native skin, not an inexistant one that should have been set by the posix skin but obviously has not.
Yes, true. Please commit a fix as you are already patching.
Jan
Quoted 24 lines · Jan Kiszka
Quoted 23 lines · Gilles Chanteperdrix
Quoted 22 lines · Gilles Chanteperdrix
Quoted 21 lines · Jan Kiszka
Quoted 10 lines · Gilles Chanteperdrix
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesThat simple, it's a typo in this line:
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.If a #ifdef 0
xeno_set_current, there is no segfault.Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;When the segfault happens
iargs->taskis NULL. I suspect you are not supposed to use iargs after the__native_task_createsyscall.Yes, that was the problem.
What did you change? Can you explain the why to me?
Because I guess iargs is no longer valid at this point. So, I saved the task pointer and reused it.
Signature · 1 line
Gilles.
Quoted 29 lines · Gilles Chanteperdrix
Quoted 28 lines · Jan Kiszka
Quoted 27 lines · Gilles Chanteperdrix
Quoted 26 lines · Gilles Chanteperdrix
Quoted 13 lines · Jan Kiszka
Quoted 12 lines · Gilles Chanteperdrix
Quoted 11 lines · Gilles Chanteperdrix
Quoted 10 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesThat simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.If a #ifdef 0
xeno_set_current, there is no segfault.Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;When the segfault happens
iargs->taskis NULL. I suspect you are not supposed to use iargs after the__native_task_createsyscall.
Quoted 6 lines
Quoted 2 lines
Quoted 1 line
Yes, that was the problem.
What did you change? Can you explain the why to me?
Because I guess iargs is no longer valid at this point. So, I saved the task pointer and reused it.
Sorry, makes no sense to me: *iargs is on the stack of the rt_task_create caller, and that one is not expected to proceed until we issue __xn_sys_barrier.
Jan
Quoted 31 lines · Jan Kiszka
Quoted 30 lines · Gilles Chanteperdrix
Quoted 29 lines · Jan Kiszka
Quoted 28 lines · Gilles Chanteperdrix
Quoted 18 lines · Gilles Chanteperdrix
Quoted 17 lines · Jan Kiszka
Quoted 16 lines · Gilles Chanteperdrix
Quoted 15 lines · Gilles Chanteperdrix
Quoted 11 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesThat simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
If a #ifdef 0
xeno_set_current, there is no segfault.Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;When the segfault happens
iargs->taskis NULL. I suspect you are not supposed to use iargs after the__native_task_createsyscall.Yes, that was the problem.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
What did you change? Can you explain the why to me?
Because I guess iargs is no longer valid at this point. So, I saved the task pointer and reused it.
Sorry, makes no sense to me: *iargs is on the stack of the
rt_task_createcaller, and that one is not expected to proceed until we issue__xn_sys_barrier.
Well I am busy with the ARM FCSE now. Do you want my test case ?
Signature · 1 line
Gilles.
Quoted 33 lines · Gilles Chanteperdrix
Quoted 32 lines · Jan Kiszka
Quoted 31 lines · Gilles Chanteperdrix
Quoted 30 lines · Jan Kiszka
Quoted 21 lines · Gilles Chanteperdrix
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Jan Kiszka
Quoted 18 lines · Gilles Chanteperdrix
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesQuoted 8 lines
Quoted 5 lines
That simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.If a #ifdef 0
xeno_set_current, there is no segfault.Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;When the segfault happens
iargs->taskis NULL. I suspect you are not supposed to use iargs after the__native_task_createsyscall.Yes, that was the problem.
What did you change? Can you explain the why to me?
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Because I guess iargs is no longer valid at this point. So, I saved the task pointer and reused it.
Sorry, makes no sense to me: *iargs is on the stack of the
rt_task_createcaller, and that one is not expected to proceed until we issue__xn_sys_barrier.Well I am busy with the ARM FCSE now. Do you want my test case ?
Yes, hoping that it triggers on x86 as well. And is toolchain independent.
Jan
Quoted 4 lines · Jan Kiszka
Quoted 1 line · Gilles Chanteperdrix
Well I am busy with the ARM FCSE now. Do you want my test case ?
Yes, hoping that it triggers on x86 as well. And is toolchain independent.
Signature · 1 line
Gilles.
#include <stdio.h>
#include <sys/mman.h>
#include <pthread.h>
#include <native/task.h>
void relaxed_thread(void *cookie)
{
rt_task_set_mode(T_PRIMARY, 0, NULL);
for (;;)
;
}int main(void)
{
struct sched_param p;
RT_TASK tid;
mlockall(MCL_CURRENT | MCL_FUTURE);
p.sched_priority = 99;
pthread_setschedparam(pthread_self(), SCHED_FIFO, &p);
rt_task_spawn(&tid, "relax", 65536, 12, 0, relaxed_thread, NULL);
sleep(1);
rt_task_suspend(&tid);
sleep(1);
exit(EXIT_SUCCESS);
}Quoted 5 lines · Gilles Chanteperdrix
Quoted 3 lines · Jan Kiszka
Quoted 1 line · Gilles Chanteperdrix
Well I am busy with the ARM FCSE now. Do you want my test case ?
Yes, hoping that it triggers on x86 as well. And is toolchain independent.
It doesn't trigger. Can you reproduce on x86?
Jan
Quoted 7 lines · Jan Kiszka
Quoted 4 lines · Gilles Chanteperdrix
Quoted 3 lines · Jan Kiszka
Quoted 1 line · Gilles Chanteperdrix
Well I am busy with the ARM FCSE now. Do you want my test case ?
Yes, hoping that it triggers on x86 as well. And is toolchain independent.
It doesn't trigger. Can you reproduce on x86?
I think it will trigger more easily on UP. Did you try on UP ?
Signature · 1 line
Gilles.
Quoted 7 lines · Jan Kiszka
Quoted 4 lines · Gilles Chanteperdrix
Quoted 3 lines · Jan Kiszka
Quoted 1 line · Gilles Chanteperdrix
Well I am busy with the ARM FCSE now. Do you want my test case ?
Yes, hoping that it triggers on x86 as well. And is toolchain independent.
It doesn't trigger. Can you reproduce on x86?
Beware, I just noticed that I commited my fix. I thought I had commited only files where I made changes for SIGWINCH, but it happens that I had also made changes for SIGWINCH in src/skins/native/task.c
Signature · 1 line
Gilles.
Quoted 11 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka
Quoted 4 lines · Gilles Chanteperdrix
Quoted 3 lines · Jan Kiszka
Quoted 1 line · Gilles Chanteperdrix
Well I am busy with the ARM FCSE now. Do you want my test case ?
Yes, hoping that it triggers on x86 as well. And is toolchain independent.
It doesn't trigger. Can you reproduce on x86?
Beware, I just noticed that I commited my fix. I thought I had commited only files where I made changes for SIGWINCH, but it happens that I had also made changes for SIGWINCH in
src/skins/native/task.c
I ran my local version of yesterday afternoon, and I used UP - no segfaults. This issue remains fishy. Even if there is a race, we need to understand it first. And I'm still failing to see what races.
Jan
Quoted 31 lines · Jan Kiszka
Quoted 30 lines · Gilles Chanteperdrix
Quoted 29 lines · Jan Kiszka
Quoted 28 lines · Gilles Chanteperdrix
Quoted 18 lines · Gilles Chanteperdrix
Quoted 17 lines · Jan Kiszka
Quoted 16 lines · Gilles Chanteperdrix
Quoted 15 lines · Gilles Chanteperdrix
Quoted 11 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesThat simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
If a #ifdef 0
xeno_set_current, there is no segfault.Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;When the segfault happens
iargs->taskis NULL. I suspect you are not supposed to use iargs after the__native_task_createsyscall.Yes, that was the problem.
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
What did you change? Can you explain the why to me?
Because I guess iargs is no longer valid at this point. So, I saved the task pointer and reused it.
Sorry, makes no sense to me: *iargs is on the stack of the
rt_task_createcaller, and that one is not expected to proceed until we issue__xn_sys_barrier.
Gilles is right, the caller may vanish before your thread variable is assigned. __sys_barrier is there to synchronize with rt_task_start(), not internally with the task creator.
parent: rt_task_create
-> child: rt_task_trampoline -> xnshadow_map -> wakeup_process(parent) <parent stack unwinding> -> child: assignment from automatic data, oops.
You may want to track how the completion block is used.
Quoted 10 lines
Jan
------------------------------------------------------------------------
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
Quoted 45 lines · Philippe Gerum
Quoted 30 lines · Jan Kiszka
Quoted 29 lines · Gilles Chanteperdrix
Quoted 28 lines · Jan Kiszka
Quoted 27 lines · Gilles Chanteperdrix
Quoted 26 lines · Gilles Chanteperdrix
Quoted 13 lines · Jan Kiszka
Quoted 12 lines · Gilles Chanteperdrix
Quoted 11 lines · Gilles Chanteperdrix
Quoted 10 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
I get this warning when compiling trunk:
checking for
__thread... rm: cannot remove `conftest1.dir': Is a directory yesThat simple, it's a typo in this line:
http://www.rts.uni-hannover.de/xenomai/lxr/source/configure.in?v=SVN-trunk#394
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Also, that rm should be done outside the if block to play safe.
Ok. But once this is fixed, I get a segmentation fault with
__threadon ARM inrt_task_trampoline. I am currently testing the SIGWINCH thing, and if__threadis disabled, there is no segfault.If a #ifdef 0
xeno_set_current, there is no segfault.Interesting. What about removing the initial-exec attributes? Is
__threadotherwise know to work on your platform?Yes. This is a race condition, the real bug is, IMHO:
__native_self = *iargs->task;When the segfault happens
iargs->taskis NULL. I suspect you are not supposed to use iargs after the__native_task_createsyscall.Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line
Yes, that was the problem.
What did you change? Can you explain the why to me?
Because I guess iargs is no longer valid at this point. So, I saved the task pointer and reused it.
Sorry, makes no sense to me: *iargs is on the stack of the
rt_task_createcaller, and that one is not expected to proceed until we issue__xn_sys_barrier.Gilles is right, the caller may vanish before your thread variable is assigned.
__sys_barrieris there to synchronize withrt_task_start(), not internally with the task creator.
Quoted 8 lines
parent:
rt_task_create-> child: rt_task_trampoline -> xnshadow_map -> wakeup_process(parent) <parent stack unwinding> -> child: assignment from automatic data, oops.You may want to track how the completion block is used.
Damn, signal_completion is already invoked by xnshadow_map - OK, now this makes a lot of sense.
Just checked the rest, and I introduced the same issue to vxworks. Will fix.
Jan