Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Mike Gerwitz Newsgroups: gnu.bash.bug Subject: Re: Segfault on recursive trap/kill Date: Sun, 07 Oct 2018 13:21:34 -0400 Lines: 47 Approved: bug-bash@gnu.org Message-ID: References: <8736tj3llu.fsf@gnu.org> <25389056-9fcf-1d31-36d8-13098769a43a@case.edu> <874ldy1vka.fsf@gnu.org> <20181006210450465282080@bob.proulx.com> <87y3baxpy4.fsf@gnu.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: usenet.stanford.edu 1538933145 4535 208.118.235.17 (7 Oct 2018 17:25:45 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: Valentin Bajrami Envelope-to: bug-bash@gnu.org In-Reply-To: (Valentin Bajrami's message of "Sun, 7 Oct 2018 08:52:25 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) OpenPGP: id=22175B02E626BC98D7C0C2E5F22BB8158EE30EAB X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14696 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, Oct 07, 2018 at 08:52:25 +0200, Valentin Bajrami wrote: > As earlier expained, you are calling foo function recursively. To mitigate > this behaviour you simple set FUNCNEST=3D foo() { foo; }; foo where N > denotes the number of nested functios to be called. This is perfect and clear behavior, actually: $ FUNCNEST=3D10; foo() { foo; }; foo bash: foo: maximum function nesting level exceeded (10) If bash were to set a default value for FUNCNEST then a useful error would be provided rather than segfaulting (and possibly triggering a coredump). Of course, if bash itself is sharing a stack with the interpreter, then it's hard to come up with a good predetermined value. FUNCNEST doesn't seem to work with the issue of recursive traps, though (understandably). =2D-=20 Mike Gerwitz --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJbukCeAAoJEIyRe39dxRui9t0QAMSQsyP4G3rtS2s6mkadyxd6 8ggwymBnWfnnUA2IMefI/dFQ/6DHtPuWXN23LXAwWvSWvFjQEFvR/kD71iLn4Xmw qFba4f+cfYtQmddjP17MHtd/2ghqkEDPvvIAXwHDT/SDb84CL/Zl+A+AbYTwjCAK 9X5SV6f0JQ2X6s204GEb+fi52yJt5PooG9KnPopi03kNKDlAxUKxb/3Mu5Ry6wfZ /pe/MQmV1DfgNLEuq7cTDmbqFNi3vt7g7klAELVq4bTSHOh0vrO3YNJudgUTvv5S 8Hi4VZFLQV7y4lFEmK3YpSpXdxzAG2B4vX5k83qP9xrtiduLesge7FE4O0zMVsWi QQdtCGJaAcwIFATNEnpcAJp5dJ/BQK++fz/QLoeAX2H8F7mB/g8MJo1wUaz/EcLH 6SfmV2OpRgiOzPfDZX8x8rVJQjsnHpAddvPpMAPaNtVkLznlU6xDmIjecMEVUKSS a5VcYz260orTNvNGdPfoM+9fy/xoakvVGTrOWox7N898sIjw8XhRt1jtuQ32eWUb 7iCfgAeLoJ/v95AhCWKq6ATfJ6ppoamMn6vo13u1WWDXiwVynUZSQEA2XzjO7rUJ tb9RKqJswfBatbtZuHQ5n00MZdGEcd9Zc1SQ1RbiWQQWQW9C5iCJWBe6hRri0JCo hwC1KxE/Eh6mnPQru4HY =dwd9 -----END PGP SIGNATURE----- --=-=-=--