Bug 844270 - eu-nm invalid %N$ use detected
eu-nm invalid %N$ use detected
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: elfutils (Show other bugs)
17
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Roland McGrath
Fedora Extras Quality Assurance
abrt_hash:ec936c6e6f6a445ba7868ed693c...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-30 03:34 EDT by Miloslav Trmač
Modified: 2012-09-17 19:00 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-17 19:00:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: maps (6.29 KB, text/plain)
2012-07-30 03:34 EDT, Miloslav Trmač
no flags Details
File: backtrace (11.24 KB, text/plain)
2012-07-30 03:34 EDT, Miloslav Trmač
no flags Details
Proposed patch (2.16 KB, patch)
2012-07-30 08:02 EDT, Petr Machata
no flags Details | Diff

  None (edit)
Description Miloslav Trmač 2012-07-30 03:34:44 EDT
libreport version: 2.0.10
abrt_version:   2.0.10
backtrace_rating: 4
cmdline:        eu-nm -f bsd -D build/lib/.libs/libumberlog.so
crash_function: __GI_raise
executable:     /usr/bin/eu-nm
kernel:         3.4.6-2.fc17.x86_64
pid:            31433
pwd:            /home/mitr/rh/lumberjack/libumberlog
time:           Po 30. červenec 2012, 09:23:56 CEST
uid:            1000
username:       mitr
var_log_messages: Jul 30 09:23:56 kulicka abrt[31434]: Saved core dump of pid 31433 (/usr/bin/eu-nm) to /var/spool/abrt/ccpp-2012-07-30-09:23:56-31433 (700416 bytes)

backtrace:      Text file, 11514 bytes
maps:           Text file, 6441 bytes

cgroup:
:9:perf_event:/
:8:blkio:/
:7:net_cls:/
:6:freezer:/
:5:devices:/
:4:memory:/
:3:cpuacct,cpu:/
:2:cpuset:/
:1:name=systemd:/user/mitr/2

core_backtrace:
:f69712fe393313f44607679e934bf5a67f39ec50 0x35925 raise libc.so.6 -
:f69712fe393313f44607679e934bf5a67f39ec50 0x370d8 abort libc.so.6 -
:f69712fe393313f44607679e934bf5a67f39ec50 0x7564b __libc_message libc.so.6 -
:f69712fe393313f44607679e934bf5a67f39ec50 0x7572e __libc_fatal libc.so.6 -
:f69712fe393313f44607679e934bf5a67f39ec50 0x47aac vfprintf libc.so.6 -
:f69712fe393313f44607679e934bf5a67f39ec50 0x107191 __printf_chk libc.so.6 -
:0c0bff5ea1f50e93bf511f281b647672b96f3b04 0x4104 - [exe] -
:0c0bff5ea1f50e93bf511f281b647672b96f3b04 0x49a5 - [exe] -
:0c0bff5ea1f50e93bf511f281b647672b96f3b04 0x5063 - [exe] -
:0c0bff5ea1f50e93bf511f281b647672b96f3b04 0x26ff - [exe] -

