cilk_for + matrix multiply example segfaults, can't seem to get any cilk_for working

cilk_for + matrix multiply example segfaults, can't seem to get any cilk_for working

I cannot get even the simpliest cilk_for to work

cilk_for (int i = 0; i < 8; i++) {
std::cout << i << std::endl;
}

segfaults. Here is a gdb run of one the matrix multiply examples included with the cilk SDK.

robackja@azrael:/opt/cilk/examples/matrix_multiply$ gdb ./matrix_multiply
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /opt/cilk/examples/matrix_multiply/matrix_multiply...done.
(gdb) run 8
Starting program: /opt/cilk/examples/matrix_multiply/matrix_multiply 8
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffff70c3910 (LWP 5193)]
[New Thread 0x7ffff68c2910 (LWP 5194)]
[New Thread 0x7ffff60c1910 (LWP 5195)]
[New Thread 0x7ffff58c0910 (LWP 5196)]
[New Thread 0x7ffff50bf910 (LWP 5197)]
[New Thread 0x7ffff48be910 (LWP 5198)]
[New Thread 0x7ffff40bd910 (LWP 5199)]
Simple algorithm: Mulitply two 8 by 8 matrices, coumputing A = B*C

Program received signal SIGSEGV, Segmentation fault.
0x0000000000403b48 in ltq_check() ()
(gdb) bt
#0 0x0000000000403b48 in ltq_check() ()
#1 0x0000000000404ad0 in cilk::cilk_for_loop ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) quit
A debugging session is active.

Inferior 1 [process 5190] will be killed.

Quit anyway? (y or n) y

8 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Hi.

Would you mind posting some details of your linux installation (e.g., which version of Ubuntu, 32/64 bits, CPU model), so that I can try to reproduce the bug? The matrix multiplication example works fine on my debian/squeeze installation

Thanks,
Matteo Frigo

Quoting - Matteo Frigo (Intel)
Hi.

Would you mind posting some details of your linux installation (e.g., which version of Ubuntu, 32/64 bits, CPU model), so that I can try to reproduce the bug? The matrix multiplication example works fine on my debian/squeeze installation

Thanks,
Matteo Frigo

Ubuntu 9.10 / 64-bit (went from 8.04 to 8.10 to 9.04 to 9.10)

Linux azrael 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 x86_64 GNU/Linux
Intel Xeon CPU E5405 @ 2.00GHz, LGA771, dual socket, 2x quad-cores
8GB of DDR2, 2x WD Raptors in Software RAID-0

I previously had Cilk-1.0.1 on the machine and I didn't recall a single issue. I previously put it in /opt/cilk-blah. Before I installed Intel Cilk SDK, I just `rm -rf /opt/cilk-blah` and then unpacked the SDK into /opt/cilk.

Let me know if there is anything else you might need. Thanks for your help. Much appreciated.

Can you run

ldd ./matrix_multiply

and post the output? I want to make sure that you are not using the 1.0 shared library.

Quoting - Matteo Frigo (Intel)
Can you run

ldd ./matrix_multiply

and post the output? I want to make sure that you are not using the 1.0 shared library.

$ ldd /opt/cilk/examples/matrix_multiply/matrix_multiply
linux-vdso.so.1 => (0x00007fff2379f000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0d7d866000)
libcilkrts.so => /opt/cilk/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.4/../../../../lib64/libcilkrts.so (0x00007f0d7dc6c000)
libstdc++.so.6 => /opt/cilk/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.4/../../../../lib64/libstdc++.so.6 (0x00007f0d7d567000)
libm.so.6 => /lib/libm.so.6 (0x00007f0d7d2e3000)
libgcc_s.so.1 => /opt/cilk/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.4/../../../../lib64/libgcc_s.so.1 (0x00007f0d7d0d6000)
libc.so.6 => /lib/libc.so.6 (0x00007f0d7cd67000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0d7da82000)

Thanks for running ldd. I still cannot understand what's wrong, however.

Can you send me the matrix_multiply executable so that I can try running it? Please send it to
matteo.frigo@intel.com, hoping that it survives our virus scanners :-)

Quoting - Matteo Frigo (Intel)
Thanks for running ldd. I still cannot understand what's wrong, however.

Can you send me the matrix_multiply executable so that I can try running it? Please send it to
matteo.frigo@intel.com, hoping that it survives our virus scanners :-)

It seems to be due to the linker flags. I was using the same CFLAGS/LDFLAGS with a variety of sample Cilk programs, all from the bzip2 example, since that is where I happen to start playing around with Cilk.

CILKLINK=-Wl,-Bstatic -lcilkrts -Wl,-Bdynamic -lpthread

If I do not use those flags, things seem to run fine. Let me know if you still want to the executable, I'll tar it up and put it on a website, as to bypass any email virus checkers.

Quoting - robackja

It seems to be due to the linker flags. I was using the same CFLAGS/LDFLAGS with a variety of sample Cilk programs, all from the bzip2 example, since that is where I happen to start playing around with Cilk.

CILKLINK=-Wl,-Bstatic -lcilkrts -Wl,-Bdynamic -lpthread

If I do not use those flags, things seem to run fine. Let me know if you still want to the executable, I'll tar it up and put it on a website, as to bypass any email virus checkers.

I can reproduce the problem with those flags. I'll look into it. Thanks for your feedback.

Cheers,
Matteo Frigo

Edit: it looks like your LDFLAGS are linking the Cilk++ runtime system twice, once as a static library and once as a dynamic library. I am not sure whether this is your fault or ours, we'll see what we can do. Thanks again.

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!