bugGNU Astronomy Utilities - Bugs: bug #66090, Library: endless loop in...

 
 

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

bug #66090: Library: endless loop in gal_data_copy if size=0

Submitter:  Giacomo Lorenzetti <glorenzetti>
Submitted:  Wed 14 Aug 2024 06:56:44 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Crash
Status:  In Progress Privacy:  Public
Assigned to:  glorenzetti Open/Closed:  Open

Discussion

Wed 14 Aug 2024 06:57:26 PM UTC, comment #1: 

A solution may be to check if size is 0 when copying, and in that case set the output array to NULL: https://gitlab.ce ... be5c84567bf4ff970

Another solution, cleaner in my opinion, is to set the array to NULL when size is 0 right inside gal_data_initialize, avoiding as much as possible to have non-NULL empty arrays around: https://gitlab.ce ... 039412b9d0b1ffe55

Giacomo Lorenzetti <glorenzetti>
Group Member
Wed 14 Aug 2024 06:56:44 PM UTC, original submission:  

In the case of an empty non-NULL array in the input struct (say, an array allocated with `malloc(size * sizeof(int))`, where `size` is a variable computed elsewhere that may be zero; note also that the behaviour of `malloc(0)` is implementation defined!) the program is stuck.

Giacomo Lorenzetti <glorenzetti>
Group Member

 

Attached Files

This item currently has no attached files.

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by glorenzetti (Submitted the item)
  •  

    Votes

    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.

     

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code