Bug 1633348 - [abrt] dwarves: union__fprintf(): pdwtags killed by SIGSEGV
Summary: [abrt] dwarves: union__fprintf(): pdwtags killed by SIGSEGV
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: dwarves
Version: 28
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Arnaldo Carvalho de Melo
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:baf87e6c2dcadb877cae715f1e3...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-26 18:24 UTC by Eric Blake
Modified: 2019-05-28 22:43 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-28 22:43:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (27.28 KB, text/plain)
2018-09-26 18:24 UTC, Eric Blake
no flags Details
File: cgroup (407 bytes, text/plain)
2018-09-26 18:24 UTC, Eric Blake
no flags Details
File: core_backtrace (3.02 KB, text/plain)
2018-09-26 18:24 UTC, Eric Blake
no flags Details
File: cpuinfo (1.28 KB, text/plain)
2018-09-26 18:24 UTC, Eric Blake
no flags Details
File: dso_list (1014 bytes, text/plain)
2018-09-26 18:24 UTC, Eric Blake
no flags Details
File: environ (5.97 KB, text/plain)
2018-09-26 18:25 UTC, Eric Blake
no flags Details
File: exploitable (82 bytes, text/plain)
2018-09-26 18:25 UTC, Eric Blake
no flags Details
File: limits (1.29 KB, text/plain)
2018-09-26 18:25 UTC, Eric Blake
no flags Details
File: maps (5.09 KB, text/plain)
2018-09-26 18:25 UTC, Eric Blake
no flags Details
File: mountinfo (4.75 KB, text/plain)
2018-09-26 18:25 UTC, Eric Blake
no flags Details
File: open_fds (257 bytes, text/plain)
2018-09-26 18:25 UTC, Eric Blake
no flags Details
File: proc_pid_status (1.32 KB, text/plain)
2018-09-26 18:25 UTC, Eric Blake
no flags Details
Make sure we keep track the cacheline we're in while processing unions (1.11 KB, patch)
2018-09-26 20:04 UTC, Arnaldo Carvalho de Melo
no flags Details | Diff

Description Eric Blake 2018-09-26 18:24:46 UTC
Description of problem:
Trying to build libvirt.git, which runs 'pdwtags --verbose remote/.libs/libvirt_driver_remote_la-remote_protocol.o' to check for any accidental regressions in struct layout.

Version-Release number of selected component:
dwarves-1.12-1.fc28

Additional info:
reporter:       libreport-2.9.5
backtrace_rating: 4
cmdline:        pdwtags --verbose remote/.libs/libvirt_driver_remote_la-remote_protocol.o
crash_function: union__fprintf
executable:     /usr/bin/pdwtags
journald_cursor: s=f53fef45168047f5a4af5ab700c34aed;i=166c4a;b=cd03dd71896b45d38feb4cb2a0b14017;m=8f791c42bd;t=576ca46538b0f;x=b2a7a65b4c5b4efc
kernel:         4.18.7-200.fc28.x86_64
rootdir:        /
runlevel:       N 5
type:           CCpp
uid:            14986

Truncated backtrace:
Thread no. 1 (9 frames)
 #0 union__fprintf at /usr/src/debug/dwarves-1.12-1.fc28.x86_64/dwarves_fprintf.c:847
 #1 tag__fprintf at /usr/src/debug/dwarves-1.12-1.fc28.x86_64/dwarves.h:968
 #2 emit_tag at /usr/src/debug/dwarves-1.12-1.fc28.x86_64/pdwtags.c:37
 #3 cu__emit_tags at /usr/src/debug/dwarves-1.12-1.fc28.x86_64/pdwtags.c:49
 #4 pdwtags_stealer at /usr/src/debug/dwarves-1.12-1.fc28.x86_64/pdwtags.c:77
 #5 finalize_cu_immediately at /usr/src/debug/dwarves-1.12-1.fc28.x86_64/dwarf_loader.c:2310
 #6 cus__load_module at /usr/src/debug/dwarves-1.12-1.fc28.x86_64/dwarf_loader.c:2310
 #7 cus__process_dwflmod at /usr/src/debug/dwarves-1.12-1.fc28.x86_64/dwarf_loader.c:2355
 #8 ??

Comment 1 Eric Blake 2018-09-26 18:24:53 UTC
Created attachment 1487408 [details]
File: backtrace

Comment 2 Eric Blake 2018-09-26 18:24:54 UTC
Created attachment 1487409 [details]
File: cgroup

Comment 3 Eric Blake 2018-09-26 18:24:56 UTC
Created attachment 1487410 [details]
File: core_backtrace

Comment 4 Eric Blake 2018-09-26 18:24:57 UTC
Created attachment 1487411 [details]
File: cpuinfo

Comment 5 Eric Blake 2018-09-26 18:24:59 UTC
Created attachment 1487412 [details]
File: dso_list

Comment 6 Eric Blake 2018-09-26 18:25:00 UTC
Created attachment 1487413 [details]
File: environ

Comment 7 Eric Blake 2018-09-26 18:25:01 UTC
Created attachment 1487414 [details]
File: exploitable

Comment 8 Eric Blake 2018-09-26 18:25:03 UTC
Created attachment 1487415 [details]
File: limits

Comment 9 Eric Blake 2018-09-26 18:25:04 UTC
Created attachment 1487416 [details]
File: maps

Comment 10 Eric Blake 2018-09-26 18:25:06 UTC
Created attachment 1487417 [details]
File: mountinfo

Comment 11 Eric Blake 2018-09-26 18:25:07 UTC
Created attachment 1487418 [details]
File: open_fds

Comment 12 Eric Blake 2018-09-26 18:25:08 UTC
Created attachment 1487419 [details]
File: proc_pid_status

Comment 13 Eric Blake 2018-09-26 18:56:04 UTC
The following diff was sufficient for me to avoid the core dump, but I have no idea if it is actually the correct thing to do.

diff --git i/dwarves_fprintf.c w/dwarves_fprintf.c
index 2164c9e..40600c7 100644
--- i/dwarves_fprintf.c
+++ w/dwarves_fprintf.c
@@ -844,7 +844,8 @@ static size_t union__fprintf(struct type *type, const struct cu *cu,
 	 * back to it. Else we'll end up showing cacheline boundaries in
 	 * just the first of a multi struct union, for instance.
 	 */
-	initial_union_cacheline = *uconf.cachelinep;
+	if (uconf.cachelinep)
+		initial_union_cacheline = *uconf.cachelinep;
 	type__for_each_member(type, pos) {
 		struct tag *type = cu__type(cu, pos->tag.type);

@@ -858,7 +859,8 @@ static size_t union__fprintf(struct type *type, const struct cu *cu,
 		printed += union_member__fprintf(pos, type, cu, &uconf, fp);
 		fputc('\n', fp);
 		++printed;
-		*uconf.cachelinep = initial_union_cacheline;
+		if (uconf.cachelinep)
+			*uconf.cachelinep = initial_union_cacheline;
 	}

 	return printed + fprintf(fp, "%.*s}%s%s", indent, tabs,
@@ -1128,7 +1130,7 @@ static size_t class__fprintf_cacheline_boundary(struct conf_fprintf *conf,
 	uint32_t cacheline = offset / cacheline_size;
 	size_t printed = 0;

-	if (cacheline > *conf->cachelinep) {
+	if (conf->cachelinep && cacheline > *conf->cachelinep) {
 		const uint32_t cacheline_pos = offset % cacheline_size;
 		const uint32_t cacheline_in_bytes = offset - cacheline_pos;

Comment 14 Arnaldo Carvalho de Melo 2018-09-26 20:02:27 UTC
Reproduced the problem fixed it, please try the attached patch.

Can I add a:

Reported-by: Eric Blake <eblake>

To the upstream cset fixing this issue?

thanks for reporting!

Comment 15 Arnaldo Carvalho de Melo 2018-09-26 20:04:36 UTC
Created attachment 1487468 [details]
Make sure we keep track the cacheline we're in while processing unions

Comment 16 Eric Blake 2018-10-02 19:21:37 UTC
(In reply to Arnaldo Carvalho de Melo from comment #14)
> Reproduced the problem fixed it, please try the attached patch.
> 
> Can I add a:
> 
> Reported-by: Eric Blake <eblake>
> 
> To the upstream cset fixing this issue?
> 
> thanks for reporting!

Sure.

Comment 17 Eric Blake 2018-10-02 20:32:09 UTC
(In reply to Arnaldo Carvalho de Melo from comment #15)
> Created attachment 1487468 [details]
> Make sure we keep track the cacheline we're in while processing unions

Confirmed that this patch works for libvirt.

Comment 18 Ben Cotton 2019-05-02 20:45:48 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 19 Ben Cotton 2019-05-28 22:43:06 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.