Segmentation Fault (core dumped) error during mt_prep_snap

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:

slaves_prep.py – script for sorting slaves into the expected folder structure
splitting_slaves_logging.py – script for slave splitting (and assembling if needed) and orbit correction
coreg_ifg_topsar.py – script for master-slave coregistration and interferometric generation
stamps_export.py – script for ouput data generation in StaMPS compatible format for PSI processing

My data before snap2stamps:
Master:
S1B_IW_SLC__1SDV_20180610T070627_20180610T070654_011307_014C2F_4E9C.zip

Slaves:
S1B_IW_SLC__1SDV_20180105T070624_20180105T070652_009032_01023E_622A.zip
S1B_IW_SLC__1SDV_20180306T070623_20180306T070650_009907_011F06_ABCE.zip
S1B_IW_SLC__1SDV_20180902T070631_20180902T070659_012532_0171ED_5143.zip
S1B_IW_SLC__1SDV_20181207T070632_20181207T070700_013932_019D90_36B2.zip

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.

Mark

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:

https://linuxize.com/post/how-to-install-gcc-compiler-on-ubuntu-18-04/

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

1

and hit Enter

Now, without closing the command shell, nagivate to the StaMPS directory and inside the src folder
type
make
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.

11 Likes

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

@ABraun Your solution has been perfect.
Thanks for your help!

Very nice solution.

worked like a charm. thanks

1 Like

It doesn’t work for Ubuntu 20.1

It will work, but Ubuntu 18.04 is very comfortable (as per my suggestion) compared to Ubuntu20.1. And one more advantage of Ubuntu 18.04 is, it will come python2 as a default (snap2stamps code will run only on python2).

It would be helpful to tell us the actual error. Please review the
this thread to see if your issue is covered:

Snap2stamps error - s1tbx / StaMPS - STEP Forum (esa.int)

The problem is installing gcc-7. I did not be able to run StaMPS because I get “Segmentation Fault”. I tried to install multiple gcc compiler, but the older one available for Ubuntu 21.1 is gcc-8.

I’m going to reinstall ubuntu 20.04, I successfully installed multiple gcc compilers on it.