Bug 647140 - tfm fails to find documentation files
Summary: tfm fails to find documentation files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: EMBOSS
Version: 13
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-27 10:48 UTC by Simon Andrews
Modified: 2010-11-19 22:36 UTC (History)
2 users (show)

Fixed In Version: EMBOSS-6.3.1-7.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-19 22:32:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Strace of segfault from seqret in EMBOSS-6.2.0-4.fc13.i686.rpm (17.68 KB, text/plain)
2010-10-28 08:08 UTC, Simon Andrews
no flags Details

Description Simon Andrews 2010-10-27 10:48:57 UTC
Description of problem:

tfm fails to show any documentation as it seems to be looking in the wrong directory.


Version-Release number of selected component (if applicable):
EMBOSS-6.2.0-3.fc13.i686


How reproducible:
Always


Steps to Reproduce:
1. /usr/bin/tfm seqret  (same problem with all programs, seqret is just an example)
  
Actual results:
$ /usr/bin/tfm seqret
Displays full documentation for an application
Died: No documentation found in /usr/share/EMBOSS/doc/ for program 'seqret'.

Expected results:
Documentation is shown

Additional info:
$ env | grep -i emboss
PLPLOT_LIB=/usr/share/EMBOSS
EMBOSS_ACDROOT=/usr/share/EMBOSS/acd
EMBOSS_DATA=/usr/share/EMBOSS/data
EMBOSS_DOCROOT=/usr/share/EMBOSS/doc
EMBOSS_DATABASE_DIR=/usr/share/EMBOSS/data

$ rpm -V EMBOSS-6.2.0-3.fc13.i686
.......T.    /usr/share/EMBOSS/emboss.default.template

$ ls /usr/share/EMBOSS/doc/*/*/seqret.*
/usr/share/EMBOSS/doc/programs/html/seqret.html
/usr/share/EMBOSS/doc/programs/text/seqret.txt

Comment 1 Tom "spot" Callaway 2010-10-27 17:03:46 UTC
Wow. I'm not sure how this code was ever supposed to work, the logic in the tfm.c code is all wrong. 

I've sent a patch upstream.

Comment 2 Fedora Update System 2010-10-27 17:39:34 UTC
EMBOSS-6.2.0-4.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/EMBOSS-6.2.0-4.fc13

Comment 3 Fedora Update System 2010-10-27 17:39:40 UTC
EMBOSS-6.3.1-4.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/EMBOSS-6.3.1-4.fc14

Comment 4 Fedora Update System 2010-10-28 05:58:50 UTC
EMBOSS-6.2.0-4.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update EMBOSS'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/EMBOSS-6.2.0-4.fc13

Comment 5 Simon Andrews 2010-10-28 08:04:49 UTC
I installed the update using the download direct from Koji (it hadn't shown up in the updates yet).

After updating all EMBOSS applications immediately segfaulted - I'll attach an strace in another note.  I used yum downgrade to reinstall the previous version which didn't fix the problem and the segfaults continued.  Removing EMBOSS and EMBOSS-libs and reinstalling got things working.

Removing EMBOSS and reinstalling the update rpms still resulted in everything segfaulting.

Comment 6 Simon Andrews 2010-10-28 08:08:54 UTC
Created attachment 456175 [details]
Strace of segfault from seqret in EMBOSS-6.2.0-4.fc13.i686.rpm

Comment 7 Tom "spot" Callaway 2010-10-28 14:25:00 UTC
What is the exact command that you're running which is segfaulting? I'm testing on Fedora 14 x86_64, and both "seqret" and "tfm seqret" work fine...

Comment 8 Simon Andrews 2010-10-28 14:47:00 UTC
I'm running on i686 and every command segfaults immediately, even something as simple as embossversion.  It's happening really early because running with -debug doesn't generate the .dbg file.

ldd doesn't show any missing dependencies

file says the executable is a valid 32-bit ELF executable

Downgrading to the previous version using yum downgrade still makes everything segfault.

Removing and reinstalling the old version makes everything work again.

Removing and reinstalling the new version makes everything segfault.

/var/log/messages has the following:

Oct 28 15:37:23 bilin6 kernel: embossversion[8431]: segfault at ff000000 ip 005080ef sp bffc1750 error 4 in libajax.so.6.0.2[491000+184000]
Oct 28 15:37:30 bilin6 kernel: embossversion[8432]: segfault at ff000000 ip 003c90ef sp bfbf94f0 error 4 in libajax.so.6.0.2[352000+184000]
Oct 28 15:39:39 bilin6 kernel: seqret[8443]: segfault at ff000000 ip 001d80ef sp bfc6d440 error 4 in libajax.so.6.0.2[161000+184000]

..which is part of the new EMBOSS-libs package.  Could this be something which would have been triggered by any rebuild and nothing specifically to do with the tfm changes?

I'm open to suggestions for other avenues to track this down.

Comment 9 Tom "spot" Callaway 2010-10-28 16:11:57 UTC
"Downgrading to the previous version using yum downgrade still makes everything
segfault."

This means that the problem isn't with EMBOSS, but rather, one of its dependencies.

Lets try this:

1) Get the system to a state where the previous build of EMBOSS does not segfault.
2) Download copies of the previous EMBOSS and EMBOSS-libs packages, along with copies of the new proposed EMBOSS and EMBOSS-libs update packages.
3) Using rpm, try to run `rpm -Uvh` on the new EMBOSS and EMBOSS-libs update packages. If this succeeds, but then if "embossversion" segfaults, let me know. If they refuse to install due to dependency issues, let me know that too. 

