Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-572

No debug symbols for Ubuntu packages

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • 5.5.27
    • N/A
    • Packaging
    • Ubuntu 12.04 Precise Pangolin, deb packages

    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.

      Attachments

        Issue Links

          Activity

            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.

            psergei Sergei Petrunia added a comment - 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.

            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?)

            psergei Sergei Petrunia added a comment - 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?)

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

            psergei Sergei Petrunia added a comment - Just checked binaries for Fedora (file names like MariaDB-5.5.27-centos6-x86_64-server.rpm) - the binaries are not stripped.

            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.

            serg Sergei Golubchik added a comment - 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.

            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.

            psergei Sergei Petrunia added a comment - 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.

            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

            psergei Sergei Petrunia added a comment - 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
            psergei Sergei Petrunia added a comment - http://askubuntu.com/questions/53708/how-to-create-debuginfo-package
            jb-boin Jean Weisbuch added a comment -

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

            jb-boin Jean Weisbuch added a comment - Its the same for official MySQL packages on Debian Squeeze, no debugging symols and no -dbg package available.
            rtreffer Rene Treffer added a comment -

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

            rtreffer Rene Treffer added a comment - I'm hitting the same problem. Debug symbols are needed for profiling. I'll try to build from source to preserve the debug symbols.

            Hi,

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

            elenst Elena Stepanova added a comment - Hi, You can also try the binary tarball available at the downloads page. It shouldn't be stripped.
            rtreffer Rene Treffer added a comment -

            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.

            rtreffer Rene Treffer added a comment - 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.
            danblack Daniel Black added a comment -

            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.

            danblack Daniel Black added a comment - 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.

            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)

            psergei Sergei Petrunia added a comment - 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)
            danblack Daniel Black added a comment -

            > 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.

            danblack Daniel Black added a comment - > 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.
            tkrah Torsten Krah added a comment -

            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.

            tkrah Torsten Krah added a comment - 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.
            danblack Daniel Black added a comment -

            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.

            danblack Daniel Black added a comment - 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 .
            danblack Daniel Black added a comment -

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

            otto are you able to help here?

            danblack Daniel Black added a comment - Looks like galera has done this: https://github.com/codership/galera/pull/116/files . otto are you able to help here?

            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.

            otto Otto Kekäläinen added a comment - 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.

            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)

            otto Otto Kekäläinen added a comment - 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)

            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

            otto Otto Kekäläinen added a comment - 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

            People

              otto Otto Kekäläinen
              psergei Sergei Petrunia
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.