dso_list:
:/usr/lib64/libz.so.1.2.5 zlib-1.2.5-6.fc17.x86_64 (Fedora Project) 1338663304
:/usr/lib64/elfutils/libebl_x86_64-0.154.so elfutils-libs-0.154-1.fc17.x86_64 (Fedora Project) 1341343277
:/usr/lib64/liblzma.so.5.0.99 xz-libs-5.1.1-2alpha.fc17.x86_64 (Fedora Project) 1338663313
:/usr/lib64/libm-2.15.so glibc-2.15-51.fc17.x86_64 (Fedora Project) 1342720608
:/usr/lib64/libc-2.15.so glibc-2.15-51.fc17.x86_64 (Fedora Project) 1342720608
:/usr/lib64/libstdc++.so.6.0.17 libstdc++-4.7.0-5.fc17.x86_64 (Fedora Project) 1338663305
:/usr/lib64/libbz2.so.1.0.6 bzip2-libs-1.0.6-4.fc17.x86_64 (Fedora Project) 1338663307
:/usr/lib64/libgcc_s-4.7.0-20120507.so.1 libgcc-4.7.0-5.fc17.x86_64 (Fedora Project) 1338663267
:/usr/lib64/librt-2.15.so glibc-2.15-51.fc17.x86_64 (Fedora Project) 1342720608
:/usr/lib64/libelf-0.154.so elfutils-libelf-0.154-1.fc17.x86_64 (Fedora Project) 1341343276
:/usr/lib64/ld-2.15.so glibc-2.15-51.fc17.x86_64 (Fedora Project) 1342720608
:/usr/bin/eu-nm elfutils-0.154-1.fc17.x86_64 (Fedora Project) 1341343291
:/usr/lib64/libdl-2.15.so glibc-2.15-51.fc17.x86_64 (Fedora Project) 1342720608
:/usr/lib64/libdw-0.154.so elfutils-libs-0.154-1.fc17.x86_64 (Fedora Project) 1341343277
:/usr/lib/locale/locale-archive glibc-common-2.15-51.fc17.x86_64 (Fedora Project) 1342720604
:/usr/lib64/libpthread-2.15.so glibc-2.15-51.fc17.x86_64 (Fedora Project) 1342720608

environ:
:XDG_VTNR=1
:XDG_SESSION_ID=2
:HOSTNAME=kulicka
:IMSETTINGS_INTEGRATE_DESKTOP=yes
:GPG_AGENT_INFO=/run/user/mitr/keyring-7jPqSb/gpg:0:1
:TERM=xterm
:SHELL=/bin/bash
:HISTSIZE=1000
:GJS_DEBUG_OUTPUT=stderr
:WINDOWID=14680069
:GNOME_KEYRING_CONTROL=/run/user/mitr/keyring-7jPqSb
:QTDIR=/usr/lib64/qt-3.3
:QTINC=/usr/lib64/qt-3.3/include
:'GJS_DEBUG_TOPICS=JS ERROR;JS LOG'
:IMSETTINGS_MODULE=none
:QT_GRAPHICSSYSTEM_CHECKED=1
:USER=mitr
:LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:*.pdf=00;33:*.ps=00;33:*.ps.gz=00;33:*.txt=00;33:*.patch=00;33:*.diff=00;33:*.log=00;33:*.tex=00;33:*.xls=00;33:*.xlsx=00;33:*.ppt=00;33:*.pptx=00;33:*.rtf=00;33:*.doc=00;33:*.docx=00;33:*.odt=00;33:*.ods=00;33:*.odp=00;33:*.xml=00;33:*.epub=00;33:*.abw=00;33:*.htm=00;33:*.html=00;33:*.shtml=00;33:*.wpd=00;33:
:SSH_AUTH_SOCK=/run/user/mitr/keyring-7jPqSb/ssh
:USERNAME=mitr
:SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/1271,unix/unix:/tmp/.ICE-unix/1271
:PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/mitr/.local/bin:/home/mitr/bin
:MAIL=/var/spool/mail/mitr
:DESKTOP_SESSION=gnome
:QT_IM_MODULE=xim
:PWD=/home/mitr/rh/lumberjack/libumberlog
:XMODIFIERS=@im=none
:EDITOR=vim
:GNOME_KEYRING_PID=1267
:LANG=cs_CZ.utf8
:GDM_LANG=cs_CZ.utf8
:GDMSESSION=gnome
:HISTCONTROL=ignoreboth
:HOME=/home/mitr
:XDG_SEAT=seat0
:SHLVL=2
:GNOME_DESKTOP_SESSION_ID=this-is-deprecated
:LOGNAME=mitr
:QTLIB=/usr/lib64/qt-3.3/lib
:CVS_RSH=ssh
:DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-3y4RBUCipz,guid=36c5929af601ab8a3cd8277400000073
:'LESSOPEN=||/usr/bin/lesspipe.sh %s'
:WINDOWPATH=1
:XDG_RUNTIME_DIR=/run/user/mitr
:DISPLAY=:0
:COLORTERM=gnome-terminal
:XAUTHORITY=/var/run/gdm/auth-for-mitr-Z2aDu9/database
:_=/usr/bin/eu-nm
:OLDPWD=/home/mitr/rh/lumberjack/rsyslog

