#892548 dhelp: /usr/sbin/dhelp_parse broken with ruby 2.5

Package:
dhelp
Source:
dhelp
Submitter:
gregor herrmann
Date:
2025-06-11 17:37:02 UTC
Severity:
important
#892548#5
Date:
2018-03-10 13:33:34 UTC
From:
To:
After the upgrade from ruby 2.3 to 2.5, /usr/sbin/dhelp_parse fails:


# sh -x /etc/cron.weekly/dhelp
+ '[' -d /var/lib/dhelp ']'
+ '[' -x /usr/sbin/dhelp_parse ']'
+ '[' -x /usr/bin/index++ ']'
+ rm --force /var/lib/dhelp/documents.index
+ /usr/sbin/dhelp_parse -r
Traceback (most recent call last):
	5: from /usr/sbin/dhelp_parse:32:in `<main>'
	4: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	3: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	2: from /usr/lib/ruby/vendor_ruby/dhelp.rb:21:in `<top (required)>'
	1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- dbm (LoadError)
+ /usr/sbin/dhelp_parse -i
Traceback (most recent call last):
	5: from /usr/sbin/dhelp_parse:32:in `<main>'
	4: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	3: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	2: from /usr/lib/ruby/vendor_ruby/dhelp.rb:21:in `<top (required)>'
	1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- dbm (LoadError)



Cheers,
gregor



