How to debug bash scripts dumping core
Example
In the rest of the article, the following example script will be used:
$ cat recurse.sh
#!/bin/bash
recursive2() {
recursive1
}
recursive1() {
recursive2
}
recursive1
Upon being called, after some time, bash will fail with Segmentation fault and dump a core, assuming ulimit -c is not tuned to 0:
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
