Assertion current-magic 0 failed
Hi,
I am testing the new version 3.0.7 on our system (iMX 6 on 4.1.46 kernel), and I would like to know
if anybody else encountered this error :
threadobj.c:1344: threadobj_prologue: Assertion `current->magic == 0' failed.
I compile the kernel with --enable-pshared --enable registry --enable-debug=full.
Here is a backtrace I get on the debug signal callback:
# Mode switch (reason: triggered fault), aborting. Backtrace:
Retrieve backtrace...
./tests_integration_lib_ipc(Unable to handle kernel NULL pointer dereference at virtual address 00000004
4x180)[0[x01020206000]08l0e0r0+
]]/ l*ipbd=39180831/libc.so.,6 (*+p0txe2=50105000)0[00, *ppte=000000000x76ca3150
/lib/libcopperplate.so.0(syncobj_lIonctke+r0nxa8l4 error: Oops: 17 [#1] PREEMPT SMP ARM
l0x76Meo1dau7lee8s]
i/nlkiebd/in:libcopper pcltarte.so.0(syncluster_fin
dcocbmj+0x34)[0x76e18eec]/lib/li buaslbc_hfe_mayc.mso.0(al u_serialchemy_bind _uosbbj_efc_te+c0mx98)[0x76e 3ge_1ccd0c]
nlib/libalchemy.so. 0u(_rett_hheerap_bind+0x30 libcomposite)[0x76e411c 4c]o
f/irgofost/libs/lib_ iwplc1.2sxox(init_local_data+0x6 0w)l[c0oxr7e6f1085c]
/roo mac80211t/libs/li bc_figp8c0.2s1o1(rt_shm_open+ 0rxf7k0i)l[l0x76f10bfc]
/tests _filnetxecgarnation_lib_ip wlcore_sdioc[0x12d68]
dc/il_ihbd/rlci_biamlchemy. suos.b0m(i+s0cx_ai4m4x8)[0x76e43 4c4i8_]h ]r/clib/libcoppe udc_corerplate.so. 0c(a+n0_xd8e3v14)[0x76e1a314
Ulib/libcobalt.so.2(+0x1058c)[0x76df558cC]P
: 1 PID: 296 Comm: Reception task Not tainted 4.1.46-ipipe #6
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) task: a885dd80 ti: a97fa000 task.ti: a97fa000 PC is at cobalt_signal_send+0xf8/0x1f8 LR is at 0x18 pc : [<800acedc>] lr : [<00000018>] psr: a0080093
sp : a97fbf00 ip : a94ff948 fp : 8095f680
r10: ab70e6e0 r9 : 00000124 r8 : 8088c880
r7 : 00000001 r6 : 00000000 r5 : 00800000 r4 : a94ff4d8 r3 : 00000017 r2 : 00000000 r1 : c08f9000 r0 : c09e5800
Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c53c7d Table: 38ec804a DAC: 00000015 Process Reception task (pid: 296, stack limit = 0xa97fa220)
Stack: (0xa97fbf00 to 0xa97fc000)
bf00: 00000018 c08f9000 c09e5800 800ad534 c09e5800 00000018 00000001 00000000
bf20: 8088c880 808945fc 00000018 800ad788 c09e9008 00000022 a97fbfb0 800ad71c
bf40: 808945fc 00000001 ab70e6e0 800ae248 762bce38 a97fbfb0 808945fc 20080013
bf60: 00000001 ab70d6e0 8095f680 8088b6e0 ab70e6e0 8008a14c 8095f680 a97fbfb0
bf80: 8088b6e0 8088da20 04000004 762bce14 762bce38 00000000 000f0042 8000f028
bfa0: a97fa000 00000002 762718cc 8000ef84 10000040 00000124 00000018 00000124
bfc0: 762bce14 762bce38 00000000 000f0042 76f23594 0001e030 76271c74 762718cc
bfe0: 00000018 76271870 000122ac 76df5148 20080010 10000040 8473a46f c307ae3a
[<800acedc>] (cobalt_signal_send) from [<800ad534>] (__cobalt_kill+0x190/0x1b0)
[<800ad534>] (__cobalt_kill) from [<800ad788>] (CoBaLt_kill+0x6c/0xcc) [<800ad788>] (CoBaLt_kill) from [<800ae248>] (ipipe_syscall_hook+0xfc/0x270) [<800ae248>] (ipipe_syscall_hook) from [<8008a14c>] (__ipipe_notify_syscall+0xa8/0x1a4)
[<8008a14c>] (__ipipe_notify_syscall) from [<8000ef84>] (pipeline_syscall+0x8/0x24)
Code: e5813084 e583c000 e8bd8070 e59421b0 (e592c004) ---[ end trace fcd211fc12a8e500 ]---
tests_integration_lib_ipc: threadobj.c:1344: threadobj_prologue: Assertion `current->magic == 0' failed.
[2]+ Aborted ./tests_integration_lib_ipc --session=rct
cha
#
Best regards
Stephane
Quoted 22 lines · Stéphane Reichert
Hi,
I am testing the new version 3.0.7 on our system (iMX 6 on 4.1.46 kernel), and I would like to know
if anybody else encountered this error :threadobj.c:1344:
threadobj_prologue: Assertion `current->magic == 0' failed.I compile the kernel with --enable-pshared --enable registry --enable-debug=full.
Here is a backtrace I get on the debug signal callback:
# Mode switch (reason: triggered fault), aborting. Backtrace:
Retrieve backtrace...
./tests_integration_lib_ipc(Unable to handle kernel NULL pointer dereference at virtual address 00000004
4x180)[0[x01020206000]08l0e0r0+
]]/ l*ipbd=39180831/libc.so.,6 (*+p0txe2=50105000)0[00, *ppte=000000000x76ca3150
Quoted 14 lines
/lib/libcopperplate.so.0(syncobj_lIonctke+r0nxa8l4 error: Oops: 17 [#1] PREEMPT SMP ARM
l0x76Meo1dau7lee8s]
i/nlkiebd/in:libcopper pcltarte.so.0(syncluster_fin
dcocbmj+0x34)[0x76e18eec]/lib/libuaslbc_hfe_mayc.mso.0(alu_serialchemy_bind_uosbbj_efc_te+c0mx98)[0x76e 3ge_1ccd0c]
nlib/libalchemy.so. 0u(_rett_hheerap_bind+0x30 libcomposite)[0x76e411c 4c]o
f/irgofost/libs/lib_ iwplc1.2sxox(init_local_data+0x6 0w)l[c0oxr7e6f1085c]
/roo mac80211t/libs/li bc_figp8c0.2s1o1(rt_shm_open+ 0rxf7k0i)l[l0x76f10bfc]
/tests_filnetxecgarnation_lib_ipwlcore_sdioc[0x12d68]
dc/il_ihbd/rlci_biamlchemy. suos.b0m(i+s0cx_ai4m4x8)[0x76e43 4c4i8_]h ]r/clib/libcoppe udc_corerplate.so. 0c(a+n0_xd8e3v14)[0x76e1a314
It looks like there are two backtraces, one generated from the app in userland, a second one by the kernel, none of them is readable as they intermingle.
Signature · 1 line
Philippe.
Sorry about that.
Here is a better trace:
Mode switch (reason: triggered fault), aborting. Backtrace:
[Xenomai] switching Reception task shmem to secondary mode after exception #0 in kernel-space at 0x800aced8 (pid 327)
Unable to handle kernel paging request at virtual address ffeccffe pgd = a96dc000 [ffeccffe] *pgd=3bf5e821, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#2] PREEMPT SMP ARM Modules linked in: ctr ccm usb_f_acm u_serial usb_f_ecm g_cdc u_ether libcomposite configfs wl12xx wlcore mac80211 cfg80211 rfkill flexcan wlcore_sdio ci_h drc_imx usbmisc_imx ci_hdrc udc_core can_dev CPU: 2 PID: 327 Comm: Reception task Tainted: G D 4.1.46-ipipe #6 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) task: a8bfb740 ti: a9e0c000 task.ti: a9e0c000 /lib/libc.so.6(+0x25150) [0x7P6Cdis at cobalt_signal_send+0xf8/0x1f8
07150]
/lib/libcopperplate.so.0(syncobj_lock+0x84) [0x76e7e7e8] /lib/libcopperplate.so.0(syncluster_findobj+0x34) [0x76e7ceec] /lib/libalchemy.so.0(alchemy_bind_object+0x98) [0x76ea21c0] /lib/libalchemy.so.0(rt_heap_bind+0x30) [0x76ea51c4] /root/libs/lib_ipc.so(init_local_data+0x60) [0x76f7485c] /root/libs/lib_ipc.so(rt_shm_open+0x70) [0x76f74bfc] ./tests_integration_lib_ipc() [0x12de0] /lib/libalchemy.so.0(+0xa448) [0x76ea7448] /lib/libcopperplate.so.0(+0x8314) [0x76e7e314] /lib/libcobalt.so.2(+0x1058c) [0x76e5958c]
LR is at 0x18
pc : [<800acedc>] lr : [<00000018>] psr: 80070093
sp : a9e0df00 ip : a94fd948 fp : 8095f680
r10: ab71c6e0 r9 : 00000142 r8 : 8088c880
r7 : 00000001 r6 : 00000000 r5 : 00800000 r4 : a94fd4d8 r3 : 00000017 r2 : ffeccffa r1 : c08f9088 r0 : c09e5800
Flags: Nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c53c7d Table: 396dc04a DAC: 00000015 Process Reception task (pid: 327, stack limit = 0xa9e0c220)
Stack: (0xa9e0df00 to 0xa9e0e000)
df00: 00000018 c08f9088 c09e5800 800ad534 c09e5800 00000018 00000001 00000000
df20: 8088c880 808945fc 00000018 800ad788 c09e9008 00000022 a9e0dfb0 800ad71c
df40: 808945fc 00000001 ab71c6e0 800ae248 76320e38 a9e0dfb0 808945fc 20070013
df60: 00000001 ab71b6e0 8095f680 8088b6e0 ab71c6e0 8008a14c 8095f680 a9e0dfb0
df80: 8088b6e0 8088da20 00000007 76320e14 76320e38 00000000 000f0042 8000f028
dfa0: a9e0c000 00000002 761cc8cc 8000ef84 10000040 00000142 00000018 00000142
dfc0: 76320e14 76320e38 00000000 000f0042 76f87594 0001e030 761ccc74 761cc8cc
dfe0: 00000018 761cc868 00012318 76e59148 20070010 10000040 00000000 00000000
[<800acedc>] (cobalt_signal_send) from [<800ad534>] (__cobalt_kill+0x190/0x1b0)
[<800ad534>] (__cobalt_kill) from [<800ad788>] (CoBaLt_kill+0x6c/0xcc) [<800ad788>] (CoBaLt_kill) from [<800ae248>] (ipipe_syscall_hook+0xfc/0x270) [<800ae248>] (ipipe_syscall_hook) from [<8008a14c>] (__ipipe_notify_syscall+0xa8/0x1a4)
[<8008a14c>] (__ipipe_notify_syscall) from [<8000ef84>] (pipeline_syscall+0x8/0x24)
Code: e5813084 e583c000 e8bd8070 e59421b0 (e592c004) ---[ end trace fcd211fc12a8e501 ]---
tests_integration_lib_ipc: threadobj.c:1344: threadobj_prologue: Assertion `current->magic == 0' failed.
Stéphane
-----Message d'origine-----
De : Philippe Gerum [mailto:[email protected]] Envoyé : jeudi 28 juin 2018 17:38
À : Stéphane Reichert; [email protected] Objet : Re: [Xenomai] Assertion current-magic 0 failed
Quoted 22 lines · Stéphane Reichert
Hi,
I am testing the new version 3.0.7 on our system (iMX 6 on 4.1.46 kernel), and I would like to know if anybody else encountered this error :
threadobj.c:1344:
threadobj_prologue: Assertion `current->magic == 0' failed.I compile the kernel with --enable-pshared --enable registry --enable-debug=full.
Here is a backtrace I get on the debug signal callback:
# Mode switch (reason: triggered fault), aborting. Backtrace:
Retrieve backtrace... ./tests_integration_lib_ipc(Unable to handle kernel NULL pointer dereference at virtual address 00000004 4x180)[0[x01020206000]08l0e0r0+ ]]/ l*ipbd=39180831/libc.so.,6 (*+p0txe2=50105000)0[00,
*ppte=000000000x76ca3150
Quoted 14 lines
/lib/libcopperplate.so.0(syncobj_lIonctke+r0nxa8l4 error: Oops: 17 [#1] PREEMPT SMP ARM l0x76Meo1dau7lee8s] i/nlkiebd/in:libcopper pcltarte.so.0(syncluster_fin
dcocbmj+0x34)[0x76e18eec]/lib/libuaslbc_hfe_mayc.mso.0(alu_serialchemy_bind_uosbbj_efc_te+c0mx98)[0x76e 3ge_1ccd0c] nlib/libalchemy.so. 0u(_rett_hheerap_bind+0x30 libcomposite)[0x76e411c 4c]o f/irgofost/libs/lib_ iwplc1.2sxox(init_local_data+0x6 0w)l[c0oxr7e6f1085c] /roo mac80211t/libs/li bc_figp8c0.2s1o1(rt_shm_open+ 0rxf7k0i)l[l0x76f10bfc] /tests_filnetxecgarnation_lib_ipwlcore_sdioc[0x12d68] dc/il_ihbd/rlci_biamlchemy. suos.b0m(i+s0cx_ai4m4x8)[0x76e43 4c4i8_]h ]r/clib/libcoppe udc_corerplate.so. 0c(a+n0_xd8e3v14)[0x76e1a314
It looks like there are two backtraces, one generated from the app in userland, a second one by the kernel, none of them is readable as they intermingle.
--
Philippe.
Quoted 64 lines · Stéphane Reichert
Sorry about that.
Here is a better trace:
Mode switch (reason: triggered fault), aborting. Backtrace:
[Xenomai] switching Reception task shmem to secondary mode after exception #0 in kernel-space at0x800aced8(pid 327)Unable to handle kernel paging request at virtual address ffeccffe pgd = a96dc000 [ffeccffe] *pgd=3bf5e821, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#2] PREEMPT SMP ARM Modules linked in: ctr ccm usb_f_acm u_serial usb_f_ecm g_cdc u_ether libcomposite configfs wl12xx wlcore mac80211 cfg80211 rfkill flexcan wlcore_sdio ci_h drc_imx usbmisc_imx ci_hdrc udc_core can_dev CPU: 2 PID: 327 Comm: Reception task Tainted: G D 4.1.46-ipipe #6 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) task: a8bfb740 ti: a9e0c000 task.ti: a9e0c000 /lib/libc.so.6(+0x25150) [0x7P6Cdis at cobalt_signal_send+0xf8/0x1f807150]
/lib/libcopperplate.so.0(syncobj_lock+0x84) [0x76e7e7e8] /lib/libcopperplate.so.0(syncluster_findobj+0x34) [0x76e7ceec] /lib/libalchemy.so.0(alchemy_bind_object+0x98) [0x76ea21c0] /lib/libalchemy.so.0(rt_heap_bind+0x30) [0x76ea51c4] /root/libs/lib_ipc.so(init_local_data+0x60) [0x76f7485c] /root/libs/lib_ipc.so(rt_shm_open+0x70) [0x76f74bfc] ./tests_integration_lib_ipc() [0x12de0] /lib/libalchemy.so.0(+0xa448) [0x76ea7448] /lib/libcopperplate.so.0(+0x8314) [0x76e7e314] /lib/libcobalt.so.2(+0x1058c) [0x76e5958c]
LR is at0x18pc : [<800acedc>] lr : [<00000018>] psr: 80070093sp :
a9e0df00ip :a94fd948fp :8095f680
r10:ab71c6e0r9 : 00000142 r8 :8088c880
r7 : 00000001 r6 : 00000000 r5 : 00800000 r4 :a94fd4d8r3 : 00000017 r2 : ffeccffa r1 :c08f9088r0 :c09e5800
Flags: Nzcv IRQs off FIQs on ModeSVC_32ISA ARM Segment user
Control:10c53c7dTable:396dc04aDAC: 00000015 Process Reception task (pid: 327, stack limit =0xa9e0c220)Stack: (0xa9e0df00 to 0xa9e0e000)df00: 00000018
c08f9088c09e5800800ad534c09e580000000018 00000001 00000000
df20:8088c880808945fc00000018800ad788c09e900800000022a9e0dfb0800ad71c
df40:808945fc00000001ab71c6e0800ae24876320e38a9e0dfb0808945fc20070013
df60: 00000001ab71b6e08095f6808088b6e0ab71c6e08008a14c8095f680a9e0dfb0
df80:8088b6e08088da200000000776320e1476320e3800000000000f00428000f028
dfa0:a9e0c00000000002761cc8cc8000ef8410000040 00000142 00000018 00000142
dfc0:76320e1476320e3800000000000f004276f875940001e030761ccc74761cc8cc
dfe0: 00000018761cc8680001231876e5914820070010 10000040 00000000 00000000
[<800acedc>] (cobalt_signal_send) from [<800ad534>] (__cobalt_kill+0x190/0x1b0)
[<800ad534>] (__cobalt_kill) from [<800ad788>] (CoBaLt_kill+0x6c/0xcc) [<800ad788>] (CoBaLt_kill) from [<800ae248>] (ipipe_syscall_hook+0xfc/0x270) [<800ae248>] (ipipe_syscall_hook) from [<8008a14c>] (__ipipe_notify_syscall+0xa8/0x1a4)
[<8008a14c>] (__ipipe_notify_syscall) from [<8000ef84>] (pipeline_syscall+0x8/0x24)
Quoted 5 lines
Code: e5813084 e583c000 e8bd8070 e59421b0 (e592c004) ---[ end trace fcd211fc12a8e501 ]---
tests_integration_lib_ipc: threadobj.c:1344:threadobj_prologue: Assertion `current->magic == 0' failed.
I can't make any sense of the user backtrace, which does not seem to match any possible code path which could be leading to the assertion above. The kernel panic may require a separate investigation.
1. the assertion from libcopperplate. Please run your application over GDB, then paste the backtrace reported by the debugger when the assertion trips ("bt" command). You may want to use a non-console terminal for running GDB, so that we can receive a clean trace unspoiled by any kernel warning.
2. the kernel panic.
* which I-pipe patch have you been using?
* is there any specifics we should know from your kernel setup?
* is your application using kill(2), and if so, passing which signal number?
* building your kernel with CONFIG_DEBUG_INFO enabled and triggering the bug again, please paste the output of the following command:
<your-toolchain>/bin/arm-linux-gnueabihf-addr2line -e <path-to-kernel>/vmlinux $pc
$pc is the panic trace above would be 800acedc.
Signature · 1 line
Philippe.
Hi Philippe:
Thanks for your answer. In fact, the assertion occurs when I call these two statements at the end of sigdebug_handler:
signal (sig, SIG_DFL);
kill (getpid(), sig);
You can find below the answers you asked for:
Backtrace reported by the debugger:
------------------------------------------------
Mode switch (reason: triggered fault), aborting. Backtrace:
/root/tests_integration_lib_ipc(sigdebug_handler+0x120)[0x12200] /lib/libc.so.6(+0x25150)[0x76d56150] /lib/libcopperplate.so.0(syncobj_lock+0x84)[0x76ecd7e8] /lib/libcopperplate.so.0(syncluster_findobj+0x34)[0x76ecbeec] /lib/libalchemy.so.0(alchemy_bind_object+0x98)[0x76ef11c0] /lib/libalchemy.so.0(rt_heap_bind+0x30)[0x76ef41c4] /root/libs/lib_ipc.so(init_local_data+0x60)[0x76fc385c] /root/libs/lib_ipc.so(rt_shm_open+0x70)[0x76fc3bfc] /root/tests_integration_lib_ipc[0x12d08] /lib/libalchemy.so.0(+0xa448)[0x76ef6448] /lib/libcopperplate.so.0(+0x8314)[0x76ecd314] /lib/libcobalt.so.2(+0x1058c)[0x76ea858c]
tests_integration_lib_ipc: threadobj.c:1344: threadobj_prologue: Assertion `current->magic == 0' failed.
This log is displayed in the sigdebug_handler when I call rt_heap_bind (switch into secondary mode).
Kernel Panic:
-----------------
. We have adapted the ipipe-core-patch-4.1.18 -arm-10.patch to our kernel (4.1.46).
. The kernel is compiled with these options for xenomai : full-debug, registry on, relax traces on.
. The problem occurs when we call the kill at the end of the sigdebug_handler (same function as in the "Finding
spurious relaxes" example).
. The result of the addr2line gives me :..../kernel/xenomai/posix/signal.c:75
This line code is (line 75 - function cobalt_signal_deliver):
if (sigismember(swc->set, sig))
Best regards
Stéphane
-----Message d'origine-----
De : Philippe Gerum [mailto:[email protected]] Envoyé : vendredi 29 juin 2018 15:57
À : Stéphane Reichert; [email protected] Objet : Re: [Xenomai] Assertion current-magic 0 failed
Quoted 65 lines · Stéphane Reichert
Sorry about that.
Here is a better trace:
Mode switch (reason: triggered fault), aborting. Backtrace:
[Xenomai] switching Reception task shmem to secondary mode after exception
#0 in kernel-space at0x800aced8(pid 327) Unable to handle kernel paging request at virtual address ffeccffe pgd =a96dc000[ffeccffe] *pgd=3bf5e821, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#2] PREEMPT SMP ARM Modules linked in: ctr ccmusb_f_acmu_serialusb_f_ecmg_cdcu_etherlibcomposite configfs wl12xx wlcore mac80211 cfg80211 rfkill flexcanwlcore_sdioci_hdrc_imxusbmisc_imxci_hdrcudc_corecan_devCPU: 2 PID: 327 Comm: Reception task Tainted: G D 4.1.46-ipipe #6 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) task: a8bfb740 ti: a9e0c000 task.ti: a9e0c000 /lib/libc.so.6(+0x25150) [0x7P6Cdis at cobalt_signal_send+0xf8/0x1f807150]
/lib/libcopperplate.so.0(syncobj_lock+0x84) [0x76e7e7e8] /lib/libcopperplate.so.0(syncluster_findobj+0x34) [0x76e7ceec] /lib/libalchemy.so.0(alchemy_bind_object+0x98) [0x76ea21c0] /lib/libalchemy.so.0(rt_heap_bind+0x30) [0x76ea51c4] /root/libs/lib_ipc.so(init_local_data+0x60) [0x76f7485c] /root/libs/lib_ipc.so(rt_shm_open+0x70) [0x76f74bfc] ./tests_integration_lib_ipc() [0x12de0] /lib/libalchemy.so.0(+0xa448) [0x76ea7448] /lib/libcopperplate.so.0(+0x8314) [0x76e7e314] /lib/libcobalt.so.2(+0x1058c) [0x76e5958c] LR is at0x18pc : [<800acedc>] lr : [<00000018>] psr: 80070093sp :
a9e0df00ip :a94fd948fp :8095f680
r10:ab71c6e0r9 : 00000142 r8 :8088c880
r7 : 00000001 r6 : 00000000 r5 : 00800000 r4 :a94fd4d8r3 : 00000017 r2 : ffeccffa r1 :c08f9088r0 :c09e5800
Flags: Nzcv IRQs off FIQs on ModeSVC_32ISA ARM Segment user
Control:10c53c7dTable:396dc04aDAC: 00000015 Process Reception task (pid: 327, stack limit =0xa9e0c220)Stack: (0xa9e0df00 to 0xa9e0e000)df00: 00000018
c08f9088c09e5800800ad534c09e580000000018 00000001 00000000
df20:8088c880808945fc00000018800ad788c09e900800000022a9e0dfb0800ad71c
df40:808945fc00000001ab71c6e0800ae24876320e38a9e0dfb0808945fc20070013
df60: 00000001ab71b6e08095f6808088b6e0ab71c6e08008a14c8095f680a9e0dfb0
df80:8088b6e08088da200000000776320e1476320e3800000000000f00428000f028
dfa0:a9e0c00000000002761cc8cc8000ef8410000040 00000142 00000018 00000142
dfc0:76320e1476320e3800000000000f004276f875940001e030761ccc74761cc8cc
dfe0: 00000018761cc8680001231876e5914820070010 10000040 00000000 00000000
[<800acedc>] (cobalt_signal_send) from [<800ad534>] (__cobalt_kill+0x190/0x1b0)
[<800ad534>] (__cobalt_kill) from [<800ad788>] (CoBaLt_kill+0x6c/0xcc) [<800ad788>] (CoBaLt_kill) from [<800ae248>] (ipipe_syscall_hook+0xfc/0x270) [<800ae248>] (ipipe_syscall_hook) from [<8008a14c>]
(__ipipe_notify_syscall+0xa8/0x1a4)
[<8008a14c>] (__ipipe_notify_syscall) from [<8000ef84>] (pipeline_syscall+0x8/0x24)
Quoted 5 lines
Code: e5813084 e583c000 e8bd8070 e59421b0 (e592c004) ---[ end trace
fcd211fc12a8e501]---tests_integration_lib_ipc: threadobj.c:1344:threadobj_prologue:
Assertion `current->magic == 0' failed.
I can't make any sense of the user backtrace, which does not seem to match any possible code path which could be leading to the assertion above. The kernel panic may require a separate investigation.
1. the assertion from libcopperplate. Please run your application over GDB, then paste the backtrace reported by the debugger when the assertion trips ("bt" command). You may want to use a non-console terminal for running GDB, so that we can receive a clean trace unspoiled by any kernel warning.
2. the kernel panic.
* which I-pipe patch have you been using?
* is there any specifics we should know from your kernel setup?
* is your application using kill(2), and if so, passing which signal number?
* building your kernel with CONFIG_DEBUG_INFO enabled and triggering the bug again, please paste the output of the following command:
<your-toolchain>/bin/arm-linux-gnueabihf-addr2line -e <path-to-kernel>/vmlinux $pc
$pc is the panic trace above would be 800acedc.
--
Philippe.
Quoted 4 lines · Stéphane Reichert
Hi Philippe:
Thanks for your answer. In fact, the assertion occurs when I call these two statements at the end of
sigdebug_handler:
Quoted 8 lines
signal (sig, SIG_DFL); kill (getpid(), sig);You can find below the answers you asked for:
Backtrace reported by the debugger:
------------------------------------------------
Mode switch (reason: triggered fault), aborting. Backtrace:
The mode switch is due to a memory access fault, and looking at the implementation of rt_heap_bind(), the only reason for this to happen in such situation would be that alchemy_init() did not run prior to calling rt_heap_bind().
In other words, I suspect that auto-init was disabled via xeno-config, but xenomai_init() was not yet called when rt_heap_bind() is issued. Would that be a plausible scenario?
Quoted 31 lines
/root/tests_integration_lib_ipc(sigdebug_handler+0x120)[0x12200] /lib/libc.so.6(+0x25150)[0x76d56150] /lib/libcopperplate.so.0(syncobj_lock+0x84)[0x76ecd7e8] /lib/libcopperplate.so.0(syncluster_findobj+0x34)[0x76ecbeec] /lib/libalchemy.so.0(alchemy_bind_object+0x98)[0x76ef11c0] /lib/libalchemy.so.0(rt_heap_bind+0x30)[0x76ef41c4] /root/libs/lib_ipc.so(init_local_data+0x60)[0x76fc385c] /root/libs/lib_ipc.so(rt_shm_open+0x70)[0x76fc3bfc] /root/tests_integration_lib_ipc[0x12d08] /lib/libalchemy.so.0(+0xa448)[0x76ef6448] /lib/libcopperplate.so.0(+0x8314)[0x76ecd314] /lib/libcobalt.so.2(+0x1058c)[0x76ea858c]
tests_integration_lib_ipc: threadobj.c:1344:threadobj_prologue: Assertion `current->magic == 0' failed.This log is displayed in the
sigdebug_handlerwhen I callrt_heap_bind(switch into secondary mode).Kernel Panic:
-----------------
. We have adapted the ipipe-core-patch-4.1.18 -arm-10.patch to our kernel (4.1.46).
. The kernel is compiled with these options for xenomai : full-debug, registry on, relax traces on.
. The problem occurs when we call the kill at the end of thesigdebug_handler(same function as in the "Finding
spurious relaxes" example).
. The result of the addr2line gives me :..../kernel/xenomai/posix/signal.c:75
This line code is (line 75 - functioncobalt_signal_deliver):
Quoted 2 lines
if (sigismember(swc->set, sig))
That kernel panic has to be fixed, however I have not been able to reproduce it yet. If you could either send me a basic test code triggering the issue, or the executable causing the fault (no source needed), that would help.
Signature · 1 line
Philippe.
Hi Philippe,
Unfortunately, we did not disable auto-init.
Maybe the fact that rt_heap_bind is called from a shared library could be the problem ?
I joined the 2 executables we are using. In order to reproduce the problem, you have to run these commands:
./start_lib_ipc --session=rct &
./tests_integration_lib_ipc --session=rct CH1 &
The shared library lib_ipc.so contains the call to rt_heap_bind.
The compiler options for the shared library are:
...../bin/arm-linux-gnueabihf-gcc -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE
-D_LARGEFILE_SOURCE -D_REENTRANT -D__COBALT_WRAP__ -D__COBALT__ -D__XENO__
-Dlib_ipc_EXPORTS -fmessage-length=0 -g -fPIC -Wall -Werror -fasynchronous-unwind-tables
....
The linker options for the shared library are:
....../bin/arm-linux-gnueabihf-gcc -fPIC -fmessage-length=0 -g -shared -Wl,-soname,lib_ipc.so
-o lib_ipc.so CMakeFiles/lib_ipc.dir/SRC/messages.c.oCMakeFiles/lib_ipc.dir/SRC/shared_memory.c.oCMakeFiles/lib_ipc.dir/SRC/fifoplus.c.oMakeFiles/lib_ipc.dir/SRC/init.c.o -L/home2/sreichert/workspace/lib_ipc/. -L/home2/sreichert/workspace/lib_ipc/../robot/lib -L/opt/toolchain/arm-linux-gnueabihf/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/xenomai
-lm -lalchemy -lcopperplate -lcobalt -lmodechk -lpthread -lrt/opt/toolchain/arm-linux-gnueabihf/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/xenomai/bootstrap-pic.o
-Wl,-rpath,/home2/sreichert/workspace/lib_ipc/.:/home2/sreichert/workspace/lib_ipc/../robot/lib:/opt/toolchain/arm-linux-gnueabihf/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/xenomaiThe compiler options for the executables are:...../bin/arm-linux-gnueabihf-gcc -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_REENTRANT -D__COBALT_WRAP__ -D__COBALT__ -D__XENO__ -g -Wall -Werror -fasynchronous-unwind-tables ....The linker options for the executables are:...../bin/arm-linux-gnueabihf-gcc -gCMakeFiles/tests_integration_lib_ipc.dir/SRC/test_lib_ipc.c.oCMakeFiles/tests_integration_lib_ipc.dir/SRC/sighandler.c.oCMakeFiles/tests_integration_lib_ipc.dir/SRC/test_fifo.c.oCMakeFiles/tests_integration_lib_ipc.dir/SRC/test_shared_memory.c.o -otests_integration_lib_ipc -L/home2/sreichert/workspace/tests_integration_lib_ipc/. -L/home2/sreichert/workspace/tests_integration_lib_ipc/../robot/lib -L/opt/toolchain/arm-linux-gnueabihf/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/xenomai -rdynamic -l_ipc -lm -lfuse -lalchemy -lcopperplate -lcobalt -lmodechk -lpthread -lrt -Wl,--wrap=main,@/opt/toolchain/arm-linux-gnueabihf/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/cobalt.wrappers/opt/toolchain/arm-linux-gnueabihf/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/xenomai/bootstrap.o -Wl,-rpath,/home2/sreichert/workspace/tests_integration_lib_ipc/.:/home2/sreichert/workspace/tests_integration_lib_ipc/../robot/lib:/opt/toolchain/arm-linux-gnueabihf/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/xenomaiI did another try and this time the pc was stuck oninclude/linux/signal.h:79This line is : return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));I hope this could help.Best regardsStéphane-----Message d'origine-----De : Philippe Gerum [mailto:[email protected]]Envoyé : mercredi 4 juillet 2018 11:30À : Stéphane Reichert; [email protected] : Re: [Xenomai] Assertion current-magic 0 failedOn 07/04/2018 09:54 AM, Stéphane Reichert wrote:> Hi Philippe:>> Thanks for your answer. In fact, the assertion occurs when I call> these two statements at the end of sigdebug_handler:> signal (sig, SIG_DFL);> kill (getpid(), sig);>> You can find below the answers you asked for:>> Backtrace reported by the debugger:> ------------------------------------------------> Mode switch (reason: triggered fault), aborting. Backtrace:The mode switch is due to a memory access fault, and looking at theimplementation of rt_heap_bind(), the only reason for this to happen in suchsituation would be that alchemy_init() did not run prior to callingrt_heap_bind().In other words, I suspect that auto-init was disabled via xeno-config, butxenomai_init() was not yet called when rt_heap_bind() is issued.Would that be a plausible scenario?> /root/tests_integration_lib_ipc(sigdebug_handler+0x120)[0x12200]> /lib/libc.so.6(+0x25150)[0x76d56150]> /lib/libcopperplate.so.0(syncobj_lock+0x84)[0x76ecd7e8]> /lib/libcopperplate.so.0(syncluster_findobj+0x34)[0x76ecbeec]> /lib/libalchemy.so.0(alchemy_bind_object+0x98)[0x76ef11c0]> /lib/libalchemy.so.0(rt_heap_bind+0x30)[0x76ef41c4]> /root/libs/lib_ipc.so(init_local_data+0x60)[0x76fc385c]> /root/libs/lib_ipc.so(rt_shm_open+0x70)[0x76fc3bfc]> /root/tests_integration_lib_ipc[0x12d08]> /lib/libalchemy.so.0(+0xa448)[0x76ef6448]> /lib/libcopperplate.so.0(+0x8314)[0x76ecd314]> /lib/libcobalt.so.2(+0x1058c)[0x76ea858c]>> tests_integration_lib_ipc: threadobj.c:1344: threadobj_prologue:> Assertion `current->magic == 0' failed.>> This log is displayed in the sigdebug_handler when I call rt_heap_bind> (switch into secondary mode).>> Kernel Panic:> -----------------> . We have adapted the ipipe-core-patch-4.1.18 -arm-10.patch to our> kernel (4.1.46).> . The kernel is compiled with these options for xenomai : full-debug,> registry on, relax traces on.> . The problem occurs when we call the kill at the end of the> sigdebug_handler (same function as in the "Finding spurious relaxes"> example).> . The result of the addr2line gives me :> ..../kernel/xenomai/posix/signal.c:75> This line code is (line 75 - function cobalt_signal_deliver):> if (sigismember(swc->set, sig))>That kernel panic has to be fixed, however I have not been able to reproduceit yet. If you could either send me a basic test code triggering the issue,or the executable causing the fault (no source needed), that would help.--Philippe.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: start_lib_ipc
Type: application/octet-stream
Size: 14712 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180704/bf6c01f7/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tests_integration_lib_ipc
Type: application/octet-stream
Size: 50588 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180704/bf6c01f7/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lib_ipc.so
Type: application/octet-stream
Size: 62708 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180704/bf6c01f7/attachment.so>
Quoted 6 lines · Stéphane Reichert
Hi Philippe,
Unfortunately, we did not disable auto-init.
Maybe the fact that
rt_heap_bindis called from a shared library could be the problem ?
Does that code run over a constructor routine (i.e. tagged with __attribute__((constructor))?
Quoted 8 lines
I joined the 2 executables we are using. In order to reproduce the problem, you have to run these commands:
./start_lib_ipc --session=rct &
./tests_integration_lib_ipc --session=rct CH1 &The shared library lib_ipc.so contains the call to
rt_heap_bind.
Ok, I'll have a look. Thanks.
Signature · 1 line
Philippe.