Skip to contentSkip to conversation

bad syscall <167772715>/ Segmentation fault during xeno-test

Xenomai Reitinger, Peter 2 participants 6 messages Sep 25, 2014

lore
Share & tools
lore
#0 lore raw

Dear Xenomai people,

I have recently tried to migrate from 2.x to 3.x, but when I tried to run xeno-test, I get the following output:

root@dimm-am335x:/usr/xenomai/bin# ./xeno-test latency
Started child 1194: /bin/sh /usr/xenomai/bin/xeno-test-run-wrapper ./xeno-test latency
+ echo 0
+ testdir=/usr/xenomai/bin
+ /usr/xenomai/bin/smokey --run
mul: 0x79364d93, shft: 26
integ: 30, frac: 0x4d9364d9364d9364

signed positive operation: 0x03ffffffffffffff * 1000000000 / 33000000 inline calibration: 0x0000000000000000: 219.845 ns, rejected 3/10000 inlined llimd: 0x79364d9364d9362f: 1267.191 ns, rejected 8/10000 inlined llmulshft: 0x79364d92ffffffe1: 33.104 ns, rejected 2/10000 inlined nodiv_llimd: 0x79364d9364d9362f: 60.079 ns, rejected 2/10000 out of line calibration: 0x0000000000000000: 229.895 ns, rejected 3/10000 out of line llimd: 0x79364d9364d9362f: 1284.325 ns, rejected 3/10000 out of line llmulshft: 0x79364d92ffffffe1: 30.295 ns, rejected 2/10000 out of line nodiv_llimd: 0x79364d9364d9362f: 53.200 ns, rejected 2/10000

signed negative operation: 0xfc00000000000001 * 1000000000 / 33000000 inline calibration: 0x0000000000000000: 220.145 ns, rejected 2/10000 inlined llimd: 0x86c9b26c9b26c9d1: 1279.633 ns, rejected 7/10000 inlined llmulshft: 0x86c9b26d0000001e: 39.912 ns, rejected 1/10000 inlined nodiv_llimd: 0x86c9b26c9b26c9d1: 59.633 ns, rejected 2/10000 out of line calibration: 0x0000000000000000: 230.004 ns, rejected 2/10000 out of line llimd: 0x86c9b26c9b26c9d1: 1290.504 ns, rejected 3/10000 out of line llmulshft: 0x86c9b26d0000001e: 30.016 ns, rejected 3/10000 out of line nodiv_llimd: 0x86c9b26c9b26c9d1: 60.054 ns, rejected 2/10000

