unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58733: installer: coredump generation
@ 2022-10-23  9:29 Mathieu Othacehe
  2022-10-31 13:34 ` Mathieu Othacehe
  0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Othacehe @ 2022-10-23  9:29 UTC (permalink / raw)
  To: 58733


Hello,

This installer sometimes sadly segfaults, most of the time in
libparted. To be able to catch this coredump[1], I ran those commands:

--8<---------------cut here---------------start------------->8---
echo /tmp/core > /proc/sys/kernel/core_pattern
prlimit --core=unlimited --pid=1234
--8<---------------cut here---------------end--------------->8---

The coredump I obtained did not seem to be exploitable, despite the fact
that it weights 155MB:

--8<---------------cut here---------------start------------->8---
mathieu@meije ~/guix [env]$ gdb /gnu/store/1jgcbdzx2ss6xv59w55g3kr3x4935dfb-guile-3.0.8/bin/guile core
...
BFD: warning: /home/mathieu/guix/core has a segment extending past end of file
warning: core file may not match specified executable file.
...
Failed to read a valid object file image from memory.
Core was generated by `/gnu/store/1jgcbdzx2ss6xv59w55g3kr3x4935dfb-guile-3.0.8/bin/guile --no-auto-com'.
--8<---------------cut here---------------end--------------->8---

So I decided to adopt a new strategy and ran:

--8<---------------cut here---------------start------------->8---
$ gdb
$ attach 1234
...
$ gcore
--8<---------------cut here---------------end--------------->8---

to get a viable core dump, and those commands to exploit it (thanks
Josselin!):

--8<---------------cut here---------------start------------->8---
(gdb) info sharedlibrary 
From                To                  Syms Read   Shared Object Library
...
0x00007f892c59c850  0x00007f892c5d3d0b  Yes (*)     /gnu/store/qz7qqrhgcs3ixv8f1k30gwiqr1prm7qs-parted-3.5/lib/libparted.so
(gdb) add-symbol-file  /gnu/store/b0ymz7vjfkcvhbci49q5yk1fi0l9lq49-parted-3.5/lib/libparted.so  0x00007f892c59c850 
add symbol table from file "/gnu/store/b0ymz7vjfkcvhbci49q5yk1fi0l9lq49-parted-3.5/lib/libparted.so" at
	.text_addr = 0x7f892c59c850
(y or n) y
Reading symbols from /gnu/store/b0ymz7vjfkcvhbci49q5yk1fi0l9lq49-parted-3.5/lib/libparted.so...
(gdb) bt
#0  linux_destroy (dev=0x1dc89e0) at arch/linux.c:1615
#1  0x00007f8941aecd37 in ?? () from /gnu/store/1jgcbdzx2ss6xv59w55g3kr3x4935dfb-guile-3.0.8/lib/libguile-3.0.so.1
...
--8<---------------cut here---------------end--------------->8---

I think that it would be great if we could enable coredump generation
from the installer. This way, when a crash occurs and the installer
restarts, it would notice that there is an existing coredump in say
/tmp/coredump_xxx and propose to upload it using the existing dump
mechanism.

Thanks,

Mathieu

[1]: https://issues.guix.gnu.org/58732




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-02 16:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-23  9:29 bug#58733: installer: coredump generation Mathieu Othacehe
2022-10-31 13:34 ` Mathieu Othacehe
2022-10-31 15:51   ` Mathieu Othacehe
2022-11-02 10:34   ` Ludovic Courtès
2022-11-02 16:58     ` Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).