centreborelli / s2p

Satellite Stereo Pipeline
GNU Affero General Public License v3.0
199 stars 67 forks source link

stack smashing detected ***: mgm terminated #61

Closed MiladGhorbaniG closed 4 years ago

MiladGhorbaniG commented 4 years ago

Hi, I installed s2p on ubuntu 16.04 python 3.5 gdal 2.2.2 and made sure that the dependencies are installed by running apt-get install build-essential cmake gdal-bin geographiclib-tools libgeographic-dev libfftw3-dev libgdal-dev libgeotiff-dev libtiff5-dev python python-numpy python-pip

Reading package lists... Done Building dependency tree
Reading state information... Done build-essential is already the newest version (12.1ubuntu2). libfftw3-dev is already the newest version (3.3.4-2ubuntu1). python-numpy is already the newest version (1:1.11.0-1ubuntu1). geographiclib-tools is already the newest version (1.45-2). libgeographic-dev is already the newest version (1.45-2). libgeotiff-dev is already the newest version (1.4.1-2). cmake is already the newest version (3.5.1-1ubuntu3). libtiff5-dev is already the newest version (4.0.6-1ubuntu0.7). python-pip is already the newest version (8.1.1-2ubuntu0.4). gdal-bin is already the newest version (2.2.2+dfsg-1 xenial1). python is already the newest version (2.7.12-1 16.04). libgdal-dev is already the newest version (2.2.2+dfsg-1~xenial1). 0 to upgrade, 0 to newly install, 0 to remove and 14 not to upgrade.

When I ran the example in the description s2p tests/data/input_pair/config.json, I faced the below error:

sudo s2p tests/data/input_pair/config.json WARNING: out_dir is a relative path. It is interpreted with respect to tests/data/input_pair/config.json location (not cwd) out_dir is: /home/miladg/projects/Stereo_Satellite_Disparity/Geo-Alberta, Canada/s2p/tests/data/input_pair/../../testoutput/output_pair /usr/local/lib/python3.5/dist-packages/pyproj/crs/crs.py:53: FutureWarning: '+init=' syntax is deprecated. '' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 return _prepare_from_string(" ".join(pjargs)) /usr/local/lib/python3.5/dist-packages/pyproj/crs/crs.py:294: FutureWarning: '+init=' syntax is deprecated. '' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 projstring = _prepare_from_string(" ".join((projstring, projkwargs))) /usr/local/lib/python3.5/dist-packages/pyproj/crs/crs.py:53: FutureWarning: '+init=' syntax is deprecated. '' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 return _prepare_from_string(" ".join(pjargs)) /usr/local/lib/python3.5/dist-packages/pyproj/crs/crs.py:294: FutureWarning: '+init=' syntax is deprecated. '' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 projstring = _prepare_from_string(" ".join((projstring, projkwargs))) /usr/local/lib/python3.5/dist-packages/pyproj/crs/crs.py:53: FutureWarning: '+init=' syntax is deprecated. '' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 return _prepare_from_string(" ".join(pjargs)) /usr/local/lib/python3.5/dist-packages/pyproj/crs/crs.py:294: FutureWarning: '+init=' syntax is deprecated. '' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 projstring = _prepare_from_string(" ".join((projstring, projkwargs))) /usr/local/lib/python3.5/dist-packages/pyproj/crs/crs.py:53: FutureWarning: '+init=' syntax is deprecated. '' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 return _prepare_from_string(" ".join(pjargs)) /usr/local/lib/python3.5/dist-packages/pyproj/crs/crs.py:294: FutureWarning: '+init=' syntax is deprecated. '' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 projstring = _prepare_from_string(" ".join((projstring, projkwargs))) tile size: 350 350 total number of tiles: 4 (2 x 2)

discarding masked tiles... done 4 / 4 tiles Elapsed time: 0:00:00.288161

correcting pointing locally... done 4 / 4 tiles Elapsed time: 0:00:03.675108

correcting pointing globally... Elapsed time: 0:00:00.004381

rectifying tiles... done 4 / 4 tiles Elapsed time: 0:00:00.433799

