Segmentation Fault (core dumped) error during mt_prep_snap

Dear All,

I have now been stuck for 2 weeks.

I am using SNAP (Windows 10), UBUNTU 16.04, Python 2.7.

I have followed the snap2stamps workflow, with successful export to StaMPS format (

I think the interferograms look OK in SNAP, but I am inexperienced. One thing I have noticed is that the raw data is “flipped”, meaning it is the mirror image. So I have to “unflip” interferograms using the Range-Doppler Terrain Correction tool in SNAP (i.e. before import to QGIS). But I would assume mt_prep_snap would have no problem with flipped input?

Anyway, I am stuck at mt_prep_snap (below screenshot). Your advice is greatly appreciated.


1 Like

The SLC image is provided in zero-Doppler slant-range geometry;


therefore there is no need to unflip your interferograms, by applying Range-Doppler Terrain Correction, because mt prep snap is used these parameters in Slant range,

Take a look at this post Range Doppler Terrain Correction,

Source of the post

Thanks Falah.

However, I am not unflipping my interferograms before mt_snap_prep, so this is not the problem.

This was your case in your first post, that’s why I gave you my previous answer,

As I mentioned before, no needs to this step before or after mt_snap_prep,

In this case are you sure from all your data, are they all in the same orbit, Frame and slice?
Also from your screenshot it seems that you used snap2tamps, Don’t you?

If yes, this mean everything went automatically without checking your results, anyway in case you’re sure from your data,

I suggest to you apply this Script,

Thank you Falah for your response - greatly appreciated.

Please tell me how to confirm same orbit, frame and slice?

To answer your question, Yes I am using snap2stamps, which is successful:

Check up all your SLC image, you could do so, in the same way of selecting master image,

Add all your SLC to the INSAR overview from radar tab Interferometry,

Other issue , in case all in proper form,

What data and how did you export your data from SNAP after applying SNAP2stamps?

Hi Falah,

I followed your advice and used Stack Overview (below - tracks are the same, but I cant see orbit, frame or slice as you suggested). Then I repeated snap2stamps using the recommended master, but I get the same error when I run mt_prep_snap (below):

I was thinking that you have many images that’s why I gave this option,

But anyway since you have only 5 images it’s easy to check up each one from metadata,

Also I asked you before

Accordingly you should have these two highlighted products, and then export to Stamps

Did you add the elevation and Lat\Lon to each interferogram?

The last note 5 images are too low for PSI application,

Thanks Falah.

I only have five images to experiment - I want to get past the Segmentation Fault problem.

As you suggested, I have now checked REL_ORBIT, slice_num and PASS, and they are equal for all my data.

To answer your questions, I use snap2stamps python scripts before mt_prep-snap:

  1. Sort the slave images in separated folders corresponding to their acquisition time.
  2. Slave splitting (and slice assembling if needed) and annotated orbits replacement with Precise/Restituted Orbits.
  3. Coregistration and interferogram generation done per slave and subswath. Both amplitude coregistered master-slave stack and interferogram with elevation and orthorectified latitude and longitude coordinates are saved as output.
  4. StaMPS export is done providing for each pair coregistered stack and interferogram generated StaMPS compatible products.

snap2stamps python scripts: – script for sorting slaves into the expected folder structure – script for slave splitting (and assembling if needed) and orbit correction – script for master-slave coregistration and interferometric generation – script for ouput data generation in StaMPS compatible format for PSI processing

My data before snap2stamps:


My data after snap2stamps:

Thank you again for you assistance!

Happy that you solved your problem, the reason behind my question is , to clarify and try up to put you on the line of solving the issue.

Hi Falah,

Unfortunately I have not solved the problem. In my last post I provided the information you asked for.

The Segmentation Fault occurs when I run mt_prep_snap. Sorry for the confusion.


Sorry for that, but there is an option, could be done, since you have only six images, I think it is easy to apply all the steps manually, to checking up the proper result of each one, and then rerun mt_prep_sanp

I solved the issue by formatting my hard drive and reinstalling LINUX. Thanks again for your assistance.

So happy to hear that :smiley:, it also good to take in the future consideration the effect of LINUX on the processing,

Which LINUX did you install in your machine?

hello, I met a same problem like you ,how can I slove it? Just reinstalling Linux?
thank you

1 Like

The problem is the gcc compiler versión. You must compile stamps with gcc v7

To Installing Multiple GCC Versions follow this link:

then select the gcc-7

“sudo update-alternatives --config gcc” select the correct one

check gcc version (command: gcc -v)
and then install stmaps (go to src and “make” “make install”)

1 Like

@JeroBande is right, the problem is the compiler version. StaMPS has to be compiled with gcc-7 (gcc-9 was installed in my case and used for the compilation of StaMPS which led to incorrectly compiled scripts)

So this is what it solved the problem in my case (partially copied from here). I cannot grant that it will solve all problems, but changing the compiler makes a difference. If you get stuck at one of these steps, please try to continue searching the web, because I have no clue how to troubleshoot most of these steps in case something goes wrong.

Adding ubuntu-toolchain-r/test PPA

sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test

Install several compilers

(we add 7, 8 and 9 so we have a list to chose from)
sudo apt install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9

Configure alternative compilers

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 --slave /usr/bin/gcov gcov /usr/bin/gcov-7

Select preferred compiler

(here we want gcc-7)
sudo update-alternatives --config gcc

this prints this table

There are 3 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path            Priority   Status
* 0            /usr/bin/gcc-9   90        auto mode
  1            /usr/bin/gcc-7   70        manual mode
  2            /usr/bin/gcc-8   80        manual mode
  3            /usr/bin/gcc-9   90        manual mode

Press <enter> to keep the current choice[*], or type selection number:

This means, that gcc-9 is used to compile code unless another is selected. To confirm that we want to use gcc-7 for the compilation of StaMPS, type


and hit Enter

Now, without closing the command shell, nagivate to the StaMPS directory and inside the src folder
and then
make install

This will compile all scripts required for PS processing. It should look like this

Now, the Segmentation fault (core dumped) error will no longer occur when you run mt_prep_snap again. I recommend to run this command in an empty folder (not the same as the INSAR folder exported by SNAP and also using the tcsh instead of the standard command line. Also, don’t forget to modify and source StaMPS_config.tcsh before you can run all scripts.


Dear all,
thank you very much for the solution you find for the problem of segmentation Fault(core dumped). I solved the problem with the installation of gcc-7. Thank you again

Happy to hear that.

Hi @ABraun,
same problem here and your solution has been perfect for me too.
Thank you always for your help and advice.

S. Savastano