Bug 753601

Summary: malloc deadlock makes *printf hang
Product: [Fedora] Fedora Reporter: Jim Meyering <meyering>
Component: glibcAssignee: Andreas Schwab <schwab>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fweimer, jakub, law, mishu, rjones, schwab
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glibc-2.14.90-19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-17 23:08:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jim Meyering 2011-11-13 17:44:31 UTC
Description of problem: low-memory failing *printf hangs due to malloc deadlock

Version-Release number of selected component (if applicable): glibc-2.14.90-15.2.x86_64

How reproducible: every time

Steps to Reproduce:
1. ( ulimit -v 10000; env printf %20000000f 0 )

Actual results: it hangs

Expected results:

It should report failure, as it does for F16:

  $ ( ulimit -v 10000; env printf %20000000f 0 )
  printf: write error

Additional info:

Attach to the hung printf process and get a backtrace:

(gdb) bt
#0  __lll_lock_wait_private ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:96
#1  0x00007f1ddd463551 in _L_lock_2517 () at malloc.c:5209
#2  0x00007f1ddd45d805 in reused_arena () at arena.c:803
#3  arena_get2 (size=<optimized out>, a_tsd=Unhandled dwarf expression opcode 0xfa
) at arena.c:854
#4  0x00007f1ddd4617c8 in __GI___libc_malloc (bytes=20000001) at malloc.c:2935
#5  0x0000000000406827 in vasnprintf (resultbuf=0x7fffa3f9cbc0 "",
    lengthp=0x7fffa3f9d398, format=<optimized out>, args=<optimized out>)
    at vasnprintf.c:3595
#6  0x0000000000405200 in rpl_vfprintf (fp=0x7f1ddd794260,
    format=<optimized out>, args=<optimized out>) at vfprintf.c:45
#7  0x0000000000404fc3 in xvprintf (format=<optimized out>,
    args=<optimized out>) at xprintf.c:48
#8  0x00000000004050ac in xprintf (format=<optimized out>) at xprintf.c:37
#9  0x0000000000402574 in print_direc (argument=<optimized out>, precision=0,
    have_precision=false, field_width=0, have_field_width=false,
    conversion=<optimized out>, length=9, start=0x7fffa3f9e0b0 "%20000000f")
    at printf.c:425
#10 print_formatted (format=<optimized out>, argc=0, argv=0x7fffa3f9d7a0)
    at printf.c:614
#11 0x00000000004016a5 in main (argc=1, argv=0x7fffa3f9d798) at printf.c:685

Comment 1 Jim Meyering 2011-11-13 17:48:36 UTC
FYI, I noticed this because it makes the coreutils printf-surprise regression test fail.

Comment 2 Jim Meyering 2011-11-14 10:56:52 UTC
Probably just fixed by this upstream commit:

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a5fb313cb7b7e692fd4684916aaa98e03ec7e8b6

Comment 3 Fedora Update System 2011-11-14 14:11:02 UTC
glibc-2.14.90-16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/FEDORA-2011-15723

Comment 4 Fedora Admin XMLRPC Client 2011-11-14 19:15:06 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Fedora Update System 2011-11-14 22:25:37 UTC
Package glibc-2.14.90-16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.14.90-16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-15723
then log in and leave karma (feedback).

Comment 6 Fedora Admin XMLRPC Client 2011-11-15 04:46:57 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Fedora Update System 2011-11-17 23:02:27 UTC
glibc-2.14.90-18 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/glibc-2.14.90-18

Comment 8 Jeff Law 2011-11-17 23:08:08 UTC
Bogus updates which caused this problem has been unpushed/reverted (-15, -16).

Comment 9 Fedora Update System 2011-11-21 17:45:02 UTC
glibc-2.14.90-19 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/glibc-2.14.90-19

Comment 10 Fedora Update System 2011-11-26 23:05:58 UTC
glibc-2.14.90-19 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.