Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Segfault when using TBB with R

chun-yu
Beginner
119 Views
We have been trying to use TBB from R ( http://www.r-project.org/ ), but we seem to be hitting the following segfault in spawn_root_and_wait():

Program received signal SIGSEGV, Segmentation fault.
0x00007fffc36f237d in ?? () from /usr/lib64/libtbb.so.2
(gdb) bt
#0 0x00007fffc36f237d in ?? () from /usr/lib64/libtbb.so.2
#1 0x00007fffc36f0ae7 in ?? () from /usr/lib64/libtbb.so.2
#2 0x00007fffc3905872 in spawn_root_and_wait (root=...) at /usr/include/tbb/task.h:692
#3 dummy (a$0=, b$0=) at manual_test3.cpp:117
#4 0x00007ffff78f7218 in ?? () from /usr/lib64/R/lib/libR.so
#5 0x00007ffff792bbcb in Rf_eval () from /usr/lib64/R/lib/libR.so
#6 0x00007ffff79609b3 in Rf_ReplIteration () from /usr/lib64/R/lib/libR.so
#7 0x00007ffff7960c10 in ?? () from /usr/lib64/R/lib/libR.so
#8 0x00007ffff7961110 in run_Rmainloop () from /usr/lib64/R/lib/libR.so
#9 0x00000000004008ab in main ()

Are there any known incompatibilities between TBB and R, or is there anything we can do to track down the cause of this?
0 Kudos
2 Replies
RafSchietekat
Black Belt
119 Views
Wild guess: try to have task_scheduler_init on the stack (maybe use of R, which I don't know, interferes wth automagic initialisation).
SergeyKostrov
Valued Contributor II
119 Views
Quoting chun-yu
We have been trying to use TBB from R ( http://www.r-project.org/ ), but we seem to be hitting the following segfault in spawn_root_and_wait():

...is there anything we can do to track down the cause of this?


A test case that reproduces the problem... Or,

1. In a Debugger, seta break point on a line 692 in 'task.h' and as soon as a program hits the break point step-into it:

...
static void spawn_root_and_wait( task& root ) {
root.prefix().owner->spawn_root_and_wait( root, root.prefix().next );
}
...

2. Continue debugging inside the function untillAccess Violation ( SEGFAULT )happens...

Best regards,
Sergey

Reply