Re: Segmentation fault after a script runs source on itself

Robert Elz <[email protected]>
Newsgroups gmane.comp.shells.bash.bugs
Message-ID <[email protected]>
    Date:        Tue, 23 Dec 2025 00:42:41 +0000
    From:        "Parker Macdonald (Student)" <[email protected]>
    Message-ID:  <BY5PR17MB3713C948097123191BF9DA28FFB5A@BY5PR17MB3713.namprd17.prod.outlook.com>

  |       If you have a script, lets say it's called loop.sh, and it contains the following line:
  |
  | source loop.sh
  |
  |       When you run this script bash will segmentation fault.
  | I'd imagine this is caused by a stack overflow, because when
  | debugging bash there are 35604 stack frames once it crashes.


Infinite recursion will get you like that all the time.   Just don't
do that, and you won't have a problem, the only bug here is in the
script.

kre
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.