Also, just to confirm, you're running on Fedora 13 i686? I'll try to find some time to test this in a VM to see if I can reproduce it locally.

Comment 10 Simon Andrews 2010-10-28 21:30:22 UTC
(In reply to comment #9)
> "Downgrading to the previous version using yum downgrade still makes everything
> segfault."
> 
> This means that the problem isn't with EMBOSS, but rather, one of its
> dependencies.

Or possibly a pre/post install script?


> Lets try this:
> 
> 1) Get the system to a state where the previous build of EMBOSS does not
> segfault.
> 2) Download copies of the previous EMBOSS and EMBOSS-libs packages, along with
> copies of the new proposed EMBOSS and EMBOSS-libs update packages.
> 3) Using rpm, try to run `rpm -Uvh` on the new EMBOSS and EMBOSS-libs update
> packages. If this succeeds, but then if "embossversion" segfaults, let me know.
> If they refuse to install due to dependency issues, let me know that too. 

This is exactly what I did in my original install.  There are no dependency problems from RPM and the new RPMs install cleanly.  The binaries which were installed segfault immediately upon installation though.
 
> Also, just to confirm, you're running on Fedora 13 i686? I'll try to find some
> time to test this in a VM to see if I can reproduce it locally.

That's correct.  I have access to a few other machines, both i686 and x86_64 which I can try the new packages out on to see if I can tie this to a more specific subset of machines (but possibly not until Monday).

Comment 11 Julian Sikorski 2010-10-28 23:19:20 UTC
I have just checked the packages:
$ sudo yum --enablerepo={,rpmfusion-{,non}free-}updates-testing update EMBOSS EMBOSS-libs
and the stuff is working as expected. The bug is fixed and there are no segfaults neither with
$ tfm seqret
nor with
$ embossversion
This is on an up-to-date Fedora 13 x86_64

Comment 12 Simon Andrews 2010-11-01 09:09:34 UTC
I figured out what's going on!  The session below was performed on a different i686 box to the one I originally observed the problem on:


$ sudo yum install EMBOSS

Dependencies Resolved

================================================================================
 Package              Arch          Version               Repository       Size
================================================================================
Installing:
 EMBOSS               i686          6.2.0-3.fc13          fedora          8.1 M
Installing for dependencies:
 EMBOSS-libs          i686          6.2.0-3.fc13          fedora          1.0 M

Installed:
  EMBOSS.i686 0:6.2.0-3.fc13

Dependency Installed:
  EMBOSS-libs.i686 0:6.2.0-3.fc13

Complete!


$ tfm seqret
Displays full documentation for an application
Died: No documentation found in /usr/share/EMBOSS/doc/ for program 'seqret'.



$ sudo yum --enablerepo=updates-testing update EMBOSS

================================================================================
 Package        Arch         Version              Repository               Size
================================================================================
Updating:
 EMBOSS         i686         6.2.0-4.fc13         updates-testing         8.1 M

