Bug 5863

Summary: ferror does not follow /usr/bin/firefox: Error: invalid `Elf' handle
Product: frysk Reporter: Sami Wagiaalla <swagiaal>
Component: generalAssignee: Unassigned <frysk-bugzilla>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 5861    

Description Sami Wagiaalla 2008-03-04 15:02:57 UTC
[swagiaal@toner x86_64]$ ferror -e "xxx" -- /usr/bin/firefox 
Error: invalid `Elf' handle

also:

[swagiaal@toner x86_64]$ ferror -e "invalid" -- /usr/local/bin/ferror -e "xxx"
-- /usr/bin/firefox 
Tracing 18581.18581
Tracing 18581.18582
Error: invalid `Elf' handle
Process is trying to output invalid
Stack trace:

Task #18581
#0 0x00000030f600d2cb in __libc_write () from .../libpthread-2.7.so
#1 0x0000003124bf9114 in void
gnu::java::nio::channels::FileChannelImpl::write(JArray<char>*, int, int) ()
from .../libgcj.so.8rh.0.0
#2 0x0000003124fba38f in void java::io::FileOutputStream::write(JArray<char>*,
int, int) () from .../libgcj.so.8rh.0.0
#3 0x0000003124fb3e78 in void java::io::BufferedOutputStream::flush() () from
.../libgcj.so.8rh.0.0
#4 0x0000003124fc9791 in void java::io::PrintStream::flush() () from
.../libgcj.so.8rh.0.0
#5 0x0000003124fc9827 in void java::io::PrintStream::print(java::lang::String*,
bool) () from .../libgcj.so.8rh.0.0
Comment 1 Frank Ch. Eigler 2008-03-04 16:18:49 UTC
/usr/bin/firefox is a shell script.
Frysk probably needs to parse it to identify the interpreter program (/bin/sh?)
and start tracing from there.
Comment 2 Sami Wagiaalla 2008-03-04 17:30:17 UTC
hmm i tried this:

$ ferror -e "foo" -- /bin/sh /usr/bin/firefox 
Tracing 4376.4376
Tracing 4377.4377
Tracing 4378.4378
Tracing 4379.4379
Tracing 4380.4380
Tracing 4381.4381
Exception in thread "main" lib.dwfl.ElfFileException: open: Permission denied
(file /proc/4381/exe) (errno 13)
   at lib.dwfl.Elf.getDescriptor(ferror)
   at lib.dwfl.Elf.<init>(ferror)
   at frysk.isa.ElfMap.getISA(ferror)
   at frysk.proc.live.LinuxPtraceTask.initializeAttachedState(ferror)
   at frysk.proc.live.LinuxPtraceTask.notifyExeced(ferror)
   at frysk.proc.live.LinuxPtraceTaskState$Running.handleExecedEvent(ferror)
   at frysk.proc.live.LinuxPtraceTask.processExecedEvent(ferror)
   at frysk.proc.live.LinuxWaitBuilder.execEvent(ferror)
   at frysk.sys.Wait.wait(ferror)
   at frysk.sys.Wait.wait(ferror)
   at frysk.event.WaitEventLoop.block(ferror)
   at frysk.event.EventLoop.runEventLoop(ferror)
   at frysk.event.EventLoop.run(ferror)
   at frysk.util.ProcRunningUtil.start(ferror)
   at frysk.bindir.ferror.main(ferror)
Caused by: frysk.sys.Errno: open: Permission denied (file /proc/4381/exe) (errno 13)
   at frysk.sys.FileDescriptor.open(ferror)
   at frysk.sys.FileDescriptor.<init>(ferror)
   at lib.dwfl.Elf.getDescriptor(ferror)
   ...14 more
Comment 3 Sami Wagiaalla 2008-03-05 15:13:07 UTC
*** Bug 5862 has been marked as a duplicate of this bug. ***