limits:
:Limit                     Soft Limit           Hard Limit           Units     
:Max cpu time              unlimited            unlimited            seconds   
:Max file size             unlimited            unlimited            bytes     
:Max data size             unlimited            unlimited            bytes     
:Max stack size            8388608              unlimited            bytes     
:Max core file size        0                    unlimited            bytes     
:Max resident set          unlimited            unlimited            bytes     
:Max processes             1024                 62796                processes 
:Max open files            1024                 4096                 files     
:Max locked memory         65536                65536                bytes     
:Max address space         unlimited            unlimited            bytes     
:Max file locks            unlimited            unlimited            locks     
:Max pending signals       62796                62796                signals   
:Max msgqueue size         819200               819200               bytes     
:Max nice priority         0                    0                    
:Max realtime priority     0                    0                    
:Max realtime timeout      unlimited            unlimited            us        

open_fds:
:0:/dev/pts/0
:pos:	0
:flags:	0100002
:1:/dev/pts/0
:pos:	0
:flags:	0100002
:2:/dev/pts/0
:pos:	0
:flags:	0100002
:3:/home/mitr/rh/lumberjack/libumberlog/build/lib/.libs/libumberlog.so.1.1.0
:pos:	0
:flags:	0100000
:4:/dev/tty
:pos:	0
:flags:	0104002
Comment 1 Miloslav Trmač 2012-07-30 03:34:49 EDT
Created attachment 601137 [details]
File: maps
Comment 2 Miloslav Trmač 2012-07-30 03:34:51 EDT
Created attachment 601138 [details]
File: backtrace
Comment 3 Mark Wielaard 2012-07-30 03:57:36 EDT
The backtrace seems to indicate we are trying to use the following format string:
[radix_octal] = "%8$s%2$0*1$" PRIo64 "%10$s %9$s%3$c%4$s %5$s" in src/nm.c:1018 (show_symbols_bsd).

And glibc then gives us:

__GI___libc_fatal (message=message@entry=0x3fa37785b0 "*** invalid %N$ use detected ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:209
Comment 4 Miloslav Trmač 2012-07-30 04:01:07 EDT
The use does seem invalid, %6$ and %7$ are missing.
Comment 5 Mark Wielaard 2012-07-30 04:18:37 EDT
Simpler reproducer:

$ eu-nm -f bsd -D /usr/bin/eu-nm 
                 U _Jv_RegisterClasses
                 U _Unwind_Resume
                 U __asprintf_chk
                 U __assert_fail
*** invalid %N$ use detected ***
Aborted (core dumped)
Comment 6 Petr Machata 2012-07-30 08:02:32 EDT
Created attachment 601234 [details]
Proposed patch

With -D_FORTIFY_SOURCE=2, glibc checks that all parameters are present, which they are not, as Miloslav pointed out.  That all need to be present is documented in the man page as well.  The code for this check is present since about 2004, we just never happened to hit this.

It seems like the $-references are used simply as a little code-saving device.  Understandably, glibc needs to know all argument types.  Because I don't see a way to say something like %<ignore-this>s, I think we could simply convert this back to straight % style without direct references.  I'll pass this patch by upstream.
Comment 7 Petr Machata 2012-07-31 03:12:30 EDT
This is now upstream, albeit fixed a simpler way.
Comment 8 Fedora Update System 2012-08-27 16:10:04 EDT
elfutils-0.155-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/elfutils-0.155-1.fc18
Comment 9 Fedora Update System 2012-08-28 14:14:15 EDT
Package elfutils-0.155-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing elfutils-0.155-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-12838/elfutils-0.155-1.fc18
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2012-09-17 19:00:20 EDT
elfutils-0.155-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

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