public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/3348] New: debug/xtrace.sh malloc/memusage.sh tempfile cleanups
@ 2006-10-11 21:11 robert at linuxfromscratch dot org
2007-02-17 8:31 ` [Bug libc/3348] " drepper at redhat dot com
2007-07-12 14:56 ` cvs-commit at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: robert at linuxfromscratch dot org @ 2006-10-11 21:11 UTC (permalink / raw)
To: glibc-bugs
The following patch makes mktemp(1) use the '-t' option for temporary file
directory, and makes sure to remove temporary files.
diff -Naur glibc-2.5.orig/debug/xtrace.sh glibc-2.5/debug/xtrace.sh
--- glibc-2.5.orig/debug/xtrace.sh 2006-05-19 16:43:31.000000000 +0000
+++ glibc-2.5/debug/xtrace.sh 2006-10-11 20:54:11.000000000 +0000
@@ -161,32 +161,32 @@
while read fct; do
read file
if test "$fct" != '??' -a "$file" != '??:0'; then
- format_line $fct $file
+ format_line "$fct" "$file"
fi
done
else
- fifo=$(mktemp -u ${TMPDIR:-/tmp}/xtrace.XXXXXX)
+ fifo="`mktemp -ut xtrace.XXXXXXXXXX`" || exit
+ trap 'rm -f -- "$fifo"' EXIT
+ trap 'trap - EXIT; rm -f -- "$fifo"; exit 1' HUP INT QUIT TERM PIPE
mkfifo -m 0600 $fifo || exit 1
- trap 'rm $fifo; exit 1' SIGINT SIGTERM SIGPIPE
# Now start the program and let it write to the FIFO.
$TERMINAL_PROG -T "xtrace - $program
$*" -e /bin/sh -c "LD_PRELOAD=$pcprofileso PCPROFILE_OUTPUT=$fifo $program $*;
read < $fifo" &
termpid=$!
- $pcprofiledump -u $fifo |
+ $pcprofiledump -u "$fifo" |
while read line; do
- echo $line |
+ echo "$line" |
sed 's/this = \([^,]*\).*/\1/' |
- addr2line -fC -e $program
+ addr2line -fC -e "$program"
done |
while read fct; do
read file
if test "$fct" != '??' -a "$file" != '??:0'; then
- format_line $fct $file
+ format_line "$fct" "$file"
fi
done
read -p "Press return here to close $TERMINAL_PROG($program)."
- echo > $fifo
- rm $fifo
+ echo > "$fifo"
fi
exit 0
diff -Naur glibc-2.5.orig/malloc/memusage.sh glibc-2.5/malloc/memusage.sh
--- glibc-2.5.orig/malloc/memusage.sh 2006-05-19 16:47:26.000000000 +0000
+++ glibc-2.5/malloc/memusage.sh 2006-10-11 21:02:37.000000000 +0000
@@ -77,6 +77,15 @@
exit 0
}
+# These variables are local
+buffer=
+data=
+memusagestat_args=
+notimer=
+png=
+progname=
+tracemmap=
+
# Process arguments. But stop as soon as the program name is found.
while test $# -gt 0; do
case "$1" in
@@ -213,7 +222,9 @@
if test -n "$data"; then
datafile="$data"
elif test -n "$png"; then
- datafile=$(mktemp ${TMPDIR:-/tmp}/memusage.XXXXXX 2> /dev/null)
+ datafile="`mktemp -t memusage.XXXXXXXXXX`" || exit
+ trap 'rm -f -- "$datafile"' EXIT
+ trap 'trap - EXIT; rm -f -- "$datafile"; exit 1' HUP INT QUIT TERM PIPE
if test $? -ne 0; then
# Lame, but if there is no `mktemp' program the user cannot expect more.
if test "$RANDOM" != "$RANDOM"; then
--
Summary: debug/xtrace.sh malloc/memusage.sh tempfile cleanups
Product: glibc
Version: unspecified
Status: NEW
Severity: minor
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: robert at linuxfromscratch dot org
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=3348
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libc/3348] debug/xtrace.sh malloc/memusage.sh tempfile cleanups
2006-10-11 21:11 [Bug libc/3348] New: debug/xtrace.sh malloc/memusage.sh tempfile cleanups robert at linuxfromscratch dot org
@ 2007-02-17 8:31 ` drepper at redhat dot com
2007-07-12 14:56 ` cvs-commit at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: drepper at redhat dot com @ 2007-02-17 8:31 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From drepper at redhat dot com 2007-02-17 08:31 -------
I used part of the patch.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://sourceware.org/bugzilla/show_bug.cgi?id=3348
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libc/3348] debug/xtrace.sh malloc/memusage.sh tempfile cleanups
2006-10-11 21:11 [Bug libc/3348] New: debug/xtrace.sh malloc/memusage.sh tempfile cleanups robert at linuxfromscratch dot org
2007-02-17 8:31 ` [Bug libc/3348] " drepper at redhat dot com
@ 2007-07-12 14:56 ` cvs-commit at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2007-07-12 14:56 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2007-07-12 14:55 -------
Subject: Bug 3348
CVSROOT: /cvs/glibc
Module name: libc
Branch: glibc-2_5-branch
Changes by: jakub@sourceware.org 2007-07-12 14:55:41
Modified files:
. : ChangeLog
debug : xtrace.sh
malloc : memusage.sh
Log message:
2007-02-17 Ulrich Drepper <drepper@redhat.com>
[BZ #3348]
* malloc/memusage.sh: Cleanups.
* debug/xtrace.sh: Quoting and trap changes.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.10362.2.45&r2=1.10362.2.46
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/debug/xtrace.sh.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.17&r2=1.17.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/malloc/memusage.sh.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.13&r2=1.13.2.1
--
http://sourceware.org/bugzilla/show_bug.cgi?id=3348
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-12 14:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-11 21:11 [Bug libc/3348] New: debug/xtrace.sh malloc/memusage.sh tempfile cleanups robert at linuxfromscratch dot org
2007-02-17 8:31 ` [Bug libc/3348] " drepper at redhat dot com
2007-07-12 14:56 ` cvs-commit at gcc dot gnu dot org
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).