* [PATCH] Fix catchsegv
@ 2004-10-19 12:10 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2004-10-19 12:10 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
[-- Attachment #1: Type: text/plain, Size: 304 bytes --]
Hi!
$LIB in LD_PRELOAD=.../$LIB/libSegFault.so needs to be escaped
from shell. Either of the following patches work, I'd say adding
single quotes is better in case of weirdo slibdir paths e.g. with
embedded spaces and other chars (but that will not handle
properly paths with embedded quotes).
Jakub
[-- Attachment #2: P --]
[-- Type: text/plain, Size: 607 bytes --]
2004-10-19 Jakub Jelinek <jakub@redhat.com>
* debug/Makefile (catchsegv): Prefix $LIB with a backslash.
--- libc/debug/Makefile.jj 2004-10-19 13:45:37.000000000 +0200
+++ libc/debug/Makefile 2004-10-19 13:57:34.623059205 +0200
@@ -72,7 +72,7 @@ include ../Rules
$(objpfx)catchsegv: catchsegv.sh $(common-objpfx)soversions.mk \
$(common-objpfx)config.make
- slibpfx=`echo $(slibdir)|sed 's/lib\(64\|\)$$/$$LIB/'`; \
+ slibpfx=`echo $(slibdir)|sed 's/lib\(64\|\)$$/\\\\\\\\$$LIB/'`; \
sed -e 's|@VERSION@|$(version)|' -e "s|@SLIB@|$$slibpfx|" $< > $@.new
chmod 555 $@.new
mv -f $@.new $@
[-- Attachment #3: P2 --]
[-- Type: text/plain, Size: 609 bytes --]
2004-10-19 Jakub Jelinek <jakub@redhat.com>
* debug/catchsegv.sh: Surround @SLIB@ into single quotes.
--- libc/debug/catchsegv.sh.jj 2004-10-19 13:45:37.000000000 +0200
+++ libc/debug/catchsegv.sh 2004-10-19 14:02:02.468479350 +0200
@@ -54,7 +54,7 @@ segv_output=`mktemp ${TMPDIR:-/tmp}/segv
# Redirect stderr to avoid termination message from shell.
(exec 3>&2 2>/dev/null
-LD_PRELOAD=${LD_PRELOAD:+${LD_PRELOAD}:}@SLIB@/libSegFault.so \
+LD_PRELOAD=${LD_PRELOAD:+${LD_PRELOAD}:}'@SLIB@'/libSegFault.so \
SEGFAULT_USE_ALTSTACK=1 \
SEGFAULT_OUTPUT_NAME=$segv_output \
"$prog" ${1+"$@"} 2>&3 3>&-)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-10-19 12:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19 12:10 [PATCH] Fix catchsegv Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).