Updated:
  EMBOSS.i686 0:6.2.0-4.fc13

Complete!

[andrewss@bilin5 ~]$ tfm seqret
Displays full documentation for an application

Function

   Reads and writes (returns) sequences




$ sudo yum --enablerepo=updates-testing update EMBOSS-libs

================================================================================
 Package           Arch       Version               Repository             Size
================================================================================
Updating:
 EMBOSS-libs       i686       6.2.0-4.fc13          updates-testing       1.0 M

Updated:
  EMBOSS-libs.i686 0:6.2.0-4.fc13

Complete!


$ tfm seqret
Segmentation fault




The summary is that it's not the update to EMBOSS which is the problem, it's the update to EMBOSS-libs.  There is no dependency between the latest EMBOSS update and the corresponding EMBOSS-libs so if you only update one then the other doesn't get pulled in as a dependency.  When I did my previous experiments I'd downloaded the rpms so I was always installing both.

The update to EMBOSS fixes the originally reported problem - but the new EMBOSS-libs breaks the installation such that everything immediately segfaults.  I can't help with what's caused EMBOSS-libs to break since nothing in there should have changed, but that's where the problem lies and is why we're getting different results.

Comment 13 Tom "spot" Callaway 2010-11-04 16:42:04 UTC
Okay, so here is what I've found (this is long, and possibly too much info, but bear with me, please):

On a clean Fedora 13 i686 system, with EMBOSS.i686 0:6.2.0-3.fc13 and EMBOSS-libs.i686 0:6.2.0-3.fc13 installed, I cannot reproduce the original bug, or to be specific, tfm works properly.

It took me a while to figure that one out. When I looked at the debug output from this run, I see:

given  docroot ''
defined docroot '<null>'
installed docroot '/usr/share/EMBOSS/doc/programs/text/'
fileOpenDir opened '/usr/share/EMBOSS/doc/programs/text/'

I also noticed that EMBOSS_DOCROOT wasn't set:

[spot@f13 ~]$ echo $EMBOSS_DOCROOT

[spot@f13 ~]$

Now, it should be set, because of /etc/profile.d/emboss.sh (at least on bash).

Sure enough, if I source that file (I'd get the same result if I started a new bash session), then rerun tfm, it fails:

[spot@f13 ~]$ tfm --debug
Displays full documentation for an application
Program to search for: seqret
Died: No documentation found in /usr/share/EMBOSS/doc/ for program 'seqret'.

And if we look at the debug output now, we see:

given  docroot ''
defined docroot '/usr/share/EMBOSS/doc'
installed docroot '/usr/share/EMBOSS/doc/'
fileOpenDir opened '/usr/share/EMBOSS/doc/'

*****

Looking through the code, this makes some sense. tfm is considering EMBOSS_DOCROOT as an override, and if it is unset, there are heuristics in tfm.c to find and set the docroot to either /usr/share/EMBOSS/doc/programs/text/ or /usr/share/EMBOSS/doc/programs/html/. (You can see this in the tfm_FindAppDocRoot() function in emboss/tfm.c)

In this case, because EMBOSS_DOCROOT is set, tfm assumes it is accurate and makes no attempt to adjust it. Technically, the sane answer for "What is the EMBOSS Documentation Root" should be /usr/share/EMBOSS/doc/ , but tfm really wants EMBOSS_DOCROOT to be the answer to "What is the full directory path to my specific set of EMBOSS documentation for programs?"

I was able to confirm this by forcing the variable:

  export EMBOSS_DOCROOT=/usr/share/EMBOSS/doc/programs/text/

Now, tfm works (but only in text mode, because we've hardcoded it, html mode fails).

So, the options here are:

A) Continue to let tfm assume that EMBOSS_DOCROOT is the correct override path
B) Fix tfm to assume that EMBOSS_DOCROOT is the toplevel docroot, and apply additional pathing as appropriate.

B makes a lot more sense to me, so that's what I've done instead. Now, if there is a defined docroot (e.g. EMBOSS_DOCROOT is set), it applies the same heuristics that add the rest of the path in either the text or html cases. If the docroot is undefined, the behavior is identical.