running stereo matching... stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.5/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, *kwds)) File "/usr/local/lib/python3.5/dist-packages/s2p/parallel.py", line 43, in tilewise_wrapper out = fun(args) File "/usr/local/lib/python3.5/dist-packages/s2p/init.py", line 205, in stereo_matching disp_max) File "/usr/local/lib/python3.5/dist-packages/s2p/block_matching.py", line 182, in compute_disparity_map timeout=timeout, File "/usr/local/lib/python3.5/dist-packages/s2p/common.py", line 93, in run env=env, timeout=timeout, check=True) File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['mgm', '-r', '-16', '-R', '13', '-s', 'vfit', '-t', 'census', '-O', '8', '-confidence_consensusL', '/home/miladg/projects/Stereo_Satellite_Disparity/Geo-Alberta,', 'Canada/s2p/tests/data/input_pair/../../testoutput/output_pair/tiles/row_0000150_height_350/col_0000150_width_350/pair_1/rectified_disp_confidence.tif', '/home/miladg/projects/Stereo_Satellite_Disparity/Geo-Alberta,', 'Canada/s2p/tests/data/input_pair/../../testoutput/output_pair/tiles/row_0000150_height_350/col_0000150_width_350/pair_1/rectified_ref.tif', '/home/miladg/projects/Stereo_Satellite_Disparity/Geo-Alberta,', 'Canada/s2p/tests/data/input_pair/../../testoutput/output_pair/tiles/row_0000150_height_350/col_0000150_width_350/pair_1/rectified_sec.tif', '/home/miladg/projects/Stereo_Satellite_Disparity/Geo-Alberta,', 'Canada/s2p/tests/data/input_pair/../../testoutput/output_pair/tiles/row_0000150_height_350/col_0000150_width_350/pair_1/rectified_disp.tif']' returned non-zero exit status -6 """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/bin/s2p", line 8, in sys.exit(main()) File "/usr/local/lib/python3.5/dist-packages/s2p/cli.py", line 22, in main s2p.main(user_cfg) File "/usr/local/lib/python3.5/dist-packages/s2p/init.py", line 607, in main parallel.launch_calls(stereo_matching, tiles_pairs, nb_workers) File "/usr/local/lib/python3.5/dist-packages/s2p/parallel.py", line 100, in launch_calls outputs.append(r.get(600)) # wait at most 10 min per call File "/usr/lib/python3.5/multiprocessing/pool.py", line 608, in get raise self._value subprocess.CalledProcessError: Command '['mgm', '-r', '-16', '-R', '13', '-s', 'vfit', '-t', 'census', '-O', '8', '-confidence_consensusL', '/home/miladg/projects/Stereo_Satellite_Disparity/Geo-Alberta,', 'Canada/s2p/tests/data/input_pair/../../testoutput/output_pair/tiles/row_0000150_height_350/col_0000150_width_350/pair_1/rectified_disp_confidence.tif', '/home/miladg/projects/Stereo_Satellite_Disparity/Geo-Alberta,', 'Canada/s2p/tests/data/input_pair/../../testoutput/output_pair/tiles/row_0000150_height_350/col_0000150_width_350/pair_1/rectified_ref.tif', '/home/miladg/projects/Stereo_Satellite_Disparity/Geo-Alberta,', 'Canada/s2p/tests/data/input_pair/../../testoutput/output_pair/tiles/row_0000150_height_350/col_0000150_width_350/pair_1/rectified_sec.tif', '/home/miladg/projects/Stereo_Satellite_Disparity/Geo-Alberta,', 'Canada/s2p/tests/data/input_pair/../../testoutput/output_pair/tiles/row_0000150_height_350/col_0000150_width_350/pair_1/rectified_disp.tif']' returned non-zero exit status -6

and when I ran make test and this is the ensuing log

collected 30 items

