This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

using DSPLink in C++ hangs Linux

Other Parts Discussed in Thread: OMAP3530

To troubleshoot an intermittent hang in a large C++ application that uses DSPLink, I'm creating a simple application to stress test my OMAP3530 system.  I'd like to get feedback from anyone who has used DSPLink in C++.

I'm having difficulty calling even a simple sequence of DSPLink functions: PROC_setup(), PROC_attach(), PROC_detach(), and PROC_destroy() from a C++ class.  Refer to my example in the attached tar.  When I call the method dsptest::Run(), I get the error message "terminate called without an active exception" then the CPU stalls.  SysRq-T shows the following states.  It seems like the cleanup of NOTIFY is getting stuck:

dsptest       S c0351858     0   222    204 0x00000000
[<c0351858>] (schedule+0x2a4/0x2e8) from [<c009b274>] (futex_wait_queue_me+0xf4/0x114)
[<c009b274>] (futex_wait_queue_me+0xf4/0x114) from [<c009b3c0>] (futex_wait+0x12c/0x284)
[<c009b3c0>] (futex_wait+0x12c/0x284) from [<c009ce40>] (do_futex+0xac/0x7cc)
[<c009ce40>] (do_futex+0xac/0x7cc) from [<c009d6a0>] (sys_futex+0x140/0x154)
[<c009d6a0>] (sys_futex+0x140/0x154) from [<c004eec0>] (ret_fast_syscall+0x0/0x2c)
dsptest       S c0351858     0   226    204 0x00000000
[<c0351858>] (schedule+0x2a4/0x2e8) from [<c03519f8>] (schedule_timeout+0x18/0x1a0)
[<c03519f8>] (schedule_timeout+0x18/0x1a0) from [<bf00fa44>] (SYNC_WaitSEM+0x1a8/0x220 [dsplinkk])
[<bf00fa44>] (SYNC_WaitSEM+0x1a8/0x220 [dsplinkk]) from [<bf010710>] (UEVENT_AddBufByPid+0x130/0x14c [dsplinkk])
[<bf010710>] (UEVENT_AddBufByPid+0x130/0x14c [dsplinkk]) from [<bf010fa4>] (NOTIFY_KnlFinalize+0x13c/0x150 [dsplinkk])
[<bf010fa4>] (NOTIFY_KnlFinalize+0x13c/0x150 [dsplinkk]) from [<bf012f28>] (DRV_Ioctl+0x614/0x7b8 [dsplinkk])
[<bf012f28>] (DRV_Ioctl+0x614/0x7b8 [dsplinkk]) from [<c00d91fc>] (vfs_ioctl+0x5c/0x6c)
[<c00d91fc>] (vfs_ioctl+0x5c/0x6c) from [<c00d98d0>] (do_vfs_ioctl+0x4f0/0x54c)
[<c00d98d0>] (do_vfs_ioctl+0x4f0/0x54c) from [<c00d9960>] (sys_ioctl+0x34/0x54)
[<c00d9960>] (sys_ioctl+0x34/0x54) from [<c004eec0>] (ret_fast_syscall+0x0/0x2c)
DSPLINK_DPC_0 S c0351858     0   223      2 0x00000000
[<c0351858>] (schedule+0x2a4/0x2e8) from [<c0351b4c>] (schedule_timeout+0x16c/0x1a0)
[<c0351b4c>] (schedule_timeout+0x16c/0x1a0) from [<bf00f3f0>] (DPC_Callback+0xa0/0xb8 [dsplinkk])
[<bf00f3f0>] (DPC_Callback+0xa0/0xb8 [dsplinkk]) from [<c008f2d8>] (kthread+0x78/0x80)
[<c008f2d8>] (kthread+0x78/0x80) from [<c004fecc>] (kernel_thread_exit+0x0/0x8)
DSPLINK_DPC_1 S c0351858     0   224      2 0x00000000
[<c0351858>] (schedule+0x2a4/0x2e8) from [<c0351b4c>] (schedule_timeout+0x16c/0x1a0)
[<c0351b4c>] (schedule_timeout+0x16c/0x1a0) from [<bf00f3f0>] (DPC_Callback+0xa0/0xb8 [dsplinkk])
[<bf00f3f0>] (DPC_Callback+0xa0/0xb8 [dsplinkk]) from [<c008f2d8>] (kthread+0x78/0x80)
[<c008f2d8>] (kthread+0x78/0x80) from [<c004fecc>] (kernel_thread_exit+0x0/0x8)
DSPLINK_DPC_2 S c0351858     0   225      2 0x00000000
[<c0351858>] (schedule+0x2a4/0x2e8) from [<c0351b4c>] (schedule_timeout+0x16c/0x1a0)
[<c0351b4c>] (schedule_timeout+0x16c/0x1a0) from [<bf00f3f0>] (DPC_Callback+0xa0/0xb8 [dsplinkk])
[<bf00f3f0>] (DPC_Callback+0xa0/0xb8 [dsplinkk]) from [<c008f2d8>] (kthread+0x78/0x80)
[<c008f2d8>] (kthread+0x78/0x80) from [<c004fecc>] (kernel_thread_exit+0x0/0x8)

If I enable tracing in DSPLink, sometimes I get the stall and sometimes I get a successful application exit.  Refer to the text file "dsptest failing exit C++.txt".  I notice that the DSPLink signal handler gets invoked twice.  The first invocation corresponds with a SIGABRT signal that happens near the "terminate called without an active exception" message.  The trace shows that _NOTIFY_exit() was started but never completed.

If I call my PROC_setup(), PROC_attach(), PROC_detach(), and PROC_destroy() outside of the C++ class (see global function dsptest_run() in my example), then the application gets a clean exit.  The DSPLink signal handler only gets invoked once.  See the trace output in the file "dsptest successful exit in C++.txt".

Does anyone have any ideas why DSPLink would behave differently when used from a class versus the global namespace?

Thanks,
Chris Norris

dsptest_gpp.tar.gz