From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id A0CE76EC56; Mon, 15 Mar 2021 19:30:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A0CE76EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1615825835; bh=2iZxDRWGz/O9bd0XUImHZJ4KK9w1QXW36nxzcuj+uSs=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=AxLrWAg1qUoIirWc/EQ+7hhsH+vPtB08ezPMy06xGriw+O3T5REN1CQjQu1tBTyln DP5NkLOS/bc61ASky1ADlQ3ysDmY4YAPGsjbisJD5MfjZ47GwU5ENF9PIH3Ycl9oVg BW/AwGXsWdATC9Nv6/U8ZKBu4kW4MCWegYj0gmqo= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7C0A36EC56 for ; Mon, 15 Mar 2021 19:30:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7C0A36EC56 Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1lLq6z-0006yL-7e; Mon, 15 Mar 2021 19:30:33 +0300 Date: Mon, 15 Mar 2021 19:30:46 +0300 To: Igor Munkin Message-ID: <20210315163046.lobxpj7pgy7tvgiu@tkn_work_nb> References: <7f444b92bacefea0e3a0b2d2846737d9791626ea.1614256802.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7f444b92bacefea0e3a0b2d2846737d9791626ea.1614256802.git.imun@tarantool.org> X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D3134714A9BDB69BA93610A9EE4F09178597EFC5743F8DB100894C459B0CD1B9D70AC150A849922A0D1A5C59F51F642A58B862F56D7B5A39680F0B1BC0C28F32 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7793F2E9FD365C60AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B0052F7941B60F658638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7FF294EE7CC9FD500381AB31E1B5A6934A0D42FC3861B762A471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7328B01A8D746D8839FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE72A06A78AFE7952DCD32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED62991661749BA6B97735FA7A1DE410330ED3CD04E86FAF290E2D7E9C4E3C761E06A7089D37D7C0E48F6CA18204E546F3947C72BE6798D60363526D8C47C27EEC5E9FC8A9BA7A39EFB7666BA297DBC24807EA089D37D7C0E48F6C8AA50765F7900637D9F2C517E34CD691EFF80C71ABB335746BA297DBC24807EA27F269C8F02392CD20465B3A5AADEC6827F269C8F02392CD5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24A6D60772A99906F8E1CD14B953EB46D02E50AE9D2C82FC3355D89D7DBCDD132 X-C1DE0DAB: 0D63561A33F958A5998B536E6452EB23612AE2B2E60FAAE37E44862DB2CA9F6DD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D342C0B628602DFD0BC326E7395C60666FEB4513F22AAF53A5E52B319D3FB9622B1DFCEB81261615FB61D7E09C32AA3244C12DFA5386E6862992BE9BD349D5657ADA995755A1445935EFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmD8gqPF9k0nciiyWb1Mt5w== X-Mailru-Sender: FFAA8E4AEE17E37C3731A083A1A85ADED70AC150A849922A0D1A5C59F51F642AB7EA9FE7735C3DBFC664A44C781FCEA7C77752E0C033A69EDF9F2CE1E9CF805D8CD356D4F938FF726C18EFA0BB12DBB0 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] tools: implement toolchain for crash artefacts X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Alexander Turenko via Tarantool-patches Reply-To: Alexander Turenko Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" I looked over the WIP version of the script and nothing confuses me: https://lists.tarantool.org/tarantool-patches/20210220104630.wiwxhkjfimsx2swa@tkn_work_nb/ So I guess I should do some basic testing to get and share my user experience. So I'll step into another environment to create coredump and archive it: | $ mkdir ~/tmp/cores && docker run --volume $(realpath ~/tmp/cores):/cores -it centos:7 /bin/bash | # curl -LfsS https://tarantool.io/release/2.6/installer.sh >installer.sh | # chmod a+x installer.sh | # ./installer.sh | # yum install -y tarantool | # ulimit -c unlimited | # tarantool Now we're in tarantool in a foreign environment. Let's initialize the database and fill it with some data to imitate a real situation: | tarantool> box.cfg{} | tarantool> box.schema.create_space('s') | tarantool> box.space.s:create_index('pk') | tarantool> for i = 1, 1000 do box.space.s:insert({i}) end And load some external C module (one from rocks, one from packages): | tarantool> Ctrl+Z | # yum install -y tarantool-devel git cmake gcc | # tarantoolctl rocks install tuple-keydef | # yum install -y tarantool-avro-schema | # fg | tarantool> require('tuple.keydef') | tarantool> require('avro_schema') Let's coredump myself (I'll prepend commands output with '~' symbols to ease reading): | tarantool> require('ffi').new('int[?]', 1)[1024 ^ 3] | ~ <...> | ~ Aborted (core dumped) | # ls -hl core | ~ -rw------- 1 root root 180M Mar 15 12:49 core | # file core | ~ bash: file: command not found (I'll ignore that 'file' is not installed, because it is possible situation on a production server, I guess.) Okay, now I got the tarabrt.sh script somehow: | # curl -LfsS https://raw.githubusercontent.com/tarantool/tarantool/929982bf49e4d177ea33876bee91845c9528d038/tools/tarabrt.sh >tarabrt.sh | # chmod a+x tarabrt.sh | (Don't read the content, just run.) | # ./tarabrt.sh --help | ~ tarabrt.sh: unrecognized option '--help' | # ./tarabrt.sh -h | ~ <..skipped..> | ~ - Manual usage. User can simply pack all necessary artefacts by running the | ~ following command. | ~ $ /path/to/tarabrt.sh -c ./core -d /tmp | ~ <..skipped..> | # ./tarabrt.sh -c ./core -d /tmp | ~ ./tarabrt.sh: line 115: file: command not found | ~ gdb is not installed, but it is obligatory for collecting the | ~ loaded shared libraries from the core dump. | ~ | ~ You can proceed collecting the artefacts manually later by running | ~ the following command: | ~ $ tarabrt.sh -e /usr/bin/tarantool -c ./core | (Okay, I'll install file and gdb now.) | # yum install -y file gdb | # file core | ~ core: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from 'tarantool', real uid: 0, effective uid: 0, real gid: 0, effective gid: 0, execfn: '/usr/bin/tarantool', platform: 'x86_64' | (Repeat the attempt to create the archive.) | # ./tarabrt.sh -c ./core -d /tmp | ~ The resulting archive is located here: /tmp/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | ~ The archive contents are listed below: | ~ /tmp/tmp.kqC76QSrpF/tarlist | ~ /tmp/tmp.kqC76QSrpF/version | ~ /usr/bin/tarantool | ~ ./core | ~ /lib64/libicui18n.so.50 | ~ /lib64/libicuuc.so.50 | ~ /lib64/libicudata.so.50 | ~ /lib64/libdl.so.2 | ~ /lib64/libreadline.so.6 | ~ /lib64/libncurses.so.5 | ~ /lib64/libtinfo.so.5 | ~ /lib64/libform.so.5 | ~ /lib64/libz.so.1 | ~ /lib64/librt.so.1 | ~ /lib64/libssl.so.10 | ~ /lib64/libcrypto.so.10 | ~ /lib64/libgomp.so.1 | ~ /lib64/libpthread.so.0 | ~ /lib64/libgcc_s.so.1 | ~ /lib64/libunwind-x86_64.so.8 | ~ /lib64/libunwind.so.8 | ~ /lib64/libstdc++.so.6 | ~ /lib64/libm.so.6 | ~ /lib64/libc.so.6 | ~ /lib64/ld-linux-x86-64.so.2 | ~ /lib64/libgssapi_krb5.so.2 | ~ /lib64/libkrb5.so.3 | ~ /lib64/libcom_err.so.2 | ~ /lib64/libk5crypto.so.3 | ~ /lib64/libkrb5support.so.0 | ~ /lib64/libkeyutils.so.1 | ~ /lib64/libresolv.so.2 | ~ /lib64/libselinux.so.1 | ~ /lib64/libpcre.so.1 | ~ /.rocks/lib/tarantool/tuple/keydef.so | ~ /usr/lib64/tarantool/avro_schema_rt_c.so | ~ | ~ If you want to upload it, choose the available resource | ~ (e.g. http://transfer.sh) and run the following command: | ~ $ curl -T /tmp/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz Okay, let's spin around this output for a while: | (The /tmp/ entries looks are something I can glance.) | # ll /tmp/tmp.kqC76QSrpF/tarlist | ~ ls: cannot access /tmp/tmp.kqC76QSrpF/tarlist: No such file or directory | ll /tmp/tmp.kqC76QSrpF/version | ~ ls: cannot access /tmp/tmp.kqC76QSrpF/version: No such file or directory | (But they're not. Okay, pass it over.) | (keydef.so and avro_schema_rt_c.so are here, nice!) | (Let's look at the archive file.) | # ls -hl /tmp/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | ~ -rw-r--r-- 1 root root 27M Mar 15 13:05 /tmp/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | # tar -vtf /tmp/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | ~ -rw-r--r-- root/root 1085 2021-03-15 13:05 version | ~ -rwxr-xr-x root/root 34431952 2020-12-30 14:08 tarantool | ~ -rw------- root/root 188039168 2021-03-15 12:49 coredump | ~ tar: Removing leading `/' from member names | ~ -rwxr-xr-x root/root 2096104 2020-03-21 00:49 /lib64/libicui18n.so.50 | ~ -rwxr-xr-x root/root 1539520 2020-03-21 00:49 /lib64/libicuuc.so.50 | ~ -rwxr-xr-x root/root 20785824 2020-03-21 00:49 /lib64/libicudata.so.50 | ~ -rwxr-xr-x root/root 19248 2021-02-08 15:46 /lib64/libdl.so.2 | ~ -rwxr-xr-x root/root 285136 2019-08-08 12:07 /lib64/libreadline.so.6 | ~ -rwxr-xr-x root/root 163696 2017-09-06 22:08 /lib64/libncurses.so.5 | ~ -rwxr-xr-x root/root 174576 2017-09-06 22:08 /lib64/libtinfo.so.5 | ~ -rwxr-xr-x root/root 67864 2017-09-06 22:08 /lib64/libform.so.5 | ~ -rwxr-xr-x root/root 90248 2018-10-30 20:24 /lib64/libz.so.1 | ~ -rwxr-xr-x root/root 43712 2021-02-08 15:46 /lib64/librt.so.1 | ~ -rwxr-xr-x root/root 470376 2020-12-16 21:24 /lib64/libssl.so.10 | ~ -rwxr-xr-x root/root 2520768 2020-12-16 21:24 /lib64/libcrypto.so.10 | ~ -rwxr-xr-x root/root 154840 2020-09-30 02:17 /lib64/libgomp.so.1 | ~ -rwxr-xr-x root/root 142144 2021-02-08 15:46 /lib64/libpthread.so.0 | ~ -rwxr-xr-x root/root 88720 2020-09-30 02:18 /lib64/libgcc_s.so.1 | ~ -rwxr-xr-x root/root 73416 2017-08-02 15:45 /lib64/libunwind-x86_64.so.8 | ~ -rwxr-xr-x root/root 48904 2017-08-02 15:45 /lib64/libunwind.so.8 | ~ -rwxr-xr-x root/root 995840 2020-09-30 02:17 /lib64/libstdc++.so.6 | ~ -rwxr-xr-x root/root 1136944 2021-02-08 15:46 /lib64/libm.so.6 | ~ -rwxr-xr-x root/root 2156344 2021-02-08 15:46 /lib64/libc.so.6 | ~ -rwxr-xr-x root/root 163312 2021-02-08 15:46 /lib64/ld-linux-x86-64.so.2 | ~ -rwxr-xr-x root/root 320720 2020-09-30 16:51 /lib64/libgssapi_krb5.so.2 | ~ -rwxr-xr-x root/root 967840 2020-09-30 16:51 /lib64/libkrb5.so.3 | ~ -rwxr-xr-x root/root 15856 2020-09-30 15:58 /lib64/libcom_err.so.2 | ~ -rwxr-xr-x root/root 210784 2020-09-30 16:51 /lib64/libk5crypto.so.3 | ~ -rwxr-xr-x root/root 67104 2020-09-30 16:51 /lib64/libkrb5support.so.0 | ~ -rwxr-xr-x root/root 15688 2014-06-10 02:17 /lib64/libkeyutils.so.1 | ~ -rwxr-xr-x root/root 109976 2021-02-08 15:46 /lib64/libresolv.so.2 | ~ -rwxr-xr-x root/root 155744 2020-04-01 03:16 /lib64/libselinux.so.1 | ~ -rwxr-xr-x root/root 402384 2017-08-02 03:08 /lib64/libpcre.so.1 | ~ -rwxr-xr-x root/root 52168 2021-03-15 12:45 /.rocks/lib/tarantool/tuple/keydef.so | ~ -rwxr-xr-x root/root 23736 2020-08-05 23:10 /usr/lib64/tarantool/avro_schema_rt_c.so | ~ -rw-r--r-- root/root 796 2021-03-15 13:05 checklist | (Can we avoid the the warning re `/`? Just curious.) | (Okay, I see that transfer.sh is suggested. I never use it, so I'm | curious.) | # curl -T /tmp/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz http://transfer.sh | ~ http://transfer.sh/HeUux/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | (Hey, something occurs! But I'll save it to my system anyway.) | # cp /tmp/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz /cores/ | (And, while I'm here...) | # md5sum /tmp/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | ~ bec8f81c69ed992a258a6d9f0b8a04dc /tmp/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz Okay, let's try gdb.sh on my Gentoo box: | $ mkdir ~/tmp/try-gdb-sh | $ cd ~/tmp/try-gdb-sh | $ curl -LfsS https://raw.githubusercontent.com/tarantool/tarantool/929982bf49e4d177ea33876bee91845c9528d038/tools/gdb.sh > gdb.sh | $ chmod a+x gdb.sh | $ curl -LfsS http://transfer.sh/HeUux/tarantool-core-N-202103151305-cc18d0726f6a.tar.gz > tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | $ md5sum tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | ~ bec8f81c69ed992a258a6d9f0b8a04dc tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | (Matches!) | (Hm, now I'm worry, whether the archive will be uncompressed into the | current directory or will create its own directory?) | $ tar -xf tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | ~ tar: Removing leading `/' from member names | $ ll | ~ total 239M | ~ drwxr-xr-x 5 alex users 4.0K Mar 15 16:56 . | ~ drwxr-xr-x 164 alex users 20K Mar 15 16:50 .. | ~ -rw-r--r-- 1 alex users 796 Mar 15 16:05 checklist | ~ -rw------- 1 alex users 180M Mar 15 15:49 coredump | ~ -rwxr-xr-x 1 alex users 2.0K Mar 15 16:51 gdb.sh | ~ drwxr-xr-x 2 alex users 4.0K Mar 15 16:56 lib64 | ~ drwxr-xr-x 3 alex users 4.0K Mar 15 16:56 .rocks | ~ -rwxr-xr-x 1 alex users 33M Dec 30 17:08 tarantool | ~ -rw-r--r-- 1 alex users 27M Mar 15 16:54 tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | ~ drwxr-xr-x 3 alex users 4.0K Mar 15 16:56 usr | ~ -rw-r--r-- 1 alex users 1.1K Mar 15 16:05 version | (Meh. Let's move it around.) | $ mkdir tarantool-core-N-202103151305-cc18d0726f6a | $ mv checklist coredump lib64 .rocks tarantool usr version tarantool-core-N-202103151305-cc18d0726f6a | $ tree | ~ . | ~ ├── gdb.sh | ~ ├── tarantool-core-N-202103151305-cc18d0726f6a | ~ │   ├── checklist | ~ │   ├── coredump | ~ │   ├── lib64 | ~ │   │   ├── <..skipped..> | ~ │   ├── tarantool | ~ │   ├── usr | ~ │   │   └── lib64 | ~ │   │   └── tarantool | ~ │   │   └── avro_schema_rt_c.so | ~ │   └── version | ~ └── tarantool-core-N-202103151305-cc18d0726f6a.tar.gz | ~ | ~ 5 directories, 37 files | (Now looks okay. Let's try.) | $ cd tarantool-core-N-202103151305-cc18d0726f6a | $ ../gdb.sh --help | ~ ================================================================================ | ~ | ~ Do not forget to properly setup the environment: | ~ * git clone https://github.com/tarantool/tarantool.git sources | ~ * cd !$ | ~ * git checkout 34d504d | ~ * git submodule update --recursive --init | ~ | ~ ================================================================================ | ~ GNU gdb (Gentoo 10.1 vanilla) 10.1 | ~ <..skipped..> | ~ Reading symbols from ./tarantool... | ~ lj-arch command initialized | ~ lj-tv command initialized | ~ lj-str command initialized | ~ lj-tab command initialized | ~ lj-stack command initialized | ~ lj-state command initialized | ~ lj-gc command initialized | ~ luajit-gdb.py is successfully loaded | ~ warning: Can't open file /usr/bin/tarantool during file-backed mapping note processing | ~ warning: Can't open file /usr/lib/locale/locale-archive (deleted) during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libpcre.so.1.2.0 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libselinux.so.1 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libresolv-2.17.so (deleted) during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libkeyutils.so.1.5 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libkrb5support.so.0.1 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libk5crypto.so.3.1 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libcom_err.so.2.1 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libkrb5.so.3.3 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libgssapi_krb5.so.2.2 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libc-2.17.so (deleted) during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libm-2.17.so (deleted) during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libstdc++.so.6.0.19 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libunwind.so.8.0.1 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libunwind-x86_64.so.8.0.1 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libgcc_s-4.8.5-20150702.so.1 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libpthread-2.17.so (deleted) during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libgomp.so.1.0.0 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libcrypto.so.1.0.2k during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libssl.so.1.0.2k during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/librt-2.17.so (deleted) during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libz.so.1.2.7 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libform.so.5.9 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libtinfo.so.5.9 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libncurses.so.5.9 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libreadline.so.6.2 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libdl-2.17.so (deleted) during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libicudata.so.50.2 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libicuuc.so.50.2 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/libicui18n.so.50.2 during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/ld-2.17.so (deleted) during file-backed mapping note processing | ~ warning: Can't open file /usr/lib64/gconv/gconv-modules.cache (deleted) during file-backed mapping note processing | ~ [New LWP 246] | ~ [New LWP 247] | ~ [New LWP 248] | ~ [New LWP 250] | ~ warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available. | ~ warning: the debug information found in "/usr/lib64/debug/usr/lib64/tarantool/avro_schema_rt_c.so.debug" does not match "/home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/usr/lib64/tarantool/avro_schema_rt_c.so" (CRC mismatch). | ~ | ~ warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available. | ~ Core was generated by `tarantool'. | ~ Program terminated with signal SIGABRT, Aborted. | ~ #0 0x00007f340a5f4387 in ssignal () from /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libc.so.6 | ~ [Current thread is 1 (LWP 246)] | (gdb) Ctrl+D | (Hey, --help runs it.) | (Anyway, I should checkout sources. Nice reminder.) | $ git clone https://github.com/tarantool/tarantool.git sources | $ cd sources | $ git checkout 34d504d | $ git submodule update --recursive --init | $ cd .. | (Let's try again?) | $ ../gdb.sh | <..I'll skip the output, it is quite similar to one above. But will | comment below.> | (The reminder regarding tarantool sources still shown. But I already | placed the sources here.) | (All library warnings above are still here. However it seems they're just warnings.) | $ (gdb) bt | ~ #0 0x00007f340a5f4387 in ssignal () from /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libc.so.6 | ~ #1 0x00007f340a5f5a78 in abort () from /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libc.so.6 | ~ #2 0x0000000000453c43 in sig_fatal_cb (signo=, siginfo=, context=) at /build/usr/src/debug/tarantool-2.6.2.0/src/main.cc:302 | ~ #3 | ~ #4 0x0000000000621ce7 in lj_cconv_ct_ct (cts=, d=, s=0x41508e70, dp=0x41d7a0b8 "", sp=0x140535248 , | ~ flags=) at lj_cconv.c:234 | ~ #5 0x0000000000621e61 in lj_cconv_tv_ct (cts=0x40fb9858, s=, sid=, o=0x41d7a0b8, sp=) at lj_cconv.c:389 | ~ #6 0x0000000000621298 in lj_cdata_get (cts=, s=, o=, sp=) at lj_cdata.c:254 | ~ #7 0x0000000000631021 in lj_cf_ffi_meta___index (L=0x40fb1378) at lib_ffi.c:158 | ~ #8 0x00000000006338a7 in lj_BC_FUNCC () at buildvm_x86.dasc:809 | ~ #9 0x0000000000615c82 in lua_pcall (L=L@entry=0x40fb1378, nargs=, nresults=, errfunc=errfunc@entry=0) at lj_api.c:1158 | ~ #10 0x00000000005c4663 in luaT_call (L=0x40fb1378, nargs=, nreturns=) at /build/usr/src/debug/tarantool-2.6.2.0/src/lua/utils.c:1022 | ~ #11 0x00000000005bd259 in lua_main (L=L@entry=0x40fb1378, argc=argc@entry=1, argv=argv@entry=0x20d5fc0) at /build/usr/src/debug/tarantool-2.6.2.0/src/lua/init.c:546 | ~ #12 0x00000000005bd6b3 in run_script_f (ap=) at /build/usr/src/debug/tarantool-2.6.2.0/src/lua/init.c:647 | ~ #13 0x00000000004530dc in fiber_cxx_invoke(fiber_func, typedef __va_list_tag __va_list_tag *) (f=, ap=) | ~ at /build/usr/src/debug/tarantool-2.6.2.0/src/lib/core/fiber.h:882 | ~ #14 0x00000000005def90 in fiber_loop (data=) at /build/usr/src/debug/tarantool-2.6.2.0/src/lib/core/fiber.c:879 | ~ #15 0x00000000007c7ddf in coro_init () at /build/usr/src/debug/tarantool-2.6.2.0/third_party/coro/coro.c:110 | (Looks good!) | (gdb) info sharedlibrary | ~ From To Syms Read Shared Object Library | ~ 0x00007f340e9aa5f0 0x00007f340eab0b62 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libicui18n.so.50 | ~ 0x00007f340e5eb2f0 0x00007f340e69dad8 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libicuuc.so.50 | ~ 0x00007f340cfc6550 0x00007f340cfc6635 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libicudata.so.50 | ~ 0x00007f340cdc2e50 0x00007f340cdc394e Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libdl.so.2 | ~ 0x00007f340cb90de0 0x00007f340cbaf775 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libreadline.so.6 | ~ 0x00007f340c95bd50 0x00007f340c975462 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libncurses.so.5 | ~ 0x00007f340c737e40 0x00007f340c743bb8 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libtinfo.so.5 | ~ 0x00007f340c51e6e0 0x00007f340c525ed0 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libform.so.5 | ~ 0x00007f340c307110 0x00007f340c313698 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libz.so.1 | ~ 0x00007f340c0ff230 0x00007f340c1021bc Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/librt.so.1 | ~ 0x00007f340bea5b90 0x00007f340bee164d Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libssl.so.10 | ~ 0x00007f340ba95200 0x00007f340bbce7b7 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libcrypto.so.10 | ~ 0x00007f340b809060 0x00007f340b81fc2a Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libgomp.so.1 | ~ 0x00007f340b5eb8f0 0x00007f340b5f6db1 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libpthread.so.0 | ~ 0x00007f340b3d2ad0 0x00007f340b3e2285 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libgcc_s.so.1 | ~ 0x00007f340b1b1570 0x00007f340b1be20e Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libunwind-x86_64.so.8 | ~ 0x00007f340af975b0 0x00007f340af9e95e Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libunwind.so.8 | ~ 0x00007f340ace94e0 0x00007f340ad5059a Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libstdc++.so.6 | ~ 0x00007f340a991350 0x00007f340a9fc336 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libm.so.6 | ~ 0x00007f340a5dd9f0 0x00007f340a72da5f Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libc.so.6 | ~ 0x00007f340ed11af0 0x00007f340ed2d060 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/ld-linux-x86-64.so.2 | ~ 0x00007f340a37d720 0x00007f340a3afbca Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libgssapi_krb5.so.2 | ~ 0x00007f340a0adc20 0x00007f340a1159fa Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libkrb5.so.3 | ~ 0x00007f3409e85540 0x00007f3409e86113 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libcom_err.so.2 | ~ 0x00007f3409c558d0 0x00007f3409c73bbf Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libk5crypto.so.3 | ~ 0x00007f3409a44bf0 0x00007f3409a4c36b Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libkrb5support.so.0 | ~ 0x00007f340983e5b0 0x00007f340983f1cc Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libkeyutils.so.1 | ~ 0x00007f3409626980 0x00007f34096351e2 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libresolv.so.2 | ~ 0x00007f3409402a90 0x00007f3409418896 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libselinux.so.1 | ~ 0x00007f340919b5f0 0x00007f34091e15b0 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/lib64/libpcre.so.1 | ~ 0x00007f3408c429f0 0x00007f3408c43896 Yes /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/.rocks/lib/tarantool/tuple/keydef.so | ~ 0x00007f33eedf8d80 0x00007f33eedfc174 Yes (*) /home/alex/tmp/try-gdb-sh/tarantool-core-N-202103151305-cc18d0726f6a/usr/lib64/tarantool/avro_schema_rt_c.so | ~ (*): Shared library is missing debugging information. | (Looks good too!) > Can't open file <...> (deleted) during file-backed mapping note > processing. I don't know what it is. But I'll share my gdb version just in case (maybe you'll be able to reproduce it). I didn't meet this warning before. | $ gdb --version | head -n 1 | ~ GNU gdb (Gentoo 10.1 vanilla) 10.1 However I would note that those warnings misleads me the first time: I thought that something is wrong with library paths. > Unable to find libthread_db matching inferior's thread library, thread > debugging will not be available. Sure, it is not listed in the lld output (neither in 'info sharedlibrary'), but maybe we should include it into the tarabrt.sh generated archive. > the debug information found in <...> does not match <...> (CRC mismatch). It is just because I have local avro schema debuginfo installed. I think this warning can be ignored. To sum up: my experience was successful. You may polish some tiny details, but in fact the scripts seem to be ready for use. ---- We also briefly discussed the topic about stripped executables with Igor. Now we ship stripped executables in RPM packages for CentOS 8 (only for CentOS 8), but the separate debug package is stored in our repos. First point: we can include /etc/os-release into the generated archive. Second point: we can give URL from where debuginfo package may be downloaded and give advice how to unpack it (in gdb.sh output, when we see the stripped executable). Examples: | $ curl -LfsS https://download.tarantool.org/tarantool/release/2.8/el/8/x86_64/Packages/tarantool-debuginfo-2.8.0.0-1.el8.x86_64.rpm > tarantool-debuginfo-2.8.0.0-1.el8.x86_64.rpm | $ mkdir tarantool-debuginfo-2.8.0.0-1.el8.x86_64.rpm.unpack | $ cd tarantool-debuginfo-2.8.0.0-1.el8.x86_64.rpm.unpack | $ rpm2cpio ../tarantool-debuginfo-2.8.0.0-1.el8.x86_64.rpm | cpio -idmv | ~ ./usr/lib/debug | ~ ./usr/lib/debug/.build-id | ~ ./usr/lib/debug/.build-id/a3 | ~ ./usr/lib/debug/.build-id/a3/ad84db98a9b14e70d2915271904ddfe26b5f60 | ~ ./usr/lib/debug/.build-id/a3/ad84db98a9b14e70d2915271904ddfe26b5f60.debug | ~ ./usr/lib/debug/usr | ~ ./usr/lib/debug/usr/bin | ~ ./usr/lib/debug/usr/bin/tarantool-2.8.0.0-1.el8.x86_64.debug | ~ 64743 blocks | (All are symlinks except tarantool-2.8.0.0-1.el8.x86_64.debug.) | $ file usr/lib/debug/usr/bin/tarantool-2.8.0.0-1.el8.x86_64.debug | ~ usr/lib/debug/usr/bin/tarantool-2.8.0.0-1.el8.x86_64.debug: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter \004, for GNU/Linux 3.2.0, BuildID[sha1]=a3ad84db98a9b14e70d2915271904ddfe26b5f60, with debug_info, not stripped, too many notes (256) | $ curl -LfsS https://download.tarantool.org/tarantool/live/2.8/el/8/x86_64/Packages/tarantool-debuginfo-2.8.0.116-1.el8.x86_64.rpm > tarantool-debuginfo-2.8.0.116-1.el8.x86_64.rpm Third: we can give advice how to enable the ELF with debug symbols in the interactive gdb session. Or we should do it within gdb.sh to call 'info line main'? Expect it in some predefined location or accept an option? At least it looks worthful to warn about stripped executable explicitly. ---- It seems, I reached maximum value that I can give as reviewer, so I'll just say that the patch looks good to me (and I don't mind small changes around usability if you want to do them). WBR, Alexander Turenko.