unsigned operation: 0x03ffffffffffffff * 1000000000 / 33000000 inline calibration: 0x0000000000000000: 219.695 ns, rejected 3/10000 inlined nodiv_ullimd: 0x79364d9364d9362f: 60.091 ns, rejected 3/10000 out of line calibration: 0x0000000000000000: 230.037 ns, rejected 7/10000 out of line nodiv_ullimd: 0x79364d9364d9362f: 50.025 ns, rejected 5/10000 arith OK
server: received 4 bytes, 1 from port 12
client: sent 4 bytes, 1
server: received 4 bytes, 2 from port 12
client: sent 4 bytes, 2
server: received 4 bytes, 3 from port 12
client: sent 4 bytes, 3
server: received 4 bytes, 4 from port 12
client: sent 4 bytes, 4
server: received 4 bytes, 5 from port 12
client: sent 4 bytes, 5
server: received 4 bytes, 6 from port 12
client: sent 4 bytes, 6
server: received 4 bytes, 7 from port 12
client: sent 4 bytes, 7
server: received 4 bytes, 8 from port 12
client: sent 4 bytes, 8
server: received 4 bytes, 9 from port 12
client: sent 4 bytes, 9
server: received 4 bytes, 10 from port 12
client: sent 4 bytes, 10
server: received 4 bytes, 11 from port 12
client: sent 4 bytes, 11
server: received 4 bytes, 12 from port 12
client: sent 4 bytes, 12
server: received 4 bytes, 13 from port 12
client: sent 4 bytes, 13
server: received 4 bytes, 14 from port 12
client: sent 4 bytes, 14
server: received 4 bytes, 15 from port 12
client: sent 4 bytes, 15
server: received 4 bytes, 16 from port 12
client: sent 4 bytes, 16
server: received 4 bytes, 17 from port 12
client: sent 4 bytes, 17
server: received 4 bytes, 18 from port 12
client: sent 4 bytes, 18
server: received 4 bytes, 19 from port 12
client: sent 4 bytes, 19
server: received 4 bytes, 20 from port 12
client: sent 4 bytes, 20
server: received 4 bytes, 21 from port 12
client: sent 4 bytes, 21
server: received 4 bytes, 22 from port 12
client: sent 4 bytes, 22
server: received 4 bytes, 23 from port 12
client: sent 4 bytes, 23
server: received 4 bytes, 24 from port 12
client: sent 4 bytes, 24
server: received 4 bytes, 25 from port 12
client: sent 4 bytes, 25
server: received 4 bytes, 26 from port 12
client: sent 4 bytes, 26
server: received 4 bytes, 27 from port 12
client: sent 4 bytes, 27
server: received 4 bytes, 28 from port 12
client: sent 4 bytes, 28
server: received 4 bytes, 29 from port 12
client: sent 4 bytes, 29
bufp OK
simple_condwait
relative_condwait
absolute_condwait
sig_norestart_condwait
sig_restart_condwait
sig_norestart_condwait_mutex
sig_restart_condwait_mutex
sig_norestart_double
sig_restart_double
cond_destroy_whilewait
cond_torture OK
Test OK
fork_exec OK
server: received 4 bytes, 1 from port 13
client: sent 4 bytes, 1
server: received 4 bytes, 2 from port 13
client: sent 4 bytes, 2
server: received 4 bytes, 3 from port 13
client: sent 4 bytes, 3
server: received 4 bytes, 4 from port 13
client: sent 4 bytes, 4
server: received 4 bytes, 5 from port 13
client: sent 4 bytes, 5
server: received 4 bytes, 6 from port 13
client: sent 4 bytes, 6
server: received 4 bytes, 7 from port 13
client: sent 4 bytes, 7
server: received 4 bytes, 8 from port 13
client: sent 4 bytes, 8
server: received 4 bytes, 9 from port 13
client: sent 4 bytes, 9
server: received 4 bytes, 10 from port 13
client: sent 4 bytes, 10
server: received 4 bytes, 11 from port 13
client: sent 4 bytes, 11
server: received 4 bytes, 12 from port 13
client: sent 4 bytes, 12
server: received 4 bytes, 13 from port 13
client: sent 4 bytes, 13
server: received 4 bytes, 14 from port 13
client: sent 4 bytes, 14
server: received 4 bytes, 15 from port 13
client: sent 4 bytes, 15
server: received 4 bytes, 16 from port 13
client: sent 4 bytes, 16
server: received 4 bytes, 17 from port 13
client: sent 4 bytes, 17
server: received 4 bytes, 18 from port 13
client: sent 4 bytes, 18
server: received 4 bytes, 19 from port 13
client: sent 4 bytes, 19
server: received 4 bytes, 20 from port 13
client: sent 4 bytes, 20
server: received 4 bytes, 21 from port 13
client: sent 4 bytes, 21
server: received 4 bytes, 22 from port 13
client: sent 4 bytes, 22
server: received 4 bytes, 23 from port 13
client: sent 4 bytes, 23
server: received 4 bytes, 24 from port 13
client: sent 4 bytes, 24
server: received 4 bytes, 25 from port 13
client: sent 4 bytes, 25
server: received 4 bytes, 26 from port 13
client: sent 4 bytes, 26
server: received 4 bytes, 27 from port 13
client: sent 4 bytes, 27
server: received 4 bytes, 28 from port 13
client: sent 4 bytes, 28
server: received 4 bytes, 29 from port 13
client: sent 4 bytes, 29
iddp OK
simple_wait
recursive_wait
errorcheck_wait
timed_mutex
mode_switch
pi_wait
lock_stealing
NOTE: lock_stealing mutex_trylock: not supported deny_stealing
mutex_torture OK
simple_condwait
recursive_condwait
auto_switchback
Setup
Exclusive open
Successive open
Defer close by pending reference
Normal close
Deferred module unload
rtdm OK

