Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 306445 - app-text/pinfo-0.6.9 fails for some items
Summary: app-text/pinfo-0.6.9 fails for some items
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL: https://alioth.debian.org/tracker/ind...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-22 21:04 UTC by Hartmut Figge
Modified: 2011-01-04 16:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
`strace -f -o pinfo-gnus.strace pinfo gnus' (pinfo-gnus.strace,32.63 KB, text/plain)
2010-10-06 16:52 UTC, Jeroen Roovers (RETIRED)
Details
`strace -f -o pinfo-gnus.strace pinfo gnus-1' (pinfo-gnus-1.strace,57.41 KB, text/plain)
2010-10-06 17:17 UTC, Jeroen Roovers (RETIRED)
Details
gdb output (gdb.out,1.14 KB, text/plain)
2010-10-07 08:27 UTC, Ulrich Müller
Details
pinfo-0.6.9-info-suffix.patch (pinfo-0.6.9-info-suffix.patch,993 bytes, patch)
2010-10-12 15:10 UTC, Ulrich Müller
Details | Diff
strace -f -o pinfo-gnus.strace1 pinfo gnus (pinfo-gnus.strace1,53.34 KB, text/plain)
2010-11-02 23:19 UTC, Jeroen Roovers (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hartmut Figge 2010-02-22 21:04:18 UTC
Calling pinfo with e.g. 'pinfo gnus' results in 'Error: could not open info file'. Same for e.g. emacs or elisp. Or just open pinfo, navigate to e.g. gnus and try to open with Cursor Right.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-06 16:52:14 UTC
Created attachment 249765 [details]
`strace -f -o pinfo-gnus.strace pinfo gnus'
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-06 16:56:34 UTC
Looks like app-editors/emacs is the only package that installs info files into /usr/share/info/{EMACS_VERSION}/ in order to separate info files for specific versions. Let's have a word about how we can still open those.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-06 17:17:33 UTC
Created attachment 249766 [details]
`strace -f -o pinfo-gnus.strace pinfo gnus-1'
Comment 4 Ulrich Müller gentoo-dev 2010-10-06 17:29:49 UTC
Nope, binutils and gcc also do that, and /usr/share/info/{EMACS_VERSION} is in INFOPATH.

Looks like it fails only for Info manuals split into several files, whereas for single-file manuals like "cl" and "semantic" it works properly.
Comment 5 Ulrich Müller gentoo-dev 2010-10-06 19:12:04 UTC
I did some debugging of pinfo with gdb. The problem is the following:

Emacs generates split info files that are just named "gnus", "gnus-1", "gnus-2" etc. In the emacs ebuild, we rename them to "gnus.info", "gnus-1.info", "gnus-2.info" etc. However, the reference table in gnus.info will still look like this:

   gnus-1: 979
   gnus-2: 300442

i.e. the file names appear there without the ".info" suffix. (We cannot simply patch this table because the numbers are character positions that would be shifted.)

For both info included in Emacs and for standalone /usr/bin/info this don't matter, because they retrofit the filename with the .info suffix. Looks like pinfo doesn't do that. The relevant function in pinfo is "openinfo" in filehandling_functions.c.

Now the question is if it should be fixed in emacs or in pinfo? The emacs ebuilds are renaming the GNU Info files since ages:
<http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-editors/emacs-nogui/emacs-nogui-20.7-r1.ebuild?hideattic=0&revision=1.1&view=markup>

I'll check if the renaming is still necessary. (It maybe a bit hard to find out why they did that change. It precedes both Bugzilla and ChangeLogs. ;-)
Comment 6 Hartmut Figge 2010-10-07 07:51:04 UTC
(In reply to comment #5)

> Now the question is if it should be fixed in emacs or in pinfo?

Well, though 'pinfo' fails, 'info' does not. ;) So the relevant difference should be searched and applied to pinfo.
Comment 7 Ulrich Müller gentoo-dev 2010-10-07 08:27:12 UTC
Created attachment 249822 [details]
gdb output

Related problem: I've done some tests with extensionless Info files (like /usr/share/info/gnus or /usr/share/info/gnus.bz2), but pinfo-0.6.9 terminates with a segmentation fault. See attached gdb output.

According to pinfo's NEWS file, they are supported:

0.5.0
  Added support for infos not ending with `.info*' suffix

And indeed, the previous version pinfo-0.6.8 works flawlessly with such files.
Comment 8 Ulrich Müller gentoo-dev 2010-10-08 23:04:45 UTC
(In reply to comment #7)
> Related problem: I've done some tests with extensionless Info files
> (like /usr/share/info/gnus or /usr/share/info/gnus.bz2), but pinfo-0.6.9
> terminates with a segmentation fault.

I've bisected the upstream repo. The breakage was caused by this commit: <http://svn.debian.org/wsvn/pinfo/?op=comp&compare%5B%5D=%2Fpinfo%2Ftrunk@178&compare%5B%5D=%2Fpinfo%2Ftrunk@179>
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-11 20:12:36 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Related problem: I've done some tests with extensionless Info files
> > (like /usr/share/info/gnus or /usr/share/info/gnus.bz2), but pinfo-0.6.9
> > terminates with a segmentation fault.

Ouch. Maybe that's cause for another bug report, but it's basically not a Gentoo problem (in the default configuration, you always get your info files compressed).

> I've bisected the upstream repo. The breakage was caused by this commit:
> <http://svn.debian.org/wsvn/pinfo/?op=comp&compare%5B%5D=%2Fpinfo%2Ftrunk@178&compare%5B%5D=%2Fpinfo%2Ftrunk@179>

Thank you for your great analysis. Looks like that's a similar approach to a solution, namely that it works on Debian, so it ought to be the correct fix. 

(In reply to comment #6)
> (In reply to comment #5)
> 
> > Now the question is if it should be fixed in emacs or in pinfo?
> 
> Well, though 'pinfo' fails, 'info' does not. ;) So the relevant difference
> should be searched and applied to pinfo.

tkinfo succeeds. tkman fails to find `gnus' as well. But tkman has more problems than just this one.
Comment 10 Ulrich Müller gentoo-dev 2010-10-11 21:03:40 UTC
(In reply to comment #9)
> > > Related problem: I've done some tests with extensionless Info files
> > > (like /usr/share/info/gnus or /usr/share/info/gnus.bz2), but pinfo-0.6.9
> > > terminates with a segmentation fault.
> 
> Ouch. Maybe that's cause for another bug report, but it's basically not a
> Gentoo problem (in the default configuration, you always get your info files
> compressed).

Sorry, I shouldn't have said "extensionless" above. What I meant was "without .info extension". pinfo-0.6.9 doesn't find gnus.bz2 either (while 0.6.8 does).

In fact, all other distributions that I've looked at (Debian, Fedora, OpenSuSE, Mandriva) install Emacs's Info files without the .info extension. Therefore I think that's the way to go for us.

> tkinfo succeeds. tkman fails to find `gnus' as well. But tkman has more
> problems than just this one.

Texinfo documentation explicitly allows both:
,----
| There are two conventions for choosing the name: you can either remove
| the extension (such as `.texi') entirely from the input file name, or,
| preferably, replace it with the `.info' extension.
`----

So programs that cannot handle both conventions should be fixed, IMO.
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-12 00:26:12 UTC
(In reply to comment #10)
> > Ouch. Maybe that's cause for another bug report, but it's basically not a
> > Gentoo problem (in the default configuration, you always get your info files
> > compressed).
> 
> Sorry, I shouldn't have said "extensionless" above. What I meant was "without
> .info extension". pinfo-0.6.9 doesn't find gnus.bz2 either (while 0.6.8 does).

Ah OK.

> In fact, all other distributions that I've looked at (Debian, Fedora, OpenSuSE,
> Mandriva) install Emacs's Info files without the .info extension. Therefore I
> think that's the way to go for us.

That's even more puzzling then - it was Debian's alioth upstream that changed this. 8-)

The [URL] points to a Debian bug report where `pinfo texinfo' defaults to the man page because it cannot find an info file.
Comment 12 Ulrich Müller gentoo-dev 2010-10-12 15:10:47 UTC
Created attachment 250365 [details, diff]
pinfo-0.6.9-info-suffix.patch

This should fix the issue from comment #7.
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-24 18:06:58 UTC
Even more upstream than [1]. Includes a patch. Has maintainer questioning why opening info files without .info filename extension would be useful. :)

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=496840
Comment 14 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-25 04:16:18 UTC
(In reply to comment #13)
> Even more upstream than [1]. Includes a patch. Has maintainer questioning why
> opening info files without .info filename extension would be useful. :)
> 
> [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=496840

With that patch on top of what we already have, it tries to look for paths like

 /usr/share/info/emacs-23/gnus.xz.info.bz2

when what I have is:

 /usr/share/info/emacs-23/gnus.info.bz2
Comment 15 Ulrich Müller gentoo-dev 2010-10-25 05:19:10 UTC
That patch also tries to access() each file candidate, instead of using readdir() and comparing the filenames. So I guess my patch is better. :)

@jer: Do you want to wait for a reaction from upstream?
Comment 16 Ulrich Müller gentoo-dev 2010-10-29 05:40:20 UTC
To clarify, following our discussion on irc: We have two separate issues here, an emacs issue and a pinfo issue.
- The first issue is that the emacs ebuilds used to install split info files
  under names like gnus-1.info while it should be either gnus-1 or gnus.info-1
  (plus a compression suffix if necessary). This has already been taken care of
  in the emacs ebuilds.
- The second (and IMHO the main) issue is the one from comment #7 and #311515
  on alioth: pinfo doesn't find info files without .info extension. My patch
  attached in comment #12 should fix it.
Comment 17 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-02 20:13:32 UTC
(In reply to comment #16)
> - The first issue is that the emacs ebuilds used to install split info files
>   under names like gnus-1.info while it should be either gnus-1 or gnus.info-1
>   (plus a compression suffix if necessary). This has already been taken care of
>   in the emacs ebuilds.

I don't think we should fix that. As the reporter and two more users of non-Debian systems confirmed, info files get installed without the filename suffix, and texinfo supports that so we should fix pinfo instead, as should UPSTREAM.

> - The second (and IMHO the main) issue is the one from comment #7 and #311515
>   on alioth: pinfo doesn't find info files without .info extension. My patch
>   attached in comment #12 should fix it.

I have applied that in -r1. Thanks for the patch!
Comment 18 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-02 23:18:25 UTC
8930  open("/usr/share/info/emacs-23/gnus-1", O_RDONLY) = -1 ENOENT (No such file or dir
ectory)
8930  open("/usr/share/info/emacs-23/gnus-1.gz", O_RDONLY) = -1 ENOENT (No such file or
directory)
8930  open("/usr/share/info/emacs-23/gnus-1.Z", O_RDONLY) = -1 ENOENT (No such file or d
irectory)
8930  open("/usr/share/info/emacs-23/gnus-1.bz2", O_RDONLY) = -1 ENOENT (No such file or
 directory)
8930  open("/usr/share/info/emacs-23/gnus-1.lzma", O_RDONLY) = -1 ENOENT (No such file o
r directory)
8930  open("/usr/share/info/emacs-23/gnus-1.xz", O_RDONLY) = -1 ENOENT (No such file or
directory)
Comment 19 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-02 23:19:42 UTC
Created attachment 252975 [details]
strace -f -o pinfo-gnus.strace1 pinfo gnus
Comment 20 Ulrich Müller gentoo-dev 2010-11-02 23:58:26 UTC
(In reply to comment #18)
> 8930  open("/usr/share/info/emacs-23/gnus-1", O_RDONLY) = -1 ENOENT (No such
> file or directory)
> [5 similar messages deleted]

This is with app-editors/emacs-23.2, I suppose? Please try with 23.2-r2 instead.
Comment 21 Jeroen Roovers (RETIRED) gentoo-dev 2011-01-04 16:49:56 UTC
(In reply to comment #20)
> (In reply to comment #18)
> > 8930  open("/usr/share/info/emacs-23/gnus-1", O_RDONLY) = -1 ENOENT (No such
> > file or directory)
> > [5 similar messages deleted]
> 
> This is with app-editors/emacs-23.2, I suppose? Please try with 23.2-r2
> instead.

OK, that works. Fixed then.