S4 icon indicating copy to clipboard operation
S4 copied to clipboard

2d examples execution fail due to segmentation fault

Open Neoarroway opened this issue 5 years ago • 5 comments

The 1D examples work well, however, when I tried to run the 2d examples , most of them fail due to segmentation fault( core dumped). I used a Ubuntu 16.04 VM. The following is the error message

~/src/examples/2d/Tikhodeev_PRB_66_45102_2002$ /home/neoarroway/src/build/S4 fig4.lua >output_fig4.txt Segmentation fault (core dumped)

Most forums suggest the problem comes from pointer, which I assume in the cpp file. However, as the bottom layer code, the cpp must already been stable. Where does this problem come from? VM, inappropriate compilation? how should I debug?

Neoarroway avatar Jul 31 '18 03:07 Neoarroway

Same here - tried running: S4/examples/2d/Li_JOSA_14_2758_1997. All example in the directory fail after the first iteration except ex3.lua which exits successfully.

Run on Ubuntu 16.04. Attached is the compilation output for info. compilation_output.txt

Trave11er avatar Aug 24 '18 14:08 Trave11er

Hi, Same problem here compiling on Arch Linux. The problem appears to be caused when the Clone method is called in that script.

I compiled with debug and run GDB on the problem file. Looks like there is a problem deallocating the memory after Clone().

Starting program: /home/jl/Gits/s4-git/src/S4/build/S4 ../examples/2d/Tikhodeev_PRB_66_45102_2002/fig4.lua
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
Simulation_DestroyLayerModes (layer=0x555555613590) at S4/S4.cpp:952
952			if(NULL != layer->modes->q){ S4_free(layer->modes->q); }

jtambasco avatar Sep 25 '18 03:09 jtambasco

I also have this error. I compiled on 64bit RedHat EL6 using gcc 4.4.7 with openmpi 1.10 using both gcc and mpicc. It only happens when S4.SolveInParallel is called, I believe. I agree with above that it is from freeing memory, as once I got a glibc error that attempting to free memory referenced an invalid pointer.

nelsongt avatar Oct 04 '18 22:10 nelsongt

I also have this error. I compiled on 64bit RedHat EL6 using gcc 4.4.7 with openmpi 1.10 using both gcc and mpicc. It only happens when S4.SolveInParallel is called, I believe. I agree with above that it is from freeing memory, as once I got a glibc error that attempting to free memory referenced an invalid pointer.

Hi, nelsongt! Not only did I get a 'Segmentation fault (core dumped)' error during my use of S4, but another problem kept bugging me. I have installed mpi in the system, but when I run MPI_examples, mpi does not work. Do I need to do some extra operations when compiling after installing mpi? Have you saved the two problems? I really need your help. I'm looking forward to your reply!!!

WangL3i avatar Apr 06 '22 08:04 WangL3i

I have not used this software in years, I cannot remember anymore.

I suggest looking for the answer at this more active fork: https://github.com/phoebe-p/S4 and also explore her RayFlare software that integrates S4

nelsongt avatar Apr 07 '22 21:04 nelsongt