[   94.434282] [Xenomai] bad syscall <167772715>

Segmentation fault
root@dimm-am335x:/usr/xenomai/bin#

Probably I just forgot one or another little thing to adapt...?

Kind regards
Peter Reitinger

#1 lore raw
Quoted 5 lines · Peter

Dear Xenomai people,

I have recently tried to migrate from 2.x to 3.x, but when I tried to run xeno-test, I get the following output:

[snip]

Quoted 8 lines
[   94.434282] [Xenomai] bad syscall <167772715>

Segmentation fault
root@dimm-am335x:/usr/xenomai/bin#

Probably I just forgot one or another little thing to adapt...?

This is not a Xenomai 3 syscall signature, but a Xenomai 2.x's. Could you provide the output of /usr/xenomai/bin/version -a?

TIA,

Signature · 1 line
Philippe.
#2 lore raw
Quoted 15 lines · Philippe Gerum
Quoted 5 lines · Peter

Dear Xenomai people,

I have recently tried to migrate from 2.x to 3.x, but when I tried to run xeno-test, I get the following output:

[snip]

Quoted 6 lines
[   94.434282] [Xenomai] bad syscall <167772715>

Segmentation fault
root@dimm-am335x:/usr/xenomai/bin#

Quoted 6 lines
Quoted 2 lines

Probably I just forgot one or another little thing to adapt...?

This is not a Xenomai 3 syscall signature, but a Xenomai 2.x's. Could you provide the output of /usr/xenomai/bin/version -a?

Never mind, I can reproduce on igep, this looks like arm-specific. I'll follow up on this. Thanks.

Signature · 1 line
Philippe.
#3 lore raw
Quoted 19 lines · Philippe Gerum
Quoted 18 lines · Philippe Gerum
Quoted 5 lines · Peter

Dear Xenomai people,

I have recently tried to migrate from 2.x to 3.x, but when I tried to run xeno-test, I get the following output:

[snip]

Quoted 8 lines
[   94.434282] [Xenomai] bad syscall <167772715>

Segmentation fault
root@dimm-am335x:/usr/xenomai/bin#

Probably I just forgot one or another little thing to adapt...?

Quoted 7 lines
Quoted 3 lines

This is not a Xenomai 3 syscall signature, but a Xenomai 2.x's. Could you provide the output of /usr/xenomai/bin/version -a?

Never mind, I can reproduce on igep, this looks like arm-specific. I'll follow up on this. Thanks.

Ok, the watchdog fired while running the quata scheduling test, which is legitimate with the default 4s threshold. What went wrong is that some of the watchdog bits were not updated to the new syscall format. Raising CONFIG_XENO_OPT_WATCHDOG_TIMEOUT to a larger value will prevent the trigger (or disabling CONFIG_XENO_OPT_WATCHDOG as well), while I'm fixing this.

Signature · 1 line
Philippe.
#4 lore raw
Quoted 28 lines · Philippe Gerum
Quoted 19 lines · Philippe Gerum
Quoted 18 lines · Philippe Gerum
Quoted 5 lines · Peter

Dear Xenomai people,

I have recently tried to migrate from 2.x to 3.x, but when I tried to run xeno-test, I get the following output:

[snip]

Quoted 8 lines
[   94.434282] [Xenomai] bad syscall <167772715>

Segmentation fault
root@dimm-am335x:/usr/xenomai/bin#

Probably I just forgot one or another little thing to adapt...?

Quoted 7 lines
Quoted 3 lines

This is not a Xenomai 3 syscall signature, but a Xenomai 2.x's. Could you provide the output of /usr/xenomai/bin/version -a?

Never mind, I can reproduce on igep, this looks like arm-specific. I'll follow up on this. Thanks.

Quoted 7 lines

