This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/61895] libbacktrace crashes with bus error with empty file argv[0]
- From: "ian at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 02 Aug 2014 00:54:47 +0000
- Subject: [Bug other/61895] libbacktrace crashes with bus error with empty file argv[0]
- Auto-submitted: auto-generated
- References: <bug-61895-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61895
--- Comment #4 from ian at gcc dot gnu.org <ian at gcc dot gnu.org> ---
Author: ian
Date: Sat Aug 2 00:54:15 2014
New Revision: 213513
URL: https://gcc.gnu.org/viewcvs?rev=213513&root=gcc&view=rev
Log:
PR other/61895
runtime: Ignore small argv[0] file for backtrace.
Reportedly in some cases Docker starts processes with argv[0]
pointing to an empty file. That would cause libgo to pass
that empty file to libbacktrace, which would then fail to do
any backtraces. Everything should work fine if libbacktrace
falls back to /proc/self/exe.
This patch to libgo works around the problem by ignoring
argv[0] if it is a small file, or if stat fails. This is not
a perfect fix but it's an unusual problem.
Modified:
trunk/libgo/runtime/go-caller.c