bugGNU Astronomy Utilities - Bugs: bug #45380, ImageCrop crashes with long input...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #45380: ImageCrop crashes with long input file names

Submitted by:  Mohammad Akhlaghi <makhlaghi>
Submitted on:  Tue 23 Jun 2015 06:12:03 AM UTC  
 
Category: CropSeverity: 4 - Important
Item Group: CrashStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Fri 05 Aug 2016 10:46:04 PM UTC, comment #9:

Great, thanks a lot, it is pushed to master.

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Fri 05 Aug 2016 10:21:17 PM UTC, comment #8:

Please have a look at my "revert" branch on gitlab: https://gitlab.com/mose/gnuastro/commits/revert In particular the commit https://gitlab.com/mose/gnuastro/commit/36f3378db9a19ba50167e75cf88df8cb06239f5a

I verified that compilation runs smoothly, all tests are passed and the command reported here and in bug #46241 doesn't cause the program to crash.

Mosè Giordano <giordano>
Project Member
Fri 05 Aug 2016 12:10:36 AM UTC, comment #7:

Your right, thanks ;-).

Will you do it? If you are busy I am happy to revert those changes and check it.

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Thu 04 Aug 2016 11:39:15 PM UTC, comment #6:

I guess that the workaround introduced with

* 2beb197 (2015-10-18) Call manually the cropping functions in imgcrop

can now be reverted.

Mosè Giordano <giordano>
Project Member
Wed 03 Aug 2016 11:55:47 PM UTC, comment #5:

This bug was fixed along with bug #46241. Please see the discussions there for the solution.

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Sat 17 Oct 2015 10:57:29 PM UTC, comment #4:

A possible way to workaround this bug could be not to define modefunction pointer and call the functions "by hand", i.e. for the single thread case something like

but I didn't test this solution thoroughly. I agree it's less elegant than the current implementation, but at least should avoid the crash.

Mosè Giordano <giordano>
Project Member
Sat 17 Oct 2015 04:00:18 PM UTC, comment #3:

Ok, thank you, now I can reproduce it. In particular, I can reproduce when compiling with -O2 and -O3, but not with -O1.

There is a problem with "p->cp.nolog": trying to printf its value before

line works flawless, right after that line the program crashes signaling a bus error.

In addition, in a gdb session executing

before the mentioned line returns correctly 0, but after that line I get

which is the cause of the program crashing with bus error.

Mosè Giordano <giordano>
Project Member
Sat 17 Oct 2015 07:12:17 AM UTC, comment #2:

The problem is only on the output file name (sorry for forgetting to mention it). Running this command from the top Gnuastro directory will reproduce the problem:

./src/imgcrop/astimgcrop --xc=50 --yc=50 ./tests/1_imgcat.fits --output=qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890.fits

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Fri 16 Oct 2015 02:25:35 PM UTC, comment #1:

I can't reproduce this bug, but maybe I'm missing something. This is what I tried:

and astimgcrop didn't crash.

Mosè Giordano <giordano>
Project Member
Tue 23 Jun 2015 06:12:03 AM UTC, original submission:

When compiled with optimization flags, if the file names are longer than 50 to 50 characters, then for some reason, ImageCrop gives a segmentation fault on p->cp.dontdelete!

p->cp.dontdelete can be read and changed (accessed) within the cropping function (tested here in the image mode), but as soon as control comes to the main imgcrop function (prior to going into the printlog function) it is not accessible any more and trying to read or write to it causes a segmentation fault.

Mohammad Akhlaghi <makhlaghi>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by giordano (Posted a comment)
  • -unavailable- added by makhlaghi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 03 Aug 2016 11:55:47 PM UTCmakhlaghiStatusPostponed=>Fixed
      Open/ClosedOpen=>Closed
    Thu 15 Oct 2015 05:53:51 AM UTCmakhlaghiAssigned tomakhlaghi=>None

    Back to the top


    Powered by Savane 3.1-cleanup1