Yes, they always need to match. You can use the following to keep track of buildids. build-id from an executable, shared library or separate debuginfo file:· $ eu-unstrip -n -e <exec|.sharedlib|.debug> build-ids of an executable and all shared libraries from a core file:· $ eu-unstrip -n --core <corefile> build-ids of an executable and all shared libraries of a running process:· $ eu-unstrip -n --pid <pid> build-id of the running kernel and all loaded modules:· $ eu-unstrip -n -k On Fri, Mar 27, 2020 at 11:52 AM Can Zhang <can@canx.me> wrote:
Thanks for the reply. Actually I made a mistake by claiming "dbg packages in ubuntu don't have source code included". Here's a little more information about making sure the binary and dbg package match:
$ file /usr/bin/ceph-osd /usr/bin/ceph-osd: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=8a15177a5cb79533f396ef01e68ba1a2025f07a1, stripped $ ll /usr/lib/debug/.build-id/8a/15177a5cb79533f396ef01e68ba1a2025f07a1.debug -rw-r--r-- 1 root root 195M Mar 26 17:27 /usr/lib/debug/.build-id/8a/15177a5cb79533f396ef01e68ba1a2025f07a1.debug
The binary has a "BuildID" field, and gdb would try to find the corresponding debug file under /usr/lib/debug/.build-id Hope it would help, and sorry for the disturbance.
Best, Can Zhang
On Thu, Mar 26, 2020 at 3:43 PM Brad Hubbard <bhubbard@redhat.com> wrote:
The source for frames 0 to 2 are not part of ceph, they are part of glibc (libpthread).
This is what I normally do.
# apt-get install ceph-osd ceph-osd-dbg # mkdir build && cd $_ # apt-get source ceph-osd # cd .. # gdb -d build/ /usr/bin/ceph-osd CoreDump
Something like that should work for you too (at least for the actual ceph frames).
On Thu, Mar 26, 2020 at 11:29 AM Can Zhang <can@canx.me> wrote:
Hello,
I have a follow-up question. As the dbg packages in ubuntu, not like rpm, don't have source code included, I also installed the source package, and instruct gdb to find the directory with command "directory /usr/src/ceph-14.2.7-75-g14b67dbc11", but it seems not working:
(gdb) directory /usr/src/ceph-14.2.7-75-g14b67dbc11/src Source directories searched: /usr/src/ceph-14.2.7-75-g14b67dbc11/src:$cdir:$cwd (gdb) bt #0 0x00007f3aafa619f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x564f5aedf1d8) at ../sysdeps/unix/sysv/linux/futex-internal.h:88 #1 __pthread_cond_wait_common (abstime=0x0, mutex=0x564f5aedf030, cond=0x564f5aedf1b0) at pthread_cond_wait.c:502 #2 __pthread_cond_wait (cond=0x564f5aedf1b0, mutex=0x564f5aedf030) at pthread_cond_wait.c:655 #3 0x0000564f4f3ff747 in AsyncMessenger::wait() () #4 0x0000564f4eb2119e in main ()
could you help me with debugging in ubuntu environment?
Best, Can Zhang
On Tue, Mar 17, 2020 at 4:42 PM Can Zhang <can@canx.me> wrote:
Thanks for the reply. After some tinkering, I understand that "make-debs.sh" intentionally remove *-dbg package building in normal situations, quote "...and remove -dbg packages because they are large and take time to build", so I comment out those lines: ==== diff --git a/make-debs.sh b/make-debs.sh index 5a7ca1aff5..650940ccf2 100755 --- a/make-debs.sh +++ b/make-debs.sh @@ -46,8 +46,8 @@ tar -C $releasedir -jxf $releasedir/ceph_$vers.orig.tar.bz2 # cp -a debian $releasedir/ceph-$vers/debian cd $releasedir -perl -ni -e 'print if(!(/^Package: .*-dbg$/../^$/))' ceph-$vers/debian/control -perl -pi -e 's/--dbg-package.*//' ceph-$vers/debian/rules +#perl -ni -e 'print if(!(/^Package: .*-dbg$/../^$/))' ceph-$vers/debian/control +#perl -pi -e 's/--dbg-package.*//' ceph-$vers/debian/rules # # always set the debian version to 1 which is ok because the debian # directory is included in the sources and the upstream version will ==== now the script could generate *-dbg*.deb files as expected.
Best, Can Zhang
On Tue, Mar 17, 2020 at 11:47 AM kefu chai <tchaikov@gmail.com> wrote:
On Mon, Mar 16, 2020 at 4:13 PM Can Zhang <can@canx.me> wrote:
Hello,
I use "make-debs.sh" script to build debian packages, but instead of getting *-dbg packages, I get packages like "ceph-base-dbgsym_14.2.7-75-g14b67dbc11-1_amd64.ddeb", which cannot be imported by reprepro, with errors like:
Unknown file type: 'a2e592c703334bc9f55a62f6fac267d8 135503940 debug optional ceph-base-dbgsym_14.2.7-75-g14b67dbc11-1_amd64.ddeb', assuming source format... Warning: File 'ceph-base-dbgsym_14.2.7-75-g14b67dbc11-1_amd64.ddeb' looks like source but does not start with 'ceph_'!
that's a known issue. see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730572 .
I must have missed something about the package building procedure. What supposed to be the right way to build deb packages?
please read https://wiki.debian.org/AutomaticDebugPackages for more info regarding to ddeb.
i'd suggest search for answers first before shooting the question right to the maling list .
Best, Can Zhang _______________________________________________ Dev mailing list -- dev@ceph.io To unsubscribe send an email to dev-leave@ceph.io
-- Regards Kefu Chai
_______________________________________________ Dev mailing list -- dev@ceph.io To unsubscribe send an email to dev-leave@ceph.io
-- Cheers, Brad
-- Cheers, Brad