Re: time hangs or seg faults

2009-07-23 Thread Justin Williams
Sorry about that; this is on a gentoo system, hardened kernel 2.6.23,
installed with normal ebuild procedures, which pulls the authors tarball ,
extracts it, applies patches and builds.

On Thu, Jul 23, 2009 at 8:49 AM, Greg Wooledge  wrote:

> On Wed, Jul 22, 2009 at 09:19:22PM +, rjustinwilli...@gmail.com wrote:
> > On one system, I have installed bash from one version to the next, from
> > 3.2.17 to 4.0.10. With each version, the built-in "time" command hangs.
>
> Probably some problem with the build.  Since you didn't even say what
> operating system you're on, or whether you compiled it yourself or used
> a prebuilt binary, it's going to be hard for anyone to help you.
>
> I would suggest posting to the list again with all the relevant details:
>
>  * Operating system name and version
>  * Prebuilt binary or self-compiled
>  * If prebuilt binary: where it came from
>  * If self-compiled: compiler name and version, and what settings you used
>  * What command you type to produce the problem
>
> That's a minimal starting point.  Once the basic details are clear, people
> may need additional information.
>


Re: time seg fault

2009-07-23 Thread Justin Williams
Unfortunately, if I try to strace it (strace time ls), I get command not
found.
If I try to strace `time ls`, I get a hung screen.

Attaching gdb to the running bash session from which I am trying to run
time, I don't get any useful pointers, but, what I get is below:

(no debugging symbols found)
Attaching to program: /bin/bash, process 5647
linux-nat.c:988: internal-error: linux_nat_attach: Assertion `pid == GET_PID
(inferior_ptid) && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP'
failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

I also, for grins, tried sleep 5 && time ls in the bash session and, while
it was sleeping, attached the gdb to the bash session, to see if I could get
anything that way, and got the below:
warning: no loadable sections found in added symbol-file system-supplied DSO
at 0x7b122651f000
(no debugging symbols found)
0x35c7a95e7884 in ?? ()

Not sure if this helps get any closer, but, thanks!

On Thu, Jul 23, 2009 at 8:29 AM, Chet Ramey  wrote:

> rjustinwilli...@gmail.com wrote:
> > time echo "bah"
> > time ls
> > time who
> >
> > Running the commands without the time, they return results as close to
> > instantly as I can think of, but, try to time them, in bash, and they
> > all hang.
>
> Since nobody seems to be able to reproduce this, maybe attaching to the
> hanging bash process with gdb and doing a stack traceback will provide
> better information.
>
> Chet
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>
> Chet Ramey, ITS, CWRUc...@case.edu
> http://cnswww.cns.cwru.edu/~chet/ 
>


Re: time seg fault

2009-07-23 Thread Justin Williams
"/bin/bash", {st_mode=S_IFREG|0755, st_size=1052984, ...}) = 0
open("/proc/sys/kernel/ngroups_max", O_RDONLY) = 3
read(3, "65536\n", 31)  = 6
close(3)= 0
mmap(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x3061588ea000
getgroups(65536, [10, 452, 1006])   = 3
stat("/bin/bash", {st_mode=S_IFREG|0755, st_size=1052984, ...}) = 0
getpgrp()   = 12193
rt_sigaction(SIGCHLD, {0x74c0771a74a, [], SA_RESTORER, 0x3061585d0f10},
{SIG_DFL}, 8) = 0
getrlimit(RLIMIT_NPROC, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) =
0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


On Thu, Jul 23, 2009 at 10:12 AM, Greg Wooledge  wrote:

> On Thu, Jul 23, 2009 at 09:59:48AM -0400, Justin Williams wrote:
> > Unfortunately, if I try to strace it (strace time ls), I get command not
> > found.
>
> ''strace time ls'' will try to run the external command ''time'' which
> apparently you haven't got installed.  (Which is probably good in this
> case, as it avoided some confusion)
>
> What you want is:
>
>  strace bash -c 'time ls'
>
> (You may need to give additional options to strace as well, to get the
> behavior you want.)
>
> > If I try to strace `time ls`, I get a hung screen.
> >
> > Attaching gdb to the running bash session from which I am trying to run
> > time, I don't get any useful pointers, but, what I get is below:
> >
> > (no debugging symbols found)
> > Attaching to program: /bin/bash, process 5647
> > linux-nat.c:988: internal-error: linux_nat_attach: Assertion `pid ==
> GET_PID
> > (inferior_ptid) && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP'
> > failed.
> > A problem internal to GDB has been detected,
> > further debugging may prove unreliable.
>
> Maybe your libc is broken?  Or your compiler, if all of these are
> self-compiled gentoo e-builds?
>


