Bug 5863 - ferror does not follow /usr/bin/firefox: Error: invalid `Elf' handle
Summary: ferror does not follow /usr/bin/firefox: Error: invalid `Elf' handle
Status: NEW
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
: 5862 (view as bug list)
Depends on:
Blocks: 5861
  Show dependency treegraph
Reported: 2008-03-04 15:02 UTC by Sami Wagiaalla
Modified: 2008-03-05 15:13 UTC (History)
0 users

See Also:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Sami Wagiaalla 2008-03-04 15:02:57 UTC
[swagiaal@toner x86_64]$ ferror -e "xxx" -- /usr/bin/firefox 
Error: invalid `Elf' handle


[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
#4 0x0000003124fc9791 in void java::io::PrintStream::flush() () from
#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. ***