LCModel installation - segmentation fault

Dear all,

I am new with LCModel and currently trying to get it installed in order to quantify my cardiac MR spectra. I am using Ubuntu 20.04. The test run doesn’t make any problems but if I want to process my own data I get this runtime message after selecting the water reference:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
Segmentation fault (core dumped)

The preview of the data in the GUI works properly.

I already tried to reinstall it, to change the permissions of the folders I am working in, to change the folders in which I want to save/load the data and many more things. The parameters with which I want to process the data should be fine since the same options worked at the computer of our institute where LCModel is already installed (centOS 5).

Does anybody of you have an idea what could be the reason for this error and what I could do to get it run?

Many thanks in advance!

Best

Fabian

Hi Fabian,

Do I read correctly that this error occurs when you’re selecting the water reference in the GUI dialogue? Have you tried running the analysis from the command line (i.e. not through the GUI)? (Try building the control file from one of the control files created on the centOS 5 computer, just adjust the lines that point to filenames).

Best,
Georg

Hi Georg,

thanks for your quick response!

Not exactely, I can select a water reference and after I press ‘ok’ the error is displayed in the bash, it says “LCModel elapsed time = 0 seconds” and evince opens with an error that the .ps cannot be opened which is clear since no file could be created. I hope this makes it clearer where the error happens.

I tried to do so but I am not quite sure which path is needed for the .raw and .ps files since they refer to the temp folder which I guess is created automatically using the GUI. I took the centOS5 control file and exchanged the paths to get this control file:

$LCMODL
title= ‘Soleus’
srcraw= ‘/home/fabian/Dokumente/Files/spectro_MC_04_05_WIP_SV_sLASER_35_10_2_raw_act.SDAT’
srch2o= ‘/home/fabian/Dokumente/Files/spectro_MC_04_05_WIP_SV_sLASER_35_10_2_raw_ref.SDAT’
sptype= ‘muscle-5’
savdir= ‘home/fabian/Dokumente/Files/saved/’
ppmst= 3.8
ppmend= -1.0
nunfil= 1024
ltable= 7
lps= 8
lprint= 6
lcsv= 11
lcoraw= 10
lcoord= 9
hzpppm= 1.2774e+02
filtab= ‘/home/fabian/.lcmodel/temp/06d-21h-53m-00s-0000pid/table’
filraw= ‘/home/fabian/.lcmodel/temp/06d-21h-53m-00s-0000pid/met/RAW’
filps= ‘/home/fabian/.lcmodel/temp/06d-21h-53m-00s-0000pid/ps’
filpri= ‘/home/fabian/.lcmodel/temp/06d-21h-53m-00s-0000pid/print’
filh2o= ‘/home/fabian/.lcmodel/temp/06d-21h-53m-00s-0000pid/h2o/RAW’
filcsv= ‘/home/fabian/.lcmodel/temp/06d-21h-53m-00s-0000pid/spreadsheet.csv’
filcor= ‘/home/fabian/.lcmodel/temp/06d-21h-53m-00s-0000pid/coraw’
filcoo= ‘/home/fabian/.lcmodel/temp/06d-21h-53m-00s-0000pid/coord’
filbas= ‘/home/fabian/.lcmodel/test/output/test.basis’
echot= 42.00
dows= T
deltat= 5.000e-04
lcsi_sav_1 = 12, filcsi_sav_1 = ‘/home/fabian/.lcmodel/temp/06d-21h-50m-00s-0000pid/filcsi_sav_1’, lcsi_sav_2 = 13, filcsi_sav_2 = ‘/home/fabian/.lcmodel/temp/06d-21h-53m-00s-0000pid/filcsi_sav_2’
$END

With this control file I get the following error, which is probably a result of my wrong raw/ps path to the temp folder:

 FATAL ERROR  ZEROVX  3.   (Check LCModel Manual).  ************************************************************************

 FATAL ERROR  MAKEPS  2.   (Check LCModel Manual).  ************************************************************************

*** FATAL ERROR MAKEPS 2
This error occurred before the plot could be produced.
See the Diagnostics list in the LCModel Manual. ***
*** FATAL ERROR MAKEPS 2
This error occurred before the plot could be produced.
See the Diagnostics list in the LCModel Manual. ***