Re: time seg fault

2009-07-23 Thread Justin Williams
Greg, you mentioned that it might be a build bug causing headaches.
As the same build environment was used to build tcsh, and to
(re)build/upgrade bash on this system, and tcsh's time works while bash's
doesn, I'm curious where the idea comes from.  I don't doubt it, but I'm
curious what leads you to that.

Thanks!
Justin

On Thu, Jul 23, 2009 at 10:24 AM, Justin Williams  wrote:

> That's a huge help; thanks!
>
> Output below:
> execve("/bin/bash", ["bash", "-c", "time ls"], [/* 22 vars */]) = 0
> brk(0)   = 0x74c079d3c20
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> 0x306158131000
> access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or
> directory)
> open("/etc/ld.so.cache", O_RDONLY)  = 3
> fstat(3, {st_mode=S_IFREG|0644, st_size=18395, ...}) = 0
> mmap(NULL, 18395, PROT_READ, MAP_PRIVATE, 3, 0) = 0x306158132000
> close(3)= 0
> open("/lib/libncurses.so.5", O_RDONLY)  = 3
> read(3,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\r\2\0\0\0\0\0"..., 832)
> = 832
> fstat(3, {st_mode=S_IFREG|0755, st_size=406112, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> 0x306158137000
> mmap(NULL, 2504632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
> 0x306158138000
> mprotect(0x30615818d000, 2093056, PROT_NONE) = 0
> mmap(0x30615838c000, 61440, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x54000) = 0x30615838c000
> mmap(0x30615839b000, 1976, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x30615839b000
> close(3)= 0
> open("/lib/libdl.so.2", O_RDONLY)   = 3
> read(3,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\16\0\0\0\0\0\0"..., 832)
> = 832
> fstat(3, {st_mode=S_IFREG|0755, st_size=14328, ...}) = 0
> mmap(NULL, 2109600, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
> 0x30615839c000
> mprotect(0x30615839e000, 2097152, PROT_NONE) = 0
> mmap(0x30615859e000, 8192, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x30615859e000
> close(3)= 0
> open("/lib/libc.so.6", O_RDONLY)= 3
> read(3,
> "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\342\1\0\0\0\0\0"...,
> 832) = 832
> fstat(3, {st_mode=S_IFREG|0755, st_size=1330184, ...}) = 0
> mmap(NULL, 3438296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
> 0x3061585a
> mprotect(0x3061586de000, 2097152, PROT_NONE) = 0
> mmap(0x3061588de000, 20480, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13e000) = 0x3061588de000
> mmap(0x3061588e3000, 18136, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3061588e3000
> close(3)= 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> 0x3061588e8000
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> 0x3061588e9000
> arch_prctl(ARCH_SET_FS, 0x3061588e8e60) = 0
> open("/dev/urandom", O_RDONLY)  = 3
> read(3, "\323k\263\254\265\6\201\247", 8) = 8
> close(3)= 0
> mprotect(0x3061588de000, 16384, PROT_READ) = 0
> mprotect(0x30615859e000, 4096, PROT_READ) = 0
> mprotect(0x30615838c000, 57344, PROT_READ) = 0
> mprotect(0x74c079ba000, 16384, PROT_READ) = 0
> mprotect(0x30615812f000, 4096, PROT_READ) = 0
> munmap(0x306158132000, 18395)   = 0
> rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
> open("/dev/tty", O_RDWR|O_NONBLOCK) = 3
> close(3)= 0
> brk(0)  = 0x74c079d3c20
> brk(0x74c079f4c20)  = 0x74c079f4c20
> brk(0x74c079f5000)  = 0x74c079f5000
> getuid()= 1005
> getgid()= 1006
> geteuid()   = 1005
> getegid()   = 1006
> rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
> open("/proc/meminfo", O_RDONLY) = 3
> fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> 0x306158132000
> read(3, "MemTotal: 18529272 kB\nMemFre"..., 1024) = 725
> close(3)= 0
> munmap(0x306158132000, 4096)= 0
> rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGINT, {SIG_DFL