mainThe GNU Bourne-Again SHell - Support: sr #109328, segfault if function is too long

 
 

sr #109328: segfault if function is too long

Submitter:  None
Submitted:  Fri 09 Jun 2017 11:00:37 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Invalid
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 14 Jun 2017 02:28:06 PM UTC, comment #1: 

This is a resource limit problem. If you exceed the heap size (or stack size, if they grow towards each other) limit, malloc is going to fail.

Chet Ramey <chet>
Group administrator
Fri 09 Jun 2017 11:00:37 PM UTC, original submission:  

GNU bash, version 4.4.12(1)-release (x86_64-unknown-linux-gnu).

If function has more than about 32 000 discrete commands then it segfaults with malloc error.

Simple example at https://pastebin.com/2C4h4nPU

This might seem an irrelevant bug (who writes 32 000 line functions anyway?) but can cause problems with autogenerated scripts.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    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.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-06-14 chet StatusNone Invalid

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code