From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C1BB23858D20; Thu, 13 Apr 2023 19:54:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1BB23858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681415691; bh=/MOCGKxsOFiRgT9r08r+XDy/yUhEmSO3p6M5YcqgtUI=; h=From:To:Subject:Date:From; b=EOjFHidAt9zHlQOp07AdIYA5q6NHQhdGbek6ditcOHvAcQqsqPdaDbaCF76augtEE dYFuRAXexkAmPzyk/MpUTKmFPFszNC1X64AlpUG86DXOHXSI4uoW308X5mehWPP9yU mybk4K6GXYgOXlEUmwVwYZdiQorfQxXgHsk/hvPs= From: "7i77an at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/30350] New: Deadlock flush - malloc - fork - fgets Date: Thu, 13 Apr 2023 19:54:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.27 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: 7i77an at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30350 Bug ID: 30350 Summary: Deadlock flush - malloc - fork - fgets Product: glibc Version: 2.27 Status: NEW Severity: critical Priority: P2 Component: libc Assignee: unassigned at sourceware dot org Reporter: 7i77an at gmail dot com CC: drepper.fsp at gmail dot com Target Milestone: --- Context: Linux ubuntucluster 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # /lib/x86_64-linux-gnu/libc.so.6 GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1) stable release version 2.27. Lua 5.1 Use PRELOAD Jemalloc 5.3. Description: Similar issue based on https://sourceware.org/bugzilla/show_bug.cgi?id=3D19= 431 BT Threads: Thread 377 (Thread 0x7fbcab75b700 (LWP 4403)): $6 =3D pthread_mutex_t =3D {Type =3D Normal, Status =3D Acquired, possibly = with waiters, Owner ID =3D 3156, Robust =3D No, Shared =3D No, Protocol =3D None} Thread 368 (Thread 0x7fbcac964700 (LWP 4394)): $7 =3D pthread_mutex_t =3D {Type =3D Normal, Status =3D Acquired, possibly = with waiters, Owner ID =3D 3156, Robust =3D No, Shared =3D No, Protocol =3D None} Thread 360 (Thread 0x7fbcad96c700 (LWP 4386)): $8 =3D pthread_mutex_t =3D {Type =3D Normal, Status =3D Acquired, possibly = with waiters, Owner ID =3D 3156, Robust =3D No, Shared =3D No, Protocol =3D None} Thread 355 (Thread 0x7fbcae371700 (LWP 4381)): $2 =3D pthread_mutex_t =3D {Type =3D Normal, Status =3D Acquired, possibly = with waiters, Owner ID =3D 3156, Robust =3D No, Shared =3D No, Protocol =3D None} [Switching to thread 7 (Thread 0x7fbd273fa700 (LWP 3156))] #0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95 95 ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or directory. (gdb) bt #0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95 #1 0x00007fbd286c0e2a in __GI__IO_list_lock () at genops.c:1188 #2 0x00007fbd28715965 in __libc_fork () at ../sysdeps/nptl/fork.c:125 #3 0x00007fbd286b16b4 in _IO_new_proc_open (fp=3Dfp@entry=3D0x7fbc9860ae00, command=3Dcommand@entry=3D0x7fbc019251f8 "lsb_release -i", mode=3D, mode@entry=3D0x7fbc37e03df8 "r") at iopopen.c:122 #4 0x00007fbd286b1938 in _IO_new_popen (command=3Dcommand@entry=3D0x7fbc01= 9251f8 "lsb_release -i", mode=3Dmode@entry=3D0x7fbc37e03df8 "r") at iopopen.c:206 #5 0x000056156400b4f2 in io_popen (L=3D0x7fbc019f8000) at liolib.c:178 #6 0x0000561563ff9f48 in luaD_precall (L=3DL@entry=3D0x7fbc019f8000, func=3Dfunc@entry=3D0x7fbba9e04490, nresults=3Dnresults@entry=3D-1) at ldo.= c:320 #7 0x0000561564003602 in luaV_execute (L=3DL@entry=3D0x7fbc019f8000, nexec= calls=3D6, nexeccalls@entry=3D1) at lvm.c:591 #8 0x0000561563ffa2ad in luaD_call (L=3D0x7fbc019f8000, func=3D0x7fbba9e04= 380, nResults=3D) at ldo.c:378 #9 0x0000561563ff971e in luaD_rawrunprotected (L=3DL@entry=3D0x7fbc019f800= 0, f=3Df@entry=3D0x561563ff5b80 , ud=3Dud@entry=3D0x7fbd273f8490) at l= do.c:116 #10 0x0000561563ffa41b in luaD_pcall (L=3DL@entry=3D0x7fbc019f8000, func=3Dfunc@entry=3D0x561563ff5b80 , u=3Du@entry=3D0x7fbd273f8490, = old_top=3D896, ef=3D) at ldo.c:464 #11 0x0000561563ff79d5 in lua_pcall (L=3DL@entry=3D0x7fbc019f8000, nargs=3Dnargs@entry=3D0, nresults=3Dnresults@entry=3D-1, errfunc=3Derrfunc@= entry=3D1) at lapi.c:821 #12 0x000056156400893c in luaB_xpcall (L=3D0x7fbc019f8000) at lbaselib.c:389 #13 0x0000561563ff9f48 in luaD_precall (L=3DL@entry=3D0x7fbc019f8000, func=3Dfunc@entry=3D0x7fbba9e04360, nresults=3Dnresults@entry=3D2) at ldo.c= :320 #14 0x0000561564003602 in luaV_execute (L=3DL@entry=3D0x7fbc019f8000, nexec= calls=3D5, nexeccalls@entry=3D1) at lvm.c:591 #15 0x0000561563ffa2ad in luaD_call (L=3D0x7fbc019f8000, func=3D0x7fbba9e04= 1b0, nResults=3D) at ldo.c:378 #16 0x0000561563ff971e in luaD_rawrunprotected (L=3DL@entry=3D0x7fbc019f800= 0, f=3Df@entry=3D0x561563ff5b80 , ud=3Dud@entry=3D0x7fbd273f8740) at l= do.c:116 #17 0x0000561563ffa41b in luaD_pcall (L=3DL@entry=3D0x7fbc019f8000, func=3Dfunc@entry=3D0x561563ff5b80 , u=3Du@entry=3D0x7fbd273f8740, = old_top=3D432, ef=3D) at ldo.c:464 #18 0x0000561563ff79d5 in lua_pcall (L=3DL@entry=3D0x7fbc019f8000, nargs=3Dnargs@entry=3D0, nresults=3Dnresults@entry=3D-1, errfunc=3Derrfunc@= entry=3D1) at lapi.c:821 #19 0x000056156400893c in luaB_xpcall (L=3D0x7fbc019f8000) at lbaselib.c:389 #20 0x0000561563ff9f48 in luaD_precall (L=3DL@entry=3D0x7fbc019f8000, func=3Dfunc@entry=3D0x7fbba9e04190, nresults=3Dnresults@entry=3D-1) at ldo.= c:320 #21 0x000056156400359f in luaV_execute (L=3DL@entry=3D0x7fbc019f8000, nexec= calls=3D3, nexeccalls@entry=3D1) at lvm.c:612 #22 0x0000561563ffa2ad in luaD_call (L=3D0x7fbc019f8000, func=3D0x7fbba9e04= 040, nResults=3D) at ldo.c:378 #23 0x0000561563ff971e in luaD_rawrunprotected (L=3DL@entry=3D0x7fbc019f800= 0, f=3Df@entry=3D0x561563ff5b80 , ud=3Dud@entry=3D0x7fbd273f89f0) at l= do.c:116 #24 0x0000561563ffa41b in luaD_pcall (L=3DL@entry=3D0x7fbc019f8000, func=3Dfunc@entry=3D0x561563ff5b80 , u=3Du@entry=3D0x7fbd273f89f0, = old_top=3D64, ef=3D) at ldo.c:464 #25 0x0000561563ff79d5 in lua_pcall (L=3D0x7fbc019f8000, nargs=3D, nresults=3D-1, errfunc=3D) at lapi.c:821 (gdb)f 1 (gdb)p list_all_lock $6 =3D {lock =3D 2, cnt =3D 1, owner =3D 0x7fbd223d2700} [Switching to thread 47 (Thread 0x7fbd223d2700 (LWP 3196))] #0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95 #1 0x00007fbd286c0274 in _IO_flush_all_lockp (do_lock=3Ddo_lock@entry=3D1)= at genops.c:762 #2 0x00007fbd286c06fa in __GI__IO_flush_all () at genops.c:790 #3 0x00007fbd286af895 in __GI__IO_fflush (fp=3Dfp@entry=3D0x0) at iofflush= .c:34 #4 0x000056156400b4e7 in io_popen (L=3D0x7fbc2905e780) at liolib.c:178 #5 0x0000561563ff9f48 in luaD_precall (L=3DL@entry=3D0x7fbc2905e780, func=3Dfunc@entry=3D0x7fbc08418c90, nresults=3Dnresults@entry=3D-1) at ldo.= c:320 #6 0x0000561564003602 in luaV_execute (L=3DL@entry=3D0x7fbc2905e780, nexec= calls=3D6, nexeccalls@entry=3D1) at lvm.c:591 #7 0x0000561563ffa2ad in luaD_call (L=3D0x7fbc2905e780, func=3D0x7fbc08418= b80, nResults=3D) at ldo.c:378 #8 0x0000561563ff971e in luaD_rawrunprotected (L=3DL@entry=3D0x7fbc2905e78= 0, f=3Df@entry=3D0x561563ff5b80 , ud=3Dud@entry=3D0x7fbd223d0490) at l= do.c:116 #9 0x0000561563ffa41b in luaD_pcall (L=3DL@entry=3D0x7fbc2905e780, func=3Dfunc@entry=3D0x561563ff5b80 , u=3Du@entry=3D0x7fbd223d0490, = old_top=3D896, ef=3D) at ldo.c:464 #10 0x0000561563ff79d5 in lua_pcall (L=3DL@entry=3D0x7fbc2905e780, nargs=3Dnargs@entry=3D0, nresults=3Dnresults@entry=3D-1, errfunc=3Derrfunc@= entry=3D1) at lapi.c:821 #11 0x000056156400893c in luaB_xpcall (L=3D0x7fbc2905e780) at lbaselib.c:389 #12 0x0000561563ff9f48 in luaD_precall (L=3DL@entry=3D0x7fbc2905e780, func=3Dfunc@entry=3D0x7fbc08418b60, nresults=3Dnresults@entry=3D2) at ldo.c= :320 #13 0x0000561564003602 in luaV_execute (L=3DL@entry=3D0x7fbc2905e780, nexec= calls=3D5, nexeccalls@entry=3D1) at lvm.c:591 #14 0x0000561563ffa2ad in luaD_call (L=3D0x7fbc2905e780, func=3D0x7fbc08418= 9b0, nResults=3D) at ldo.c:378 #15 0x0000561563ff971e in luaD_rawrunprotected (L=3DL@entry=3D0x7fbc2905e78= 0, f=3Df@entry=3D0x561563ff5b80 , ud=3Dud@entry=3D0x7fbd223d0740) at l= do.c:116 #16 0x0000561563ffa41b in luaD_pcall (L=3DL@entry=3D0x7fbc2905e780, func=3Dfunc@entry=3D0x561563ff5b80 , u=3Du@entry=3D0x7fbd223d0740, = old_top=3D432, ef=3D) at ldo.c:464 #17 0x0000561563ff79d5 in lua_pcall (L=3DL@entry=3D0x7fbc2905e780, nargs=3Dnargs@entry=3D0, nresults=3Dnresults@entry=3D-1, errfunc=3Derrfunc@= entry=3D1) at lapi.c:821 #18 0x000056156400893c in luaB_xpcall (L=3D0x7fbc2905e780) at lbaselib.c:389 #19 0x0000561563ff9f48 in luaD_precall (L=3DL@entry=3D0x7fbc2905e780, func=3Dfunc@entry=3D0x7fbc08418990, nresults=3Dnresults@entry=3D-1) at ldo.= c:320 #20 0x000056156400359f in luaV_execute (L=3DL@entry=3D0x7fbc2905e780, nexec= calls=3D3, nexeccalls@entry=3D1) at lvm.c:612 #21 0x0000561563ffa2ad in luaD_call (L=3D0x7fbc2905e780, func=3D0x7fbc08418= 840, nResults=3D) at ldo.c:378 #22 0x0000561563ff971e in luaD_rawrunprotected (L=3DL@entry=3D0x7fbc2905e78= 0, f=3Df@entry=3D0x561563ff5b80 , ud=3Dud@entry=3D0x7fbd223d09f0) at l= do.c:116 #23 0x0000561563ffa41b in luaD_pcall (L=3DL@entry=3D0x7fbc2905e780, func=3Dfunc@entry=3D0x561563ff5b80 , u=3Du@entry=3D0x7fbd223d09f0, = old_top=3D64, ef=3D) at ldo.c:464 #24 0x0000561563ff79d5 in lua_pcall (L=3D0x7fbc2905e780, nargs=3D, nresults=3D-1, errfunc=3D) at lapi.c:821 (gdb) f 1 #1 0x00007fbd286c0274 in _IO_flush_all_lockp (do_lock=3Ddo_lock@entry=3D1)= at genops.c:762 762 genops.c: No such file or directory. (gdb) p list_all_lock $7 =3D {lock =3D 2, cnt =3D 1, owner =3D 0x7fbd223d2700} (gdb) p *fp $8 =3D {_flags =3D -72539000, _IO_read_ptr =3D 0x0, _IO_read_end =3D 0x0, _= IO_read_base =3D 0x0, _IO_write_base =3D 0x0, _IO_write_ptr =3D 0x0, _IO_write_end =3D 0= x0, _IO_buf_base =3D 0x0, _IO_buf_end =3D 0x0, _IO_save_base =3D 0x0, _IO_backu= p_base =3D 0x0, _IO_save_end =3D 0x0, _markers =3D 0x0, _chain =3D 0x7fbc8ce14f80, _filen= o =3D 1331, _flags2 =3D 128, _old_offset =3D 5788344089832285558, _cur_column =3D 0, _vtable_offset =3D 46 '.', _shortbuf =3D "1", _lock =3D 0x7fbca8219160, _of= fset =3D -1, _codecvt =3D 0x722d302e33207465, _wide_data =3D 0x7fbca8219170, _freeres_= list =3D 0x0, _freeres_buf =3D 0x313930353d544e45, __pad5 =3D 3979268027835692085, _= mode =3D -1, _unused2 =3D "bba22cd111cb426c\" ti"} (gdb) p *(fp._lock) $9 =3D {lock =3D 2, cnt =3D 1, owner =3D 0x7fbd219cd700} 0x7fbd219cd700 (thread 52) #0 __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:= 135 #1 0x00007fbd29836025 in __GI___pthread_mutex_lock (mutex=3Dmutex@entry=3D0x7fbca8415d68) at ../nptl/pthread_mutex_lock.c:80 #2 0x00007fbd2a7c4fde in malloc_mutex_lock_final (mutex=3D0x7fbca8415d28) = at include/jemalloc/internal/mutex.h:151 #3 je_malloc_mutex_lock_slow (mutex=3Dmutex@entry=3D0x7fbca8415d28) at src/mutex.c:90 #4 0x00007fbd2a764b66 in malloc_mutex_lock (mutex=3D, tsdn=3D) at include/jemalloc/internal/mutex.h:217 #5 je_arena_cache_bin_fill_small (tsdn=3Dtsdn@entry=3D0x7fbd219ccca8, arena=3Darena@entry=3D0x7fbca8401040, cache_bin=3Dcache_bin@entry=3D0x7fbd2= 19cd2a8, cache_bin_info=3D, binind=3Dbinind@entry=3D28, nfill=3D) at src/arena.c:972 #6 0x00007fbd2a7d1329 in je_tcache_alloc_small_hard (tsdn=3Dtsdn@entry=3D0x7fbd219ccca8, arena=3Darena@entry=3D0x7fbca8401040, tcache=3Dtcache@entry=3D0x7fbd219cd000, cache_bin=3Dcache_bin@entry=3D0x7fb= d219cd2a8, binind=3Dbinind@entry=3D28, tcache_success=3Dtcache_success@entry=3D0x7fbd219c8d00) at src/tcache.c= :238 #7 0x00007fbd2a75a9df in tcache_alloc_small (slow_path=3D, zero=3Dfalse, binind=3D28, size=3D, tcache=3D0x7fbd219cd000, arena=3D, tsd=3D) at include/jemalloc/internal/tcache_inlines.h:68 #8 arena_malloc (slow_path=3D, tcache=3D0x7fbd219cd000, zer= o=3Dfalse, ind=3D28, size=3D, arena=3D0x0, tsdn=3D) at include/jemalloc/internal/arena_inlines_b.h:151 #9 iallocztm (slow_path=3D, arena=3D0x0, is_internal=3Dfals= e, tcache=3D0x7fbd219cd000, zero=3Dfalse, ind=3D28, size=3D, tsdn=3D) at include/jemalloc/internal/jemalloc_internal_inlines_c.h:55 #10 imalloc_no_sample (ind=3D28, usize=3D4096, size=3D, tsd=3D0x7fbd219ccca8, dopts=3D, sopts=3D) at src/jemalloc.c:2398 #11 imalloc_body (tsd=3D0x7fbd219ccca8, dopts=3D, sopts=3D) at src/jemalloc.c:2573 #12 imalloc (dopts=3D, sopts=3D) at src/jemalloc.c:2687 #13 je_malloc_default (size=3D) at src/jemalloc.c:2722 #14 0x00007fbd2a75b14d in imalloc_fastpath (fallback_alloc=3D0x7fbd2a75a820 , size=3Dsize@entry=3D4096) at include/jemalloc/internal/jemalloc_internal_inlines_c.h:266 #15 malloc (size=3Dsize@entry=3D4096) at src/jemalloc.c:2746 #16 0x00007fbd286af13c in __GI__IO_file_doallocate (fp=3D0x7fbca8219080) at filedoalloc.c:101 #17 0x00007fbd286bf329 in __GI__IO_doallocbuf (fp=3Dfp@entry=3D0x7fbca82190= 80) at genops.c:365 #18 0x00007fbd286be204 in _IO_new_file_underflow (fp=3D0x7fbca8219080) at fileops.c:495 #19 0x00007fbd286bf3a2 in __GI__IO_default_uflow (fp=3D0x7fbca8219080) at genops.c:380 #20 0x00007fbd286b0e12 in __GI__IO_getline_info (eof=3D0x0, extract_delim=3D, delim=3D10, n=3D1023, buf=3D0x7fbd219c8f80= "", fp=3D0x7fbca8219080, fp@entry=3D0x0) at iogetline.c:60 #21 __GI__IO_getline (fp=3Dfp@entry=3D0x7fbca8219080, buf=3Dbuf@entry=3D0x7= fbd219c8f80 "", n=3D, delim=3Ddelim@entry=3D10, extract_delim=3Dextract_delim@entry=3D1) at iogetline.c:34 #22 0x00007fbd286afb7d in _IO_fgets (buf=3D0x7fbd219c8f80 "", n=3D, fp=3D0x7fbca8219080) at iofgets.c:53 $5 =3D pthread_mutex_t =3D {Type =3D Normal, Status =3D Acquired, possibly = with waiters, Owner ID =3D 3156, Robust =3D No, Shared =3D No, Protocol =3D None} [Switching to thread 7 (Thread 0x7fbd273fa700 (LWP 3156))] The initial Thread.... =3D=3D> genops.c int _IO_flush_all_lockp (int do_lock) { int result =3D 0; struct _IO_FILE *fp; #ifdef _IO_MTSAFE_IO _IO_cleanup_region_start_noarg (flush_cleanup); _IO_lock_lock (list_all_lock); #endif for (fp =3D (_IO_FILE *) _IO_list_all; fp !=3D NULL; fp =3D fp->_chain) { run_fp =3D fp; if (do_lock) _IO_flockfile (fp); if (((fp->_mode <=3D 0 && fp->_IO_write_ptr > fp->_IO_write_base) || (_IO_vtable_offset (fp) =3D=3D 0 && fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr > fp->_wide_data->_IO_write_base)) ) && _IO_OVERFLOW (fp, EOF) =3D=3D EOF) result =3D EOF; if (do_lock) _IO_funlockfile (fp);=20 run_fp =3D NULL; } #ifdef _IO_MTSAFE_IO _IO_lock_unlock (list_all_lock); _IO_cleanup_region_end (0); #endif return result; } --=20 You are receiving this mail because: You are on the CC list for the bug.=