tests/block_matching_test.py F. [ 6%] tests/common_test.py ... [ 16%] tests/end2end_test.py stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated F stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated F stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated F stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated stack smashing detected : mgm terminated F [ 30%] tests/estimation_test.py . [ 33%] tests/evaluation_test.py .. [ 40%] tests/initialization_test.py EEEE [ 53%] tests/parallel_test.py . [ 56%] tests/rasterization_test.py . [ 60%] tests/rectification_test.py .... [ 73%] tests/rpc_utils_test.py .. [ 80%] tests/sift_test.py ... [ 90%] tests/triangulation_test.py ... [100%]

==================================== ERRORS ==================================== ____ ERROR at setup of test_norpc ____

===================================================== short test summary info ===================================================== FAILED tests/block_matching_test.py::test_compute_disparity_map_timeout - subprocess.CalledProcessError: Command '['mgm_multi', ... FAILED tests/end2end_test.py::test_end2end_pair - subprocess.CalledProcessError: Command '['mgm', '-r', '-16', '-R', '13', '-s',... FAILED tests/end2end_test.py::test_end2end_triplet - subprocess.CalledProcessError: Command '['mgm', '-r', '-29', '-R', '33', '-... FAILED tests/end2end_test.py::test_end2end_mosaic - subprocess.CalledProcessError: Command '['mgm', '-r', '-29', '-R', '33', '-s... FAILED tests/end2end_test.py::test_distributed_plyflatten - subprocess.CalledProcessError: Command '['mgm', '-r', '-29', '-R', '... ERROR tests/initialization_test.py::test_no_rpc - TypeError: argument should be string, bytes or integer, not PosixPath ERROR tests/initialization_test.py::test_rpc_path - TypeError: argument should be string, bytes or integer, not PosixPath ERROR tests/initialization_test.py::test_rpc_dict - TypeError: argument should be string, bytes or integer, not PosixPath ERROR tests/initialization_test.py::test_roi_geojson - TypeError: argument should be string, bytes or integer, not PosixPath ============================================= 5 failed, 21 passed, 4 errors in 44.12s ============================================= makefile:19: recipe for target 'test' failed make: *** [test] Error 1

I appreciate your help.

carlodef commented 4 years ago

Hi @MiladGhorbaniG,

Your issue seems to happen when running mgm.

Could you please try to clone and install mgm separately, and run the example calls shown in its readme?

gfacciol commented 4 years ago

I just ran the installation and the tests on a pristine installation using ubuntu 16.04 and it worked. The attached Dockerfile runs the whole thing. Are you using some strange compiler ?

On Sun, Aug 30, 2020 at 10:59 PM MiladGhorbaniG notifications@github.com wrote:

I found a related discussion here https://stackoverflow.com/a/1347464. It seems flag -fno-stack-protector when compiling with gcc may solve it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cmla/s2p/issues/61#issuecomment-683469899, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGFI2UXDCDZTHZLBPJNOTTSDK4THANCNFSM4QPZNGRA .

MiladGhorbaniG commented 4 years ago

Hi @MiladGhorbaniG,

Your issue seems to happen when running mgm.

Could you please try to clone and install mgm separately, and run the example calls shown in its readme?

Hi, @carlodef , Unfortunately, I can't test this because I had to uninstall ubuntu. It became crazy and I couldn't log in.

I just ran the installation and the tests on a pristine installation using ubuntu 16.04 and it worked. The attached Dockerfile runs the whole thing. Are you using some strange compiler ? On Sun, Aug 30, 2020 at 10:59 PM MiladGhorbaniG @.***> wrote: I found a related discussion here https://stackoverflow.com/a/1347464. It seems flag -fno-stack-protector when compiling with gcc may solve it. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#61 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGFI2UXDCDZTHZLBPJNOTTSDK4THANCNFSM4QPZNGRA .

Hi @gfacciol, When the ubuntu was alive, I tested with gcc 6.0.0 and gcc 4.4.6. Non of these could fix the error.

gfacciol commented 4 years ago

Hi @MiladGhorbaniG, I think that it was some sort of compiler/library issue. In my experience, MGM works fine with gcc 4.4.6 (I just tested), however gcc 6.0.0 is listed as stable. There may have been some library mix-up. So, I propose to close the issue and reopen it if the problem re-appears.