GNU Astronomy Utilities - Bugs: bug #49347, Invalid writes and reads in Table
You are not allowed to post comments on this tracker with your current authentication level.
bug #49347: Invalid writes and reads in Table
Submitter: | Mohammad Akhlaghi <makhlaghi> | ||
Submitted: | Sat 15 Oct 2016 12:59:05 AM UTC | ||
Category: | Table | Severity: | 4 - Important |
Item Group: | Crash | Status: | Fixed |
Privacy: | Public | Assigned to: | makhlaghi |
Open/Closed: | Closed |
Fri 21 Oct 2016 09:09:40 PM UTC, comment #2: |
Mohammad Akhlaghi <makhlaghi> |
Sun 16 Oct 2016 01:19:15 AM UTC, comment #1: As for
it seems that the trouble is in
gal_txtarray_txt_to_array allocates memory for it, but freeandreport does not do cleanup for the structure field txtarray |
Vladimir Markelov <vvm> |
Sat 15 Oct 2016 12:59:05 AM UTC, original submission:
After inspecting the output of the GNU Hydra for Gnuastro 0.2, it was interesting to see issues errors on 32-bit systems.
|
Mohammad Akhlaghi <makhlaghi> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 3 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2016-10-21 | makhlaghi | Status | Confirmed | Fixed | |
Assigned to | None | makhlaghi | |||
Open/Closed | Open | Closed |
Powered by Savane 3.13-d3ae.
Corresponding source code
I had a closer look and found the source of the problem, it is now fixed and has been pushed to the main repository. From the commit message:
The `data' element of Table's `outcolumn' structure (in `bin/table/main.h') has a `void *' type to allow various types. However, to allocate space for the output column we were using the `sizeof' operator on it! This would give a size of 1 and would cause a crash some systems.
In the previous commit (5c41564: New function to return the size of FITS datatype), a new function was added to the Gnuastro FITS functions to return the number of bytes in each datatype. With that function, the datatype's size is now also stored in the `outcolumn' structure and the allocation is done based on that.