bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dd hangs with SIGINT


From: Guillaume Chazarain
Subject: Re: dd hangs with SIGINT
Date: Thu, 07 Apr 2005 18:48:54 +0200
User-agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324)

Jim Meyering wrote:

Can you determine whether (with your patch) e.g., malloc is ever being
called from the signal handler?

Here is what I got when instrumenting malloc with a fprintf(stderr, "malloc(%d)\n") :

$ ./dd if=/dev/zero of=/dev/null
malloc(5)
malloc(60)
malloc(12)
malloc(388)
malloc(60)
malloc(480)
malloc(112)
malloc(220)
malloc(56)
malloc(48)
malloc(64)
malloc(88)
malloc(56)
malloc(44)
malloc(100)
malloc(12)
malloc(12)
malloc(12)
malloc(12)
malloc(12)
malloc(12)
malloc(12)
malloc(12)
malloc(12)
malloc(12)
malloc(12)
malloc(271)
malloc(26)
malloc(24)
malloc(10)
malloc(52)
malloc(352)
malloc(800)
malloc(1024)
malloc(52)
malloc(24)
malloc(8707)
malloc(4607)

/* Now that it's running, I press Ctrl-C */

malloc(52)
1191927+0 records in
malloc(52)
1191926+0 records out
malloc(52)
610266112 bytes (610 MB) copiedmalloc(52)
, 1.95034 seconds, 313 MB/s

And the backtrace for the malloc(52) during the signal is :

#2  0x0804c783 in malloc (bytes=52) at malloc.c:3391
#3  0x0021fc9b in _nl_make_l10nflist () from /lib/tls/libc.so.6
#4  0x0021ddce in _nl_find_domain () from /lib/tls/libc.so.6
#5  0x0021d7b2 in __dcigettext () from /lib/tls/libc.so.6
#6  0x0021cced in dcgettext () from /lib/tls/libc.so.6
#7  0x0021cd52 in gettext () from /lib/tls/libc.so.6
#8  0x08052657 in ebcdic_to_ascii ()

It's a Fedora Core 3, so I don't know the level of trust one can have in this backtrace, but it's quite clear that malloc() is called by gettext() even after
being initialized.

For information, without my patch, here are the malloc calls in the signal handler :

malloc(52)
malloc(352)
malloc(800)
malloc(1024)
malloc(52)
malloc(24)
1858972+0 records in
malloc(52)
1858972+0 records out
malloc(52)
951793664 bytes (952 MB) copiedmalloc(52)
, 2.33876 seconds, 407 MB/s


Regards.

--
Guillaume




reply via email to

[Prev in Thread] Current Thread [Next in Thread]