1 |
"Joaquim Quinteiro Uchoa" <joaquim.uchoa@×××××.com> posted |
2 |
59541ff30611211041g40985a11q12c08018e9ac005a@××××××××××.com, excerpted |
3 |
below, on Tue, 21 Nov 2006 16:41:56 -0200: |
4 |
|
5 |
> Hello, I'm having a problem with Firefox 2. Every time I start the |
6 |
> browser, I see the following message: |
7 |
> |
8 |
> Bon Echo could not install this item because "install.rdf" (provided by |
9 |
> the item) is not well-formed or does not exist. Please contact the author |
10 |
> about this problem. |
11 |
|
12 |
> [I]t works, but this sucks. |
13 |
> |
14 |
> Well, I've tried several things, including starting with -jsconsole and |
15 |
> using a new profile. I can see anything wrong in |
16 |
> /usr/lib64/mozilla-firefox/extensions: |
17 |
|
18 |
> All I need is a way to see what file is being mentioned by Firefox. |
19 |
|
20 |
I'm not a firefox user so won't attempt to address the issue from that |
21 |
angle. However, there's another way: emerge if necessary and use strace. |
22 |
|
23 |
strace basically hooks and reports on part or all of the system calls an |
24 |
application makes. Output can be WAY longer than you might expect, so you |
25 |
filter it down, first by using command line switches to only report on |
26 |
what you are after (in this case, all open-file calls will do), then by |
27 |
piping the output to grep for further filtering down to a manageable level. |
28 |
|
29 |
For commandline options you'll want -eopen, to trace only file-open calls. |
30 |
You /may/ need -f to trace forks as well. The trace actually goes to |
31 |
STDERR not STDOUT, so you have to redirect STDERR to STDOUT to pipe it to |
32 |
grep. Something like this: |
33 |
|
34 |
strace -f -efile 2>&1 | grep install.rdf |
35 |
|
36 |
Note that you may still get quite some output, if firefox is looking in |
37 |
multiple locations for the file, with ENOENT (error no entry) errors |
38 |
returned by the system (and reported by systrace) if the file doesn't |
39 |
exist, a filenumber returned if it was opened successfully, and permission |
40 |
errors and the like also possible. |
41 |
|
42 |
It's not so much of interest here, but one can also use strace to find |
43 |
just what sort of thing an application is looking for to open and where, |
44 |
even without knowing the filename exactly. I'll often use it to figure |
45 |
out where an app keeps its config files, for instance. In that case, you |
46 |
don't know the name of the file exactly so you can't grep for it, and as I |
47 |
said, the output can very quickly get overwhelming without any filtering |
48 |
at all. However, grep -v (return only lines that do NOT match) can be |
49 |
used in this case, to exclude whole categories that are known NOT to be of |
50 |
interest. For instance, many X apps will look for icon, font and cursor |
51 |
files, and if we are looking for config files those aren't of any interest |
52 |
at all, so we could use a | grep -v icons | grep -v fonts | grep -v |
53 |
cursors pipeline of greps to filter all those out. If we are looking for |
54 |
a user config, we can further grep for the user's home dir, avoiding |
55 |
everything in /usr including all the libraries opened and the like. Since |
56 |
every library open often involves several attempts at various standard |
57 |
locations before the library is actually found and opened, that's a HUGE |
58 |
filter. By this time, the output should actually be getting a bit more |
59 |
humanly manageable and one can look thru it manually. If not, add a few |
60 |
more greps to the pipeline to filter it further. |
61 |
|
62 |
Of course, using strace is quite educational in itself. Few users have |
63 |
any idea running a single application involves even 1% of the number of |
64 |
attempted opens it actually does, or that for every library actually |
65 |
loaded, the system often looks in multiple standard locations for that |
66 |
library before actually finding it. One VERY QUICKLY gains a new |
67 |
appreciation for how much actual work goes on behind the scenes, and is |
68 |
amazed that just opening even a simple app doesn't take a half-hour! =8^) |
69 |
|
70 |
Anyway, strace can be a very helpful troubleshooting tool, once one learns |
71 |
how to use it and cope with its often HUGE output level. I've certainly |
72 |
found it so, and it should prove quite helpful for you here, as well. |
73 |
|
74 |
-- |
75 |
Duncan - List replies preferred. No HTML msgs. |
76 |
"Every nonfree program has a lord, a master -- |
77 |
and if you use the program, he is your master." Richard Stallman |
78 |
|
79 |
-- |
80 |
gentoo-amd64@g.o mailing list |