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


sr #109328: segfault if function is too long

Submitted by:  None
Submitted on:  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

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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>
Project 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

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



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

Attach Files:

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)

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

    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.3