Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when converting data #5

Open
QQRider opened this issue Sep 9, 2016 · 9 comments
Open

Problem when converting data #5

QQRider opened this issue Sep 9, 2016 · 9 comments

Comments

@QQRider
Copy link

QQRider commented Sep 9, 2016

Dear Michael and Philips users

I have a problem when converting a set of 2D radial raw data from Philips scanner. The command I used is

philips_to_ismrmrd -f aa -x ./IsmrmrdPhilips.xsl -o radial2d.h5

And the error says

Segmentation fault (core dumped)

I'm wondering if you could help take a look at this. The raw data files are attached in the google group thread.

If you need more data, please let me know.

Best Regards!
Yishi

@hansenms
Copy link
Member

hansenms commented Sep 9, 2016

@welcheb is this something you might want to take a look at?

@hansenms
Copy link
Member

hansenms commented Sep 9, 2016

@QQRider What debugging did you do so far? Did you run it in a debugger and figure out which line is causing the segfault?

@QQRider
Copy link
Author

QQRider commented Sep 9, 2016

I didn't run it in a debugger. Actually I don't know how to do it under Linux.

@hansenms
Copy link
Member

hansenms commented Sep 9, 2016

You compile the converter with debug symbols:

cd philips_to_ismrmrd
mkdir build_debug
cd build_debug
cmake -DCMAKE_BUILD_TYPE=Debug ../
make 
make install

Then you run it in the debugger:

gdb philips_to_ismrmrd
run -f aa -x ./IsmrmrdPhilips.xsl -o radial2d.h5

When it fails, you get the back trace in the debugger by typing bt

I would recommend reading a tutorial on debugging with gdb. There are many. Here is one.

@QQRider
Copy link
Author

QQRider commented Sep 9, 2016

Thanks Michael, so the message looks like this

Starting program: /usr/local/bin/philips_to_ismrmrd -f aa -x ./IsmrmrdPhilips.xsl -o radial2d.h5
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'

Program received signal SIGSEGV, Segmentation fault.
0x0000000000435a36 in main (argc=7, argv=0x7fffffffdda8)
    at /home/optimus/Downloads/philips_to_ismrmrd/main.cpp:549
549           dptr[c*nsamp + s] = std::complex<float>(converted[(c*nsamp + s)*2],converted[(c*nsamp + s)*2 + 1]) * correction_factor;

@hansenms
Copy link
Member

hansenms commented Sep 9, 2016

So now you have to do some debugging. You have the exact line number where it goes wrong. It is probably trying to index beyond the bounds of that converted array, but I would put some debug statements in there (or use the debugger) to try to figure out why. Welcome to debugging.

@QQRider
Copy link
Author

QQRider commented Sep 9, 2016

Thanks, glad to be on board.

@hansenms
Copy link
Member

hansenms commented Sep 9, 2016

@QQRider let me know what you find out. The radial data is probably some special case that we have not tested. The first thing I would test is if the array converted has the same number of elements as the ISMRMRD Acquisition that you are trying to fill.

@melrobin
Copy link

Looking back at this old issue it appears that dptr is out of bounds for some reason. The problem is in trying to assign dptr[45696] when the last accessible element is dptr[45695] which has a value of 0+j. For this part of the code c=0 and s=45696. nsamp=80000. Next steps would be to figure out how large this array is by looking at how it is allocated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants