ocamlrpcgen no longer works on Gutsy. Probably a wrongly stripped binary
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| ocamlnet (Ubuntu) |
Undecided
|
Martin Pitt | ||
| pkg-create-dbgsym (Ubuntu) |
Undecided
|
Martin Pitt |
Bug Description
Hello,
The command line options of ocamlrpcgen (from libocamlnet-
$ ocamlrpcgen -cpp none -int unboxed -hyper int64 -aux net/messages.xdr
Unknown option -cpp.
$ ocamlrpcgen -int unboxed -hyper int64 -aux net/messages.xdr
Unknown option -int.
$ ocamlrpcgen -hyper int64 -aux net/messages.xdr
Unknown option -hyper.
After a post on <email address hidden> mailing list, it seems that this is due to a wrongly stripped binary. OCaml binaries should *never* been stripped because strip removes the embedded bytecode.
http://
This is confirmed by following command:
$ ocamlrpcgen net/messages.xdr
Fatal error: the file net/messages.xdr is not a bytecode executable file
Currently libocamlnet-
Yours,
d.
Related branches
David MENTRÉ (dmentre) wrote : | #1 |
Michael Bienia (geser) wrote : | #2 |
Can you provide a test file so I can check if it's fixed in hardy? (I'm no ocaml programmer).
David MENTRÉ (dmentre) wrote : | #3 |
Here is a test file. Use it with following command line:
ocamlrpcgen -cpp none -int unboxed -hyper int64 -aux messages.xdr
It should produce several messages_*.ml and messages_*.mli files.
Martin Pitt (pitti) wrote : | #4 |
Seems that merely adding a .gnu_debuglink ELF section breaks the binaries. Meh :/
We need to fix that in pkg-create-dbgsym. There needs to be a robust way to detect such a binary. Do they have a special section (objdump -x or readelf -h)?
Changed in pkg-create-dbgsym: | |
assignee: | nobody → pitti |
status: | New → In Progress |
Martin Pitt (pitti) wrote : | #5 |
seems that this is a working test:
objdump -x binary | grep -qw caml_release_
Martin Pitt (pitti) wrote : | #6 |
objdump -t binary is sufficient, too.
David MENTRÉ (dmentre) wrote : | #7 |
Hello Martin,
I've asked to OCaml developers. Xavier Leroy, lead OCaml developer, told me that:
* the "objdump -x binary | grep -qw caml_release_
* it would be better also to test an OCaml magic number at the last 12 bytes of the binary. The magic pattern to match is "Caml1999X[
tail -c 12 | egrep -q "Caml1999X[
should do the trick.
Yours,
d.
Martin Pitt (pitti) wrote : | #8 |
I think I'll fix this completely differently: I'll fix the dh_strip wrapper to pass the set of ignored files (-X file) to pkg_create_dbgsym, and have that one not touch any ignored file.
David MENTRÉ (dmentre) wrote : Re: [Bug 180364] Re: ocamlrpcgen no longer works on Gutsy. Probably a wrongly stripped binary | #9 |
Hello Martin,
2008/1/14, Martin Pitt <email address hidden>:
> I think I'll fix this completely differently: I'll fix the dh_strip
> wrapper to pass the set of ignored files (-X file) to pkg_create_dbgsym,
> and have that one not touch any ignored file.
Should this list of ignored files be manually updated or is it an
automatic process?
Let me know if I can test new packages.
Yours,
d.
Michael Bienia (geser) wrote : | #10 |
The package specifies already that usr/bin/
The fix is now to pass this information to pkg_create_dbgsym so it doesn't try to add that link to the debug symbols for package which are stripped later anyway.
Once pkg_create_dbgsym is fixed, a (no-change) rebuild of ocamlnet is necessary to fix the package too.
Martin Pitt (pitti) wrote : | #11 |
Will do a no-change upload once the fixed pkg-create-dbgsym is built and in the archive.
Changed in ocamlnet: | |
assignee: | nobody → pitti |
status: | New → In Progress |
Launchpad Janitor (janitor) wrote : | #12 |
This bug was fixed in the package pkg-create-dbgsym - 0.24
---------------
pkg-create-dbgsym (0.24) hardy; urgency=low
* Add tests/dhtest.
that the file isn't touched by dh_strip. This reproduces LP #180364.
* Parse dh_strip's -X options in the wrapper and pass them to
pkg_
avoids adding GNU debuglinks to ELF binaries which must not be touched at
all, like Ocaml bytecode. (LP: #180364)
* tests/run: Do not expect a dbgsym package for test .debs with 'nostrip' in
the name (as used by the tests/dhtest.
-- Martin Pitt <email address hidden> Thu, 21 Feb 2008 17:55:07 +0100
Changed in pkg-create-dbgsym: | |
status: | In Progress → Fix Released |
Launchpad Janitor (janitor) wrote : | #13 |
This bug was fixed in the package ocamlnet - 2.2.8.1-1build1
---------------
ocamlnet (2.2.8.1-1build1) hardy; urgency=low
* No-change rebuild against fixed pkg-create-dbgsym. (LP: #180364)
-- Martin Pitt <email address hidden> Fri, 22 Feb 2008 12:08:34 +0100
Changed in ocamlnet: | |
status: | In Progress → Fix Released |
David MENTRÉ (dmentre) wrote : | #14 |
Hello,
Launchpad Bug Tracker <email address hidden> writes:
> This bug was fixed in the package ocamlnet - 2.2.8.1-1build1
Unfortunatly, the bug is not fixed.
Even with package version 2.2.8.1-1build1, program ocamlrpcgen is still
broken. :-(
(hardy-
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Description
+++-===
ii libocamlnet-ocaml 2.2.8.1-1build1 OCaml application-level Internet libraries - core runtime librar
ii libocamlnet-
ii libocamlnet-
un libocamlnet-
(hardy-
No bytecode file specified.
(hardy-
Unknown option --help.
Here is the expected behavior (in Debian Etch):
(etch-chroot)
usage: ocamlrpcgen [-aux] [-clnt] [-srv]
[...]
Sincerely yours,
david
--
GPG/PGP key: A3AD7A2A -- <email address hidden>
5996 CC46 4612 9CA4 3562 D7AC 6C67 9E96 A3AD 7A2A
Martin Pitt (pitti) wrote : | #15 |
Not quite fixed yet, pkg-create-dbgsym needs to get along with spaces between -X and the pattern.
Changed in pkg-create-dbgsym: | |
status: | Fix Released → In Progress |
Changed in ocamlnet: | |
status: | Fix Released → In Progress |
Launchpad Janitor (janitor) wrote : | #16 |
This bug was fixed in the package pkg-create-dbgsym - 0.25
---------------
pkg-create-dbgsym (0.25) hardy; urgency=low
* tests/dhtest.
a space between -X and the argument. This reproduces the followup problem
in LP #180364.
* dh_strip: Fix option parsing to get along with spaces between -X and the
argument. (LP: #180364)
-- Martin Pitt <email address hidden> Tue, 26 Feb 2008 16:05:28 +0100
Changed in pkg-create-dbgsym: | |
status: | In Progress → Fix Released |
Launchpad Janitor (janitor) wrote : | #17 |
This bug was fixed in the package ocamlnet - 2.2.8.1-1build2
---------------
ocamlnet (2.2.8.1-1build2) hardy; urgency=low
* No-change rebuild against even more fixed pkg-create-dbgsym. (LP: #180364)
-- Martin Pitt <email address hidden> Wed, 27 Feb 2008 11:26:35 +0100
Changed in ocamlnet: | |
status: | In Progress → Fix Released |
David MENTRÉ (dmentre) wrote : | #18 |
Hello,
Launchpad Bug Tracker <email address hidden> writes:
> This bug was fixed in the package ocamlnet - 2.2.8.1-1build2
I confirm the bug is fixed in this package. Many thanks Martin!
Yours,
d.
--
GPG/PGP key: A3AD7A2A -- <email address hidden>
5996 CC46 4612 9CA4 3562 D7AC 6C67 9E96 A3AD 7A2A
A Debian developer (Stefano Zacchiroli) suggested that the unneeded strip was done at package building: http:// lists.debian. org/debian- ocaml-maint/ 2008/01/ msg00061. html
Unfortunately, after looking at the .deb patch applied to the original package (http:// archive. ubuntu. com/ubuntu/ pool/universe/ o/ocamlnet/ ocamlnet_ 2.2.7-1. diff.gz), the Ubuntu package seems to have the relevant DEB_STRIP_EXCLUDE lines: netplex- admin # OCaml custom bytecode binaries can't be striped
+DEB_STRIP_EXCLUDE += usr/bin/
+DEB_STRIP_EXCLUDE += usr/bin/ocamlrpcgen
So maybe the stripping is done at another level or the DEB_STRIP_EXCLUDE rule is not taken into account. I don't know.