Ok, the watchdog fired while running the quata scheduling test, which is legitimate with the default 4s threshold. What went wrong is that some of the watchdog bits were not updated to the new syscall format. Raising CONFIG_XENO_OPT_WATCHDOG_TIMEOUT to a larger value will prevent the trigger (or disabling CONFIG_XENO_OPT_WATCHDOG as well), while I'm fixing this.

Nope, disabling the watchdog won't be enough, as the Cobalt core uses a mayday trap internally for other purpose. However, this patch should fix the issue:

(quoted diff) +0 -0

b/kernel/cobalt/arch/arm/mayday.c
index d6b7924..724200b 100644

kernel/cobalt/arch/arm/mayday.c +1 -1
@@ -35,7 +35,7 @@ void xnarch_setup_mayday_page(void *page)
 	 * ef000000 	svc	0x00000000
 	 * e3a00000 	mov	r0, #0
 	 * e5800000 	str	r0, [r0]	; <bug>
-	 * 0a00022b     .word   0x0a00022b	; __xn_sys_mayday << 24
+	 * 1000005e     .word   0x1000005e	; sc_cobalt_mayday |

__COBALT_SYSCALL_BIT
* 000f0042 .word 0x000f0042
*
* elif ARM_OABI
@@ -44,7 +44,7 @@ void xnarch_setup_mayday_page(void *page)
* ef9f0042 swi 0x009f0042
* e3a00000 mov r0, #0
* e5800000 str r0, [r0] ; <bug>

-	 * 0a00022b     .word   0x0a00022b	; __xn_sys_mayday << 24
+	 * 1000005e     .word   0x1000005e	; sc_cobalt_mayday |

__COBALT_SYSCALL_BIT
*
* endif
*
@@ -69,7 +69,7 @@ void xnarch_setup_mayday_page(void *page)
.swi_0 = 0xef000000,
.mov_r0 = 0xe3a00000,
.str_r0 = 0xe5800000,
- .cst_r0 = 0x0a00022b,
+ .cst_r0 = sc_cobalt_mayday | __COBALT_SYSCALL_BIT,
.cst_r7 = 0x000f0042,
};
#else /* OABI */
@@ -84,7 +84,7 @@ void xnarch_setup_mayday_page(void *page)
.swi_syscall = 0xef9f0042,
.mov_r0 = 0xe3a00000,
.str_r0 = 0xe5800000,
- .cst_r0 = 0x0a00022b,
+ .cst_r0 = sc_cobalt_mayday | __COBALT_SYSCALL_BIT,
};
#endif /* OABI */

Signature · 1 line
Philippe.
#5 lore raw
Quoted 37 lines · Philippe Gerum
Quoted 28 lines · Philippe Gerum
Quoted 19 lines · Philippe Gerum
Quoted 18 lines · Philippe Gerum
Quoted 5 lines · Peter

Dear Xenomai people,

I have recently tried to migrate from 2.x to 3.x, but when I tried to run xeno-test, I get the following output:

[snip]

Quoted 8 lines
[   94.434282] [Xenomai] bad syscall <167772715>

Segmentation fault
root@dimm-am335x:/usr/xenomai/bin#

Probably I just forgot one or another little thing to adapt...?

Quoted 7 lines
Quoted 3 lines

This is not a Xenomai 3 syscall signature, but a Xenomai 2.x's. Could you provide the output of /usr/xenomai/bin/version -a?

Never mind, I can reproduce on igep, this looks like arm-specific. I'll follow up on this. Thanks.

Quoted 7 lines

Ok, the watchdog fired while running the quata scheduling test, which is legitimate with the default 4s threshold. What went wrong is that some of the watchdog bits were not updated to the new syscall format. Raising CONFIG_XENO_OPT_WATCHDOG_TIMEOUT to a larger value will prevent the trigger (or disabling CONFIG_XENO_OPT_WATCHDOG as well), while I'm fixing this.

Review

Quoted 5 lines

Nope, disabling the watchdog won't be enough, as the Cobalt core uses a mayday trap internally for other purpose. However, this patch should fix the issue:

(quoted diff) +0 -0

Fix confirmed, the complete non-regression test now passes with the current master and -next branches.

Signature · 1 line
Philippe.