- -- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'unstable-debug'), (500, 'oldoldstable'), (500, 'experimental'), (500, 'testing'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_AT.utf8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages dhelp depends on:
ii  doc-base                0.10.8
ii  libcgi-pm-perl          4.38-1
ii  libdata-page-perl       2.02-1
ii  libhtml-parser-perl     3.72-3+b2
ii  liblocale-gettext-perl  1.07-3+b3
ii  libtemplate-perl        2.24-1.2+b5
ii  liburi-perl             1.73-1
ii  perl                    5.26.1-5
ii  poppler-utils           0.62.0-2
ii  pstotext                1.9-6+b2
ii  ruby                    1:2.5.0
ii  ruby-debian             0.3.9+b7
ii  ruby-gettext            3.2.4-1
ii  swish++                 6.1.5-5
ii  ucf                     3.0038

dhelp recommends no packages.

Versions of packages dhelp suggests:
pn  catdvi                  <none>
ii  chromium [www-browser]  64.0.3282.119-2+b2
ii  elinks [www-browser]    0.12~pre6-13
ii  firefox [www-browser]   58.0.1-1+b1
ii  html2text               1.3.2a-21
pn  httpd-cgi               <none>
pn  info2www                <none>
ii  lynx [www-browser]      2.8.9dev16-3
pn  man2html                <none>
ii  w3m [www-browser]       0.5.3-36

- -- no debconf information
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEE0eExbpOnYKgQTYX6uzpoAYZJqgYFAlqj3qpfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEQx
RTEzMTZFOTNBNzYwQTgxMDREODVGQUJCM0E2ODAxODY0OUFBMDYACgkQuzpoAYZJ
qgaXmA//UUbajGicQrfaab3ELRpxO33bif0LRxP6Zlps9CHvKQa0D4I8d6EwsoUo
ENTmHDhKBiwG05q+374BGXbekdOD+HlMAHN1qVcQVQiLuavzock7uescLmJTkNZV
l48sFXrJpEAtr6BlXSmQ4vMa9bKUPYkE9oxjmVpQ3j+5/XuCxc1PnviZDymW1g4Q
SsEoJZ3WhJrh0PmbtXIH5eKeiofUvGGC0cIrZ2Ppv+ogd2fzzTfuy6XHqFnGS+ix
eEpD6ZEjiSFq7EMzKM0Apenxgg4qtZ+fmSIbkEORPUvQUdm3p3Y73WyDPYNmEJX0
qSPJ6dwTpaEIrFe1xpOJx9RXnDEUWou1fdSqrv7GRE3yQprRynl6MsHltAdLH1PI
a5KzCXjv48Stij2y/2OVUbmHJ3/2mu7k3KWXaIbx4SoaQUUrH3ebKNRap7+Of3vw
eJBmy1JiysVVuUrvdrAsbHYGpSj3/7hUhm5R383yqp1//RKrZxH/iJ3Q2RDSVV/H
Rq+klpYT4A7Xkfgum7AD7CVnhu/Vz6bge3b1tCf1trAtpjCNcRYiX/qoU6x7Dgya
Q4QeqyhsExRzoHdU9a9EZd9McN40Bc3fFA6QMnITTyrIUvAVUV5PUvDEBjW/GcJU
yxeS6GIDwnEODvuIosOrN23VLVsuMSqdqDEgEX5WOQINDOAhjNg=
=JTAF
-----END PGP SIGNATURE-----

#892548#10
Date:
2018-04-03 21:48:59 UTC
From:
To:
Unfortunately, I can't reproduce this error. However, I've faced the
other error related to dhelp's cron script. It fails to build a document
index, and so search doesn't work. But at least the dhelp_parse utility
can rebuild its documentation directory, and a home page is still
available. It seems some of the next warnings aren't linked to dhelp.

But these issues are already reported, see Bug#803342 and Bug#889651.

(dhelp)root@barberry:/# sh -x /etc/cron.weekly/dhelp
+ [ -d /var/lib/dhelp ]
+ [ -x /usr/sbin/dhelp_parse ]
+ [ -x /usr/bin/index++ ]
+ rm --force /var/lib/dhelp/documents.index
+ /usr/sbin/dhelp_parse -r
/usr/lib/ruby/vendor_ruby/debian.rb:223: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:224: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:227: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:230: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:233: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:236: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:348: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:557: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:577: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:578: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:743: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:753: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:763: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:772: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:799: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:1004: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
+ /usr/sbin/dhelp_parse -i
/usr/lib/ruby/vendor_ruby/debian.rb:223: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:224: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:227: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:230: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:233: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:236: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:348: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:557: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:577: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:578: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:743: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:753: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:763: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:772: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:799: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
/usr/lib/ruby/vendor_ruby/debian.rb:1004: warning: parentheses after
method name is interpreted as an argument list, not a decomposed argument
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::erase: __pos (which is 18446744073709551615) >
this->size() (which is 8)
Dhelp::IndexerError: Couldn't index
/usr/share/doc/base-passwd/users-and-groups.html
, /usr/share/doc/base-passwd/users-and-groups.html
, /usr/share/doc/base-passwd/users-and-groups.txt.gz
, /usr/share/doc/man-db/man-db-manual.ps.gz
, /usr/share/doc/man-db/man-db-manual.txt.gz
, /usr/share/doc/doc-base/doc-base.html/about.html
, /usr/share/doc/doc-base/doc-base.html/index.html
, /usr/share/doc/doc-base/doc-base.html/informations.html
, /usr/share/doc/doc-base/doc-base.html/interface.html
, /usr/share/doc/doc-base/doc-base.html/todo.html
, /usr/share/doc/doc-base/doc-base.html/index.html
, /usr/share/doc/doc-base/doc-base.txt.gz
, /usr/share/doc/nano/faq.html
, /usr/share/doc/nano/faq.html
, /usr/share/doc/doc-base/install-docs.html
, /usr/share/doc/doc-base/install-docs.html
, /usr/share/doc/libpng16-16/libpng-manual.txt.gz
, /usr/share/doc/po-debconf/manpages.vi/debconf-gettextize.1.html
, /usr/share/doc/po-debconf/manpages.vi/debconf-updatepo.1.html
, /usr/share/doc/po-debconf/manpages.vi/po-debconf.7.html
, /usr/share/doc/po-debconf/manpages.vi/po2debconf.1.html
, /usr/share/doc/po-debconf/manpages.vi/podebconf-display-po.1.html
, /usr/share/doc/po-debconf/manpages.vi/podebconf-report-po.1.html
 using /usr/bin/index++ --config-file
/usr/share/dhelp/config/swish++.conf --index-file
/var/lib/dhelp/documents.index --follow-links -
(/usr/lib/ruby/vendor_ruby/dhelp.rb:616:in `index'
/usr/sbin/dhelp_parse:171:in `do_deferred_indexing'
/usr/sbin/dhelp_parse:205:in `main'
/usr/sbin/dhelp_parse:221:in `<main>')
(dhelp)root@barberry:/#

#892548#17
Date:
2018-04-04 21:14:34 UTC
From:
To:
tags 892548 - unreproducible
reassign 892548 libruby2.5
forcemerge 892099 892548
stop

It appears the bug with very similar issue was fixed in the libruby2.5
package so I merge these bugs. If your error still exists, let us know.

#892548#42
Date:
2018-04-04 21:30:11 UTC
From:
To:
Indeed, I can confirm that "my" original output is gone, and I now
see what you've copied below.

Cheers,
gregor

#892548#47
Date:
2018-04-05 11:22:44 UTC
From:
To:
Control: unmerge 892548
Control: reassign 892548 dhelp

From that output my evaluation is that dhelp has issues with ruby2.5,
even after the lack of dbm support has been fixed. I'm returning this
bug to dhelp.

#892548#62
Date:
2019-12-29 21:18:49 UTC
From:
To:
I have librunby2.5, version 2.5.7-1. This is on testing updated most
days.

# /usr/sbin/dhelp_parse -i
index++: error: could not read index from
"/var/lib/dhelp/documents.index": No data available
Dhelp::IndexerError: Couldn't index  using /usr/bin/index++
--config-file /usr/share/dhelp/config/swish++.conf --index-file
/var/lib/dhelp/documents.index --follow-links --incremental -
(/usr/lib/ruby/vendor_ruby/dhelp.rb:616:in `index'
/usr/sbin/dhelp_parse:171:in `do_deferred_indexing'
/usr/sbin/dhelp_parse:205:in `main'
/usr/sbin/dhelp_parse:221:in `<main>')

#892548#67
Date:
2025-06-11 17:36:04 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?

I just looked at my mail sent by cron which show me error messages each week.

When I tried the commands it seems the trouble comes from the
`/usr/sbin/dhelp_parse -i` call in `/etc/cron.weekly/dhelp`.

Here is the output when I try it on my box (full output is attached):

```
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::erase: __pos (which is 18446744073709551615) >
this->size() (which is 6)
Dhelp::IndexerError: Broken pipe indexing /usr/share/doc/git-
doc/technical/shallow.txt
, /usr/share/doc/weechat-doc/html/weechat_quickstart.es.html
, /usr/share/doc/weechat-doc/html/weechat_quickstart.es.html
, /usr/share/doc/bogofilter-common/bogotune-faq.html
, /usr/share/doc/bogofilter-common/bogotune-faq.html
[...] a lot of similar lines are cut here
, /usr/share/doc/exim4-base/README.Debian.html
, /usr/share/doc/exim4-base/README.Debian.html
, /usr/share/doc/ocl-icd-libopencl1/html/libOpenCL.html
, /usr/share/doc/ocl-icd-libopencl1/html/libOpenCL.html
, /usr/share/doc/bogofilter-common/bogofilter-tuning.HOWTO.html
, /usr/share/doc/bogofilter-common/bogofilter-tuning.HOWTO.html
, using /usr/bin/index++ --config-file /usr/share/dhelp/config/swish++.conf
--index-file /var/lib/dhelp/documents.index --follow-links -
(/usr/lib/ruby/vendor_ruby/dhelp.rb:612:in `rescue in index'
/usr/lib/ruby/vendor_ruby/dhelp.rb:605:in `index'
/usr/sbin/dhelp_parse:171:in `do_deferred_indexing'
/usr/sbin/dhelp_parse:205:in `main'
/usr/sbin/dhelp_parse:221:in `<main>')
```

That command should not produce any errors.

Moreover I guess the cron script should not produce any output in case
everything is running fine so that no mail should be sent.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

Nothing I tried so far solve the problem.


*** End of the template - remove these template lines ***