NVlabs / NVBit

199 stars 18 forks source link

Segmentation fault #47

Closed ksangeet990 closed 2 years ago

ksangeet990 commented 3 years ago

Hi,

Running the instr_count tool with LD_PRELOAD=<path to nvbit tool>,/usr/lib/x86_64-linux-gnu/libstdc++.so.6 <your app> giving segmentation fault.

x-y-z commented 2 years ago

Can you give more detail information? Sorry, I am not able to reproduce it. Also, according to ld.so manpage, LD_PRELOAD accepts a list of objects separated by whitespace or colons. I am not sure the command you gave would work.

ksangeet990 commented 2 years ago

Hi @x-y-z,

Running the instr_count tool on Ubuntu 14.04, experienced the symbol lookup error issue. ./test-apps/vectoradd/vectoradd: symbol lookup error: ./tools/instr_count/instr_count.so: undefined symbol: _ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE. To mitigate the issue, followed steps in https://github.com/NVlabs/NVBit/issues/3 to add libstdc++.so.6 from ubuntu 16.04 but faced with the segmentation fault error. Let me know if you need any more information. PS Command used: LD_PRELOAD=<path to nvbit tool> /usr/lib/x86_64-linux-gnu/libstdc++.so.6 <your app>

x-y-z commented 2 years ago

This method works for me locally. I ran vectoradd in Ubuntu 14.04+CUDA8.0 with instr_count.so compiled with nvcc 11.2 and libstdc++.so.6 copied from Ubuntu 20.04.

Maybe you can try libstdc++.so.6 from Ubuntu 20.04.

ksangeet990 commented 2 years ago

As suggested by you, I ran the tool with libstdc++.so.6 from Ubuntu 20.04 loaded using LD_PRELOAD. Still getting the segmentation fault. Any more suggestions that I could try out?

x-y-z commented 2 years ago

I think you should check your machine's dmesg to see which part of the code causing the segmentation fault.

ksangeet990 commented 2 years ago

It's giving me this, any pointers? instr_count.so[11624]: segfault at 0 ip 00007fb8c24f3361 sp 00007ffca35f6768 error 4 in instr_count.so[7fb8c24de000+e1000]. P.S. Also using nvbit 1.4 release

x-y-z commented 2 years ago

What nvcc version were you using to compile instr_count.so? I used nvcc 11.0 and 11.2 to compile instr_count.so, both worked without any issue.

ksangeet990 commented 2 years ago

I am using nvcc 11.2 to compile both instr_count.so and vectoradd. gcc/g++ version is 5.5.0

ksangeet990 commented 2 years ago

nvm, got it worked. Was invoking with incorrectly formatted LD_PRELOAD. Thank you for the help.