Adjusting the paths with an already created temp-folder from a try using the GUI, leads to the following error message:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
*** Error in `/home/fabian/.lcmodel/bin/lcmodel’: malloc(): memory corruption: 0x0000000016c42f60 ***

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
Speicherzugriffsfehler (Speicherabzug geschrieben)

Best
Fabian

Hi Fabian,

What are your machine specifications otherwise? Are you trying to use the pre-compiled LCModel binary from the website, or did you compile your own? @martin figured out the initial compile on Ubuntu 20.04 as well (scroll down this thread for a few updates on the instructions).

Best,
Georg

Hi Georg,

many thanks for your effort! I am using Ubuntu 20.04, gcc version 9.3.0, as VM (Virtualbox) with 4GB RAM on a Windows 10 computer with a i7 4770k. However, the same error message appears on a computer with Ubuntu 20.04 (no VM).

I tried both versions and got still the same message, but I think I now know where the error comes from. I used the test data @martin provided there and they worked. I found out that the paths of filraw and filh2o to the temp folder causes the problems. If I replace the paths to a different location I generated and renamed the .raw files of my .SDAT data, LCModel (both, the pre-compiled version and compiled version from @martin) works properly and prints out a nice fitting result. Do you have any idea how to fix this such that the GUI can be used again?

Many thanks in advance!
Best
Fabian

1 Like

Hi Fabian,

Your response must have slipped through my cracks, my apologies. Is there a particular reason you are looking to use the GUI? I personally don’t find it particularly useful for anything, really. It’s merely a wrapper to generate a control file, and you can do that much easier (IMO) programmatically - plus, you can run batch analyses pretty effortlessly once you figure out the control file structure.

Until then, I’m afraid that Provencher has explicitly said that the GUI source code won’t be made available (as the other satellite programs like makebasis; fortunately we have already figured out how to write basis set files, so we don’t need that any more).

Let me know if there is more I can help with,
Georg

Hi Fabian,

I am also new to LCModel, and I was reading your issue. Thanks for sharing.

Maybe you have checked this already, but if not, it is worth to check the user you used for the installation. If the root user was used to install GUI, that might cause issues with writing permissions for running GUI on another user.

Best,
Ipek.

2 Likes

Hi Georg,
seems that now it was the other way round, sorry… No, there is no specific reason for using the GUI but I need the GUI to convert my .sdat files to raw files and those can then be processed with my control files which works properly. I could, for sure, bring my data in the format that the raw files have but I don’t know whether LCModel does Phase correction and those steps “after the raw-data creation” or in the steps after creation of the raw files. Do you know that?

Thanks for your help!
Best regards
Fabian

Hi Ipek,

thanks for your comment, I will give it a try!

Best
Fabian

The conversion in LCModel happens before any data analysis takes place. I’d always recommend doing some processing outside LCModel, e.g. alignment of individual transients, removal of corrupted ones etc to increase data quality. You can find a bunch of useful software packages to do that - we have the Osprey software (based on FID-A) with some pre-defined analysis pathways; there are are also FSL-MRS, spant, Vespa, jMRUI and others.

1 Like

Thank you for this valuable information!

Hi fbsch,
I am new user of LCmodel and also had this problem when use lcmgui. I have changed the filps and filraw , but it had a new problem for (cp: cannot stat ‘*ps’: No such file or directory
cp: cannot stat ‘*table’: No such file or directory ). I hope you can help me,many thanks!

Best regards,
Liwei Zou (lwzou_2010@foxmail.com)

Hi Liwei,

I had this problem, that you mentioned, in the process of finding a workaround as well. I guess both issues are due to wrong access authorization of the memory.
I would rather recommend (as also Georg did) using batch-scripts instead of the GUI. What helped me was using the test data provided by martin (Building LCModel - #2 by admin) to get used to the syntax of the control file.

I hope that you can fix your problems with this!

Best
Fabian

Hi @lwzou ,

I’m not sure at exactly what stage you’re seeing those error messages; is this after choosing “Run LCModel”? My guess is that perhaps the output folder you have specified does not exist, so LCModel can not write/check for its output (assuming it’s running at all). Can you confirm that the folder specified in filps actually exists (eg, from a command window: ls -d /home/d1/user/zlw/MRS_test/LIUJIE/LCModel/liuj )

Otherwise, I second @fbsch and @admin 's suggestions…

Alex.

Hi alex,
Thank you for you response, I have sure that the fold is exist (/home/d1/user/zlw/MRS_test/LIUJIE/LCModel/liuj), the error shows that it could not generate the result *PS in this fold.

  1. Do you see any other files being generated anywhere, for example in the LCModel home folder or your target output folder?
  2. If not, are you absolutely certain you have read/write access to your target output folder?
  3. When using filps, try adding the line lps=8 (no apostrophes around the 8, it’s not a string), and when you use filtab, add ltable = 7. I don’t think this is it, but kind of last resort.
  4. As stated above, I would highly, highly, highly recommend skipping LCMgui and generate your control files procedurally.
  5. I would also highly recommend NOT to use the basis sets that come with LCModel (or the ones that are shared on the LCModel website). These are generic. See the data collection for better alternatives, e.g. the ones by Karl Landheer.

Cheers,
Georg