Seg Fault with cilk -.-

Seg Fault with cilk -.-

OK good news finally got my compiler up and linked properly xD. Bad news seg fault -.-. OK I'm using the cpp file of Fibonacci numbers provided by . So when I go to add the extra arguement ex. ./a.out 2. I get a seg fault -.-. Any ideas. I DID NOT WRITE THE FILE lol.

cute_rj@Cute:~/cilk-fib$ which g++
cute_rj@Cute:~/cilk-fib$ g++ -fcilkplus -lcilkrts fib.cpp
cute_rj@Cute:~/cilk-fib$ g++ -fcilkplus -lcilkrts fib.cpp
cute_rj@Cute:~/cilk-fib$ ./a.out 2
Segmentation fault (core dumped)

16 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Ryan,

     I am not able to reproduce your issue. I tried the testcase and I got the following output:

/home/gcc> ../cilkplus-install/bin/g++ -fcilkplus fib.cpp -lcilkrts
/home/gcc> ./a.out
Fibonacci number #39 is 63245986.
Calculated in 0.890 seconds using 8 workers.
/home/gcc> ./a.out  2
Fibonacci number #39 is 63245986.
Calculated in 2.115 seconds using 2 workers.

Can you try to use gdb and see what is going on? (please recompile the source file with -g flag).


Balaji V. Iyer.

Funny thing is my professor has the same problem lol. I have no idea how to use gdb xD trying ddd

DDD didnt even want to help me. Gah

oh all we have is the compiler, no add ons or extensions and we built the complier

DDD doesn't seem to want to help me -.-

Rebuild the application using the following command:

   g++ -ggdb -fcilkplus -lcilkrts fib.cpp

This the -ggdb option will generate a binary with debug symbols for GDB.  Now execute the application under GDB:

   gdb ./a.out

When you get the GDB prompt, enter the command:

   run 2

This will run the application, and pass it 2 as it's parameter.  When GDB stops due to the error, issue the "bt" command to get a "backtrace". This should show you where in your application you are.  Post the results here.

    - Barry

This is what I got even though it don't make sense to me haha

cute_rj@Cute:~/cilk-fib$ g++ -ggdb -fcilkplus -lcilkrts fib.cpp
cute_rj@Cute:~/cilk-fib$ gdb ./a.out
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /home/cute_rj/cilk-fib/a.out...done.
(gdb) run 2
Starting program: /home/cute_rj/cilk-fib/a.out 2
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/".
[New Thread 0xb7caab40 (LWP 3986)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7caab40 (LWP 3986)]
0xb7fc63ba in cilk_fiber_sysdep::run() ()
at /home/cute_rj/gcc-cilk-src/libcilkrts/runtime/cilk_fiber-unix.cpp:170
170 do_post_switch_actions();
(gdb) bt
#0 0xb7fc63ba in cilk_fiber_sysdep::run() ()
at /home/cute_rj/gcc-cilk-src/libcilkrts/runtime/cilk_fiber-unix.cpp:170
#1 0xb7fc6483 in cilk_fiber_sysdep::resume_other_sysdep(cilk_fiber_sysdep*) [clone .isra.4] ()
at /home/cute_rj/gcc-cilk-src/libcilkrts/runtime/cilk_fiber-unix.cpp:111
#2 0xb7fc64cc in cilk_fiber_sysdep::suspend_self_and_resume_other_sysdep(cilk_fiber_sysdep*) ()
at /home/cute_rj/gcc-cilk-src/libcilkrts/runtime/cilk_fiber-unix.cpp:125
#3 0xb7fc5cee in cilk_fiber::suspend_self_and_resume_other(cilk_fiber*) ()
from /home/cute_rj/gcc-cilk/lib/
#4 0xb7fc5d43 in cilk_fiber_suspend_self_and_resume_other ()
from /home/cute_rj/gcc-cilk/lib/
#5 0xb7fcdda5 in worker_scheduler_function ()
at /home/cute_rj/gcc-cilk-src/libcilkrts/runtime/scheduler.c:2081
#6 0xb7fc9cea in __cilkrts_run_scheduler_with_exceptions ()
from /home/cute_rj/gcc-cilk/lib/
#7 0xb7fcff9f in scheduler_thread_proc_for_system_worker ()
from /home/cute_rj/gcc-cilk/lib/
#8 0xb7cb9d4c in start_thread () from /lib/i386-linux-gnu/
#9 0xb7dbcdde in clone () from /lib/i386-linux-gnu/

ok waiting for approval for post -.-

Oh thanks for taking the time to help me!

Are you using this compiler on a 64-bit machine? In your last thread you mentioned that you had LD_LIBRARY_PATH as the following:


If you are using this on the 64-bit machine, then replace LD_LIBRARY_PATH with /home/cute_rj/gcc-cilk/lib64.




Balaji V. Iyer.

nope I'm using 32 bit virtual machine on a 64 bit computer 

Yes, I am able to reproduce this issue.  I will get back to you when I get a solution.


Balaji V. Iyer.

Thanks! Hopefully this helps me down in the long run for my master's work

Hi Ryan,

    We have found a fix for this issue. I am attaching a file called cilk-fiber_unix.cpp. Please save this file (and overwrite the existing one) in cilkplus-gcc/libcilkrts/runtime directory and then reconfigure and remake.

Please let me know if you still have issues.


Balaji V. Iyer.


Downloadtext/x-c++src cilk-fiber-unix.cpp8.06 KB

Appreciate it! Will let you know!

Leave a Comment

Please sign in to add a comment. Not a member? Join today