Re: Re: time seg fault

2009-07-23 Thread rjustinwilliams
That makes sense. I was seeing a gentoo bug report that might indicate  
issues with hardened kernel (and/or version issue) and glibc's  
gettimeofday() function. That was filed for a different issue, but, found  
it interesting...

On Jul 23, 2009 2:22pm, Greg Wooledge  wrote:

On Thu, Jul 23, 2009 at 01:42:15PM -0400, Justin Williams wrote:



> 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.





Well, my initial diagnosis of "a problem with the build" is very general.



I just mean that the bash binary executable program is not a correct



compilation of the source code, either because of a compiler bug, or



any other really bizarre problem.





Then you showed this:





> >> > 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.





To which I responded:





> >> Maybe your libc is broken? Or your compiler, if all of these are



> >> self-compiled gentoo e-builds?





If both bash and gdb are showing unexplained problems, then I would



start looking at deeper levels for the problems -- C compiler, C library,



kernel, hardware.




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}, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGINT, {SIG_DFL}, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0
> rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
> rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}, 8) = 0
> uname({sys="Linux", node="", ...}) = 0
> stat("/home/", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
> stat(".", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
> getpid()  

Re: time seg fault

2009-07-23 Thread Justin Williams
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}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}, 8) = 0
uname({sys="Linux", node="", ...}) = 0
stat("/home/", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
getpid()= 12196
getppid()   = 12193
stat(".", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
stat("/usr/local/bin/bash", 0x78b935f19eb0) = -1 ENOENT (No such file or
directory)
stat("/usr/bin/bash", 0x78b935f19eb0)   = -1 ENOENT (No such file or
directory)
stat("/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_ANONY

Re: time seg fault

2009-07-23 Thread Greg Wooledge
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
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 Chet Ramey
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.eduhttp://cnswww.cns.cwru.edu/~chet/




Re: Re: time seg fault

2009-07-23 Thread rjustinwilliams

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.
Time the same commands in tcsh, they come back near-instantly, with time  
readouts.


At first, I thought there was something with the version of bash, since a  
couple of other machines with differing versions do not exhibit this  
behavior, but, installing corresponding versions on this machine that is  
acting strangely made no difference. Have bounced through multiple versions  
with the same results - a hung command every time I try to time in bash.


On Jul 23, 2009 6:43am, pk  wrote:

rjustinwilli...@gmail.com wrote:





> Hi all



>



> I have, on a 64-bit system an issue with time hanging. I've installed



> multiple versions, one at a time, and gotten the same results on each



> version.



>



> If I use tcsh, instead of bash, time works.



>



> With bash 3.17, I got a seg fault; with the other versions up through



> 4.10, it just hangs and I have to go back in and kill it.



>



> Any thoughts on where this might be breaking? Are there any files bash's



> time tries to use that I should check out?





It's very difficult to tell without at least an idea of what you're trying



to do. Paste a snippet of the code or commands you are using.




Re: time seg fault

2009-07-23 Thread pk
rjustinwilli...@gmail.com wrote:

> Hi all
> 
> I have, on a 64-bit system an issue with time hanging. I've installed
> multiple versions, one at a time, and gotten the same results on each
> version.
> 
> If I use tcsh, instead of bash, time works.
> 
> With bash 3.17, I got a seg fault; with the other versions up through
> 4.10, it just hangs and I have to go back in and kill it.
> 
> Any thoughts on where this might be breaking? Are there any files bash's
> time tries to use that I should check out?

It's very difficult to tell without at least an idea of what you're trying
to do. Paste a snippet of the code or commands you are using.


time seg fault

2009-07-23 Thread rjustinwilliams

Hi all

I have, on a 64-bit system an issue with time hanging. I've installed  
multiple versions, one at a time, and gotten the same results on each  
version.


If I use tcsh, instead of bash, time works.

With bash 3.17, I got a seg fault; with the other versions up through 4.10,  
it just hangs and I have to go back in and kill it.


Any thoughts on where this might be breaking? Are there any files bash's  
time tries to use that I should check out?


Thanks
Justin