[MDEV-572] No debug symbols for Ubuntu packages Created: 2012-10-03  Updated: 2015-12-20  Resolved: 2015-01-06

Status: Closed
Project: MariaDB Server
Component/s: Packaging
Affects Version/s: 5.5.27
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Sergei Petrunia Assignee: Otto Kekäläinen
Resolution: Duplicate Votes: 1
Labels: packaging
Environment:

Ubuntu 12.04 Precise Pangolin, deb packages


Attachments: File mdev-572.patch    
Issue Links:
Blocks
is blocked by MDEV-3809 Change Debian packaging to use CPack ... Stalled
Duplicate
is duplicated by MDEV-658 LP:842688 - Ubuntu and packages don't... Closed

 Description   

MariaDB 12.04 packages install a stripped binary:

/usr/sbin/mysqld: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x16b84c98034eb05e6b35fe977237b6fe7a40c11a, stripped

I have downloaded/unpacked all the available .deb packages, and failed to find anything resembling debug symbols.



 Comments   
Comment by Sergei Petrunia [ 2012-10-03 ]

Looking at how .debs are made: http://buildbot.askmonty.org/buildbot/builders/kvm-deb-precise-amd64/builds/371/steps/compile/logs/stdio, one can see that

  • they are made with "bakery" (and not CMake's CPack)
  • there is a line there:

strip --remove-section=.comment --remove-section=.note debian/mariadb-server-core-5.5/usr/sbin/mysqld

which looks like stripping the mysqld binary. Debug symbols are not saved anywhere.

Comment by Sergei Petrunia [ 2012-10-03 ]

Note that debug symbols are huge. On my system:

mysqld, stripped - 14M (4.5M gzipped)
mysqld, not stripped - 140M (49M gzipped)
debug symbols only - 126M (45M gzipped)

this means - debug symbols are 10x the stripped symbols, both in package size and size of the binary.

On the other hand, we DO NEED debug info, at least for the mysqld binary. Maybe, we should have a separate -debuginfo package? (I think fedora has them for every rpm?)

Comment by Sergei Petrunia [ 2012-10-03 ]

Just checked binaries for Fedora (file names like MariaDB-5.5.27-centos6-x86_64-server.rpm) - the binaries are not stripped.

Comment by Sergei Golubchik [ 2012-10-03 ]

I've just checked few other random binaries from /usr/bin on hasky (Ubuntu) - they were all stripped. I suppose it's normal for this platform to install stripped binaries. And we should follow the distribution specific conventions.

Comment by Sergei Petrunia [ 2012-10-03 ]

It is normal for distributions to install stripped binaries. I would argue, though, that MariaDB (and MySQL) are special. Community of /usr/bin/bash users does not develop tools like PMP. Community of MySQL users did invent that tool and is using it.

Comment by Sergei Petrunia [ 2012-10-03 ]

Btw, debug builds for PostgreSQL are available:

root@smalltoy2:~# apt-cache search postgresql-9.1
postgresql-9.1 - object-relational SQL database, version 9.1 server
postgresql-9.1-dbg - debug symbols for postgresql-9.1
...
root@smalltoy2:~# dpkg-query -L postgresql-9.1-dbg | grep 'postgres$'
/usr/lib/debug/usr/lib/postgresql/9.1/bin/postgres
root@smalltoy2:~# file /usr/lib/debug/usr/lib/postgresql/9.1/bin/postgres
/usr/lib/debug/usr/lib/postgresql/9.1/bin/postgres: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x8be4c9e7620d6efb24e4e278e45d6c53f00a9776, not stripped

Comment by Sergei Petrunia [ 2012-10-03 ]

http://askubuntu.com/questions/53708/how-to-create-debuginfo-package

Comment by Jean Weisbuch [ 2012-10-04 ]

Its the same for official MySQL packages on Debian Squeeze, no debugging symols and no -dbg package available.

Comment by Rene Treffer [ 2013-06-26 ]

I'm hitting the same problem. Debug symbols are needed for profiling. I'll try to build from source to preserve the debug symbols.

Comment by Elena Stepanova [ 2013-06-26 ]

Hi,

You can also try the binary tarball available at the downloads page. It shouldn't be stripped.

Comment by Rene Treffer [ 2013-06-26 ]

Dislike. I prefer to install/uninstall via dpkg/apt. Anyway, building a dbg package is easy if you do not need it per lib/binary.

=== modified file 'debian/dist/Ubuntu/control'
--- debian/dist/Ubuntu/control  2013-06-06 19:32:29 +0000
+++ debian/dist/Ubuntu/control  2013-06-26 13:45:22 +0000
@@ -195,6 +195,19 @@
  .
  This package includes the server binaries.
 
+Package: mariadb-server-10.0-dbg
+Architecture: any
+Section: debug
+Priority: extra
+Depends: mariadb-server-10.0 (= ${binary:Version}), mariadb-server-core-10.0 (= ${binary:Version})
+Description: Debug symbols for the MariaDB database server
+ MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
+ server. SQL (Structured Query Language) is the most popular database query
+ language in the world. The main goals of MariaDB are speed, robustness and
+ ease of use.
+ .
+ This package includes the debug symbols.
+
 Package: mariadb-server
 Section: database
 Architecture: all
 
=== modified file 'debian/dist/Ubuntu/rules'
--- debian/dist/Ubuntu/rules    2013-01-31 08:48:19 +0000
+++ debian/dist/Ubuntu/rules    2013-06-26 13:55:09 +0000
@@ -252,7 +252,7 @@
        dh_installinfo -a
        dh_installlogcheck -a
        dh_installchangelogs -a
-       dh_strip -a
+       dh_strip -a --dbg-package=mariadb-server-10.0-dbg
        dh_link -a      # .so muss nach .so.1.2.3 installier werden!
        dh_compress -a
        dh_fixperms -a
 

Will test the result .deb tomorrow.

Comment by Daniel Black [ 2013-09-03 ]

It works but I don't know if putting all debug symbols in one package is the right way. This is still much better than trying to do it yourself.

with 10.0 replaced with 5.5:

It creates mariadb-server-5.5-dbg which contains the debug
symbols for all of the packages libmariadbclient18, mariadb-client-5.5, mariadb-client-core-5.5, mariadb-server-5.5 and mariadb-server-core-5.5

Could use the --exclude argument to dh_strip to create separate debug packages and include this multiple times. Bit messy though.

Comment by Sergei Petrunia [ 2013-09-03 ]

I think, having on debug symbols somewhere is better than not having them anywhere. I'm not sure whether there should be a single -dbg package or multiple. (If there are no other opinions, I would suggest that we start making a single -dbg package)

Comment by Daniel Black [ 2013-09-23 ]

> I think, having on debug symbols somewhere is better than not having them anywhere

Totally agree.

Attached patch is the same as the comments for mariadb-5.5 and includes adding -DCMAKE_BUILD_TYPE=Debug which may not be right for a general settings. The rest gives a useful debug package however.

Comment by Torsten Krah [ 2013-11-18 ]

10.0 packages beta for Ubuntu Saucy does miss the dbg package too - its crashing for me at mysql_upgrade, fix privileges stage and without them, i am unable to provide a "good" bug report.

Comment by Daniel Black [ 2014-10-29 ]

I'd be really happy with any debug symbols in a single or multiple package.

The lack of this, along with MDEV-6367, is making it hard to make debug builds in a reasonable time and this that is stopping me from getting essential information about a memory leak on MDEV-6300.

Comment by Daniel Black [ 2014-10-29 ]

Looks like galera has done this: https://github.com/codership/galera/pull/116/files.

otto are you able to help here?

Comment by Otto Kekäläinen [ 2014-10-29 ]

Yes, in Debian by default binaries are stripped. If will make the binaries much smaller and 99,999% of the time end-users don't need binaries with debug symbols. If debug versions are wanted, they are most often installed from a development repository and the packages are named dbg. For example I've done galera-dbg and I can do mariadb-server(5.5/10.0)-dbg too, but right now I don't have any extra time on my hands.

This is not assigned to anybody so I'll assign it to myself so I'll remember to return to it later.

Comment by Otto Kekäläinen [ 2014-12-20 ]

In Debian and Ubuntu normal packages are not supposed to contain debug symbols, they are stipped when the binary packages are created.

Ubuntu however provides automatically a facility that has the debug symbols, so that users can install them and get better stack traces. See details at https://wiki.ubuntu.com/DebuggingProgramCrash#Debug_Symbol_Packages (and examples at http://ddebs.ubuntu.com/pool/universe/m/mariadb-10.0/)

Also it looks like this issue is a duplicate of https://mariadb.atlassian.net/browse/MDEV-658 (or the other way around, as 572 is older)

Comment by Otto Kekäläinen [ 2015-12-20 ]

Since December 2015 Debian also generates automatic debug symbol packages, see e.g. http://snapshot.debian.org/package/mariadb-10.0/10.0.22-6/#mariadb-server-10.0-dbgsym_10.0.22-6

Generated at Thu Feb 08 06:29:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.