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: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: Invalid
Privacy: PublicAssigned to: None
Originator Email: -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 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 File(s):
   
   
Comment:
   

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 chet (Posted a comment)
  • -unavailable- added by None (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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 14 Jun 2017 02:28:06 PM UTCchetStatusNone=>Invalid

    Back to the top


    Powered by Savane 3.1-cleanup1