This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/61895] libbacktrace crashes with bus error with empty file argv[0]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]