The only use case this could possibly break would be that of where someone was hardcoding EMBOSS_DOCROOT to the full /usr/share/EMBOSS/doc/programs/text/ path, but I can't imagine anyone's actually doing that (and preferring it).

*****
Also, I'm pretty sure my use of "/" in the original patch strings was causing the segfault you reported. With the reworked patch, the string manipulations aren't done in the same way, so the segfault is now gone.

I've confirmed this newer fix works without segfault in both Fedora 13 i686 and Fedora 14 x86_64, in both cases (EMBOSS_DOCROOT set and unset). Updates will show up shortly.

Comment 14 Fedora Update System 2010-11-04 20:20:34 UTC
EMBOSS-6.2.0-5.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/EMBOSS-6.2.0-5.fc13

Comment 15 Fedora Update System 2010-11-04 20:20:42 UTC
EMBOSS-6.3.1-6.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/EMBOSS-6.3.1-6.fc14

Comment 16 Tom "spot" Callaway 2010-11-04 20:31:21 UTC
Simon, please retest this new update. The 6.2.0 code seems pretty fragile, if this doesn't work, I'm going to bump Fedora 13 to 6.3.1, as the fix I did there seems much more correct (but it did not work in my testing with 6.2.0).

Comment 17 Simon Andrews 2010-11-05 14:33:13 UTC
Sorry, no joy with the new update either:

]$ tfm seqret
Displays full documentation for an application
Died: No documentation found in /usr/share/EMBOSS/doc/ for program 'seqret'.

$ sudo rpm -Uvh EMBOSS-libs-6.2.0-5.fc13.i686.rpm EMBOSS-6.2.0-5.fc13.i686.rpm
Preparing...                ########################################### [100%]
   1:EMBOSS-libs            ########################################### [ 50%]
   2:EMBOSS                 ########################################### [100%]
[andrewss@bilin6 ~]$ tfm seqret
Segmentation fault


This is F13 on i686.

Comment 18 Tom "spot" Callaway 2010-11-05 18:53:05 UTC
Please try this 6.3.1 build for F13:
http://koji.fedoraproject.org/koji/taskinfo?taskID=2580342

Comment 19 Simon Andrews 2010-11-08 08:58:52 UTC
No dice with 6.3 either I'm afraid...

$ embossversion
Reports the current EMBOSS version number
6.2.0


$ tfm seqret
Displays full documentation for an application
Died: No documentation found in /usr/share/EMBOSS/doc/ for program 'seqret'.



$ sudo yum --nogpgcheck localinstall EMBOSS-6.3.1-6.fc13.i686.rpm EMBOSS-libs-6.3.1-6.fc13.i686.rpm

Dependency Installed:
  libharu.i686 0:2.1.0-2.fc13

Updated:
  EMBOSS.i686 0:6.3.1-6.fc13                                            
  EMBOSS-libs.i686 0:6.3.1-6.fc13

Complete!

$ tfm seqret
Segmentation fault

Comment 20 Fedora Update System 2010-11-10 20:45:44 UTC
EMBOSS-6.3.1-7.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/EMBOSS-6.3.1-7.fc13

Comment 21 Fedora Update System 2010-11-10 20:45:52 UTC
EMBOSS-6.3.1-7.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/EMBOSS-6.3.1-7.fc14

Comment 22 Tom "spot" Callaway 2010-11-10 20:46:50 UTC
Please try these updates, I'm pretty darned sure that I've solved both problems, thanks to some generous help from upstream. :)

Comment 23 Simon Andrews 2010-11-11 08:29:29 UTC
We have a winner!

$ tfm seqret
Displays full documentation for an application
Died: No documentation found in /usr/share/EMBOSS/doc/ for program 'seqret'.

$ sudo yum --nogpgcheck localinstall EMBOSS-*rpm

Dependency Installed:
libharu.i6860:2.1.0-2.fc13                                                      

Updated:
EMBOSS.i686 0:6.3.1-7.fc13
EMBOSS-libs.i686 0:6.3.1-7.fc13                    

$ tfm seqret
Displays full documentation for an application

                                   seqret

Function

   Reads and writes (returns) sequences

Comment 24 Fedora Update System 2010-11-19 22:32:49 UTC
EMBOSS-6.3.1-7.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2010-11-19 22:36:30 UTC
EMBOSS-6.3.1-7.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.