Bug 983941

Summary: eu-addr2line exits with return code 1 if it gets stderr|stdout as parameter
Product: Red Hat Enterprise Linux 5 Reporter: Dagmar Prokopová <dprokopo>
Component: elfutilsAssignee: Petr Machata <pmachata>
Status: CLOSED WONTFIX QA Contact: qe-baseos-tools-bugs
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.10CC: drepper, mbenitez, mjw, mnewsome, ohudlick
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-19 14:35:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dagmar Prokopová 2013-07-12 11:03:06 UTC
Description of problem:
When there is stderr, stdout or any other nonnumeric literal set as the parameter for eu-addr2line it exits with return code 1 without any other complaint or additional explanation. If addr2line from binutils is used instead, it shows ??:0 as the output and exits with code 0.

On rhel6 and higher eu-addr2line works fine (??:0 as the output and exit code 0 for stderr|stdout and warning 'eu-addr2line: cannot find symbol...' for any other nonnumeric string).

If this behaviour is intended on rhel5, it would be IMHO nice to provide at least a message like 'eu-addr2line: cannot find symbol 'stderr''.

Version-Release number of selected component (if applicable):
elfutils-0.137-3.el5

How reproducible:
always

Steps to Reproduce:

$ cat reproducer.c
#include <stdio.h>
int main()
{
    printf("hallo universe\n");
    return 0;
}

$ gcc -g reproducer.c
$ eu-addr2line -e a.out stderr
$ echo $?
1


Actual results:
$ eu-addr2line -e a.out stderr
$ echo $?
1

Expected results:
$ eu-addr2line -e a.out stderr
??:0
$ echo $?
0


Additional info:
If I set any hexadecimal address as a parameter it works all right:

$ eu-addr2line -e a.out 0x400550
??:0
$ echo $?
0

The problem is only with stderr|stdout|any_other_nonnumeric_literal.

Comment 1 Mark Wielaard 2013-08-09 23:37:28 UTC
elfutils-0.137 doesn't handle eu-addr2line for "SYMBOL" (reliably), for that it needs at least this upstream patch:

commit 12e3d1f733cdb590a379a761ee092487931b8109
Author: Roland McGrath <roland>
Date:   Wed May 19 18:03:31 2010 -0700

    addr2line: Handle SYMBOL without +OFFSET.

which was only introduced in elfutils 0.148.

There might be other backport patches needed to make your use case work.

rhel-6 contains elfutils 0.152.

Comment 2 Mark Wielaard 2013-08-10 11:49:51 UTC
BTW. There is elfutils (0.154) for DTS (Developer Tool Set) which is available for RHEL5 x86_64 and i686.

Comment 3 mbenitez 2013-08-19 14:35:59 UTC
Developer recommendation is to use elfutils from DTS.
RHEL 5.10 is not taking further updates at this time.