From owner-freebsd-threads@freebsd.org Sun Feb 7 02:50:35 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BD74AA0C64 for ; Sun, 7 Feb 2016 02:50:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 430601A69 for ; Sun, 7 Feb 2016 02:50:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u172oZwK068678 for ; Sun, 7 Feb 2016 02:50:35 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Sun, 07 Feb 2016 02:50:35 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rblayzor@inoc.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 02:50:35 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #31 from rblayzor@inoc.net --- Probably not entirely helpful. This appears to be an unsuccessful core file again: Failed to write core file for process dovecot (error 14) pid 718 (dovecot), uid 0: exited on signal 11 #0 service_process_create (service=3DCannot access memory at address 0x7fffffffb250 ) at service-process.c:311 uid_counter =3D 232627 process =3D (struct service_process *) Cannot access memory at addr= ess 0x7fffffffb248 Current language: auto; currently minimal (gdb) x/i $rip 0x40dd08 : mov %eax,-0x2c(%rbp) (gdb) info registers rax 0x4a78 19064 rbx 0x0 0 rcx 0x800c6625a 34372739674 rdx 0x0 0 rsi 0x40d760 4249440 rdi 0x0 0 rbp 0x7fffffffb260 0x7fffffffb260 rsp 0x7fffffffb220 0x7fffffffb220 r8 0x2 2 r9 0x1 1 r10 0x2710 10000 r11 0x202 514 r12 0x7fffffffb4b8 140737488336056 r13 0x7fffffffb4e0 140737488336096 r14 0x7fffffffb4c0 140737488336064 r15 0x3 3 rip 0x40dd08 0x40dd08 eflags 0x10202 66050 cs 0x43 67 ss 0x3b 59 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 (gdb) --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Mon Feb 8 21:35:08 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF7DAAA2041 for ; Mon, 8 Feb 2016 21:35:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2649341 for ; Mon, 8 Feb 2016 21:35:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u18LZ87T003976 for ; Mon, 8 Feb 2016 21:35:08 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Mon, 08 Feb 2016 21:35:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jhb@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 21:35:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #32 from John Baldwin --- Can you get 'procstat -v /path/to/foo.core' output from that last core? --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Mon Feb 8 21:55:28 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6C7EAA29D3 for ; Mon, 8 Feb 2016 21:55:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 805CCFA4 for ; Mon, 8 Feb 2016 21:55:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u18LtSSi046751 for ; Mon, 8 Feb 2016 21:55:28 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Mon, 08 Feb 2016 21:55:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rblayzor@inoc.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2016 21:55:28 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #33 from rblayzor@inoc.net --- PID START END PRT RES PRES REF SHD FL TP P= ATH 718 0x400000 0x417000 r-x 19 19 1 0 CN-- vn 718 0x617000 0x618000 rw- 1 1 1 0 CN-- df 718 0x800617000 0x800635000 r-x 30 30 34 0 CN-- vn /libexec/ld-elf.so.1 718 0x800635000 0x800663000 rw- 36 36 1 0 CN-- df 718 0x800834000 0x800836000 rw- 2 2 1 0 CN-- df 718 0x800836000 0x800983000 r-x 216 222 38 19 CN-- vn /usr/local/lib/dovecot/libdovecot.so.0.0.0 718 0x800983000 0x800b82000 --- 0 0 1 0 CN-- df 718 0x800b82000 0x800b89000 rw- 7 0 1 0 CN-- vn /usr/local/lib/dovecot/libdovecot.so.0.0.0 718 0x800b89000 0x800b8b000 rw- 2 2 1 0 CN-- df 718 0x800b8b000 0x800d02000 r-x 375 386 67 33 CN-- vn /lib/libc.so.7 718 0x800d02000 0x800f01000 --- 0 0 1 0 CN-- df 718 0x800f01000 0x800f0d000 rw- 12 0 1 0 CN-- vn /lib/libc.so.7 718 0x800f0d000 0x800f37000 rw- 13 13 1 0 CN-- df 718 0x801000000 0x801800000 rw- 94 94 1 0 CN-- df 718 0x7ffffffdf000 0x7ffffffff000 rw- 8 0 1 0 C--D df 718 0x7ffffffff000 0x800000000000 r-x 1 1 36 0 ---- ph --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Wed Feb 10 00:10:14 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F238AA291F for ; Wed, 10 Feb 2016 00:10:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 701271F8B for ; Wed, 10 Feb 2016 00:10:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1A0AErw022301 for ; Wed, 10 Feb 2016 00:10:14 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Wed, 10 Feb 2016 00:10:14 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jhb@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 00:10:14 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #34 from John Baldwin --- https://svnweb.freebsd.org/changeset/base/295454 Is the backport of the coredump fixes I mentioned previously to stable/10. = I haven't tried to apply those to 10.2, but I think there's a decent chance t= hat will apply cleanly. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Wed Feb 10 12:11:35 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE52CAA4C9D for ; Wed, 10 Feb 2016 12:11:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EBAE1053 for ; Wed, 10 Feb 2016 12:11:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1ACBZIm013818 for ; Wed, 10 Feb 2016 12:11:35 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Wed, 10 Feb 2016 12:11:35 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rblayzor@inoc.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 12:11:35 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #35 from rblayzor@inoc.net --- I was not able to roll out a 10/stable NFS root based on some other issues restricting that. If there is a patch file against 10.2 I can certainly try that. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Wed Feb 10 18:50:17 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EEEEAA39B0 for ; Wed, 10 Feb 2016 18:50:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DEE711D6 for ; Wed, 10 Feb 2016 18:50:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AIoGkp005472 for ; Wed, 10 Feb 2016 18:50:16 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Wed, 10 Feb 2016 18:50:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jhb@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 18:50:17 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #36 from John Baldwin --- The patch from the commit applies cleanly to a 10.2 checkout: > pwd /usr/home/john/work/freebsd/releng/10.2 > svn merge -c 295454 ^/stable/10 --- Merging r295454 into '.': U lib/libprocstat/libprocstat.c U lib/libutil/kinfo_getfile.c U lib/libutil/kinfo_getvmmap.c U share/man/man5/core.5 U sys/kern/imgact_elf.c U sys/kern/kern_descrip.c U sys/kern/kern_exec.c U sys/kern/kern_proc.c U sys/sys/exec.h U sys/sys/user.h G . --- Recording mergeinfo for merge of r295454 into '.': G . It might be simplest to apply it your tree using something like: % cd /path/to/10.2/tree % svn diff -c 295454 https://svn.freebsd.org/stable/10 > foo.patch % svn patch foo.patch --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Wed Feb 10 19:47:59 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 700F3AA48F8 for ; Wed, 10 Feb 2016 19:47:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 607381AFC for ; Wed, 10 Feb 2016 19:47:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AJlx1V059223 for ; Wed, 10 Feb 2016 19:47:59 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Wed, 10 Feb 2016 19:47:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rblayzor@inoc.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 19:47:59 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #37 from rblayzor@inoc.net --- Is building the kernel enough for this patch or does it require a complete buildworld? --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Wed Feb 10 22:38:16 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C59AA48BA for ; Wed, 10 Feb 2016 22:38:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6770A176A for ; Wed, 10 Feb 2016 22:38:16 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1AMcF9e058311 for ; Wed, 10 Feb 2016 22:38:16 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Wed, 10 Feb 2016 22:38:16 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jhb@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2016 22:38:16 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #38 from John Baldwin --- You can get by with a new kernel only. If the bug this protects against occurs, procstat from an old world might not be able to read file (-f) or VM info (-v) from a core dump correctly, but gdb, etc. should work fine. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Thu Feb 11 15:22:22 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69565AA5E0E for ; Thu, 11 Feb 2016 15:22:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B9F12C1 for ; Thu, 11 Feb 2016 15:22:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BFMM0d066621 for ; Thu, 11 Feb 2016 15:22:22 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Thu, 11 Feb 2016 15:22:22 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rblayzor@inoc.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 15:22:22 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #39 from rblayzor@inoc.net --- I did get the patch and it installed cleanly. When I booted the new kernel,= I did notice I got the same error previously, and a partial core file. I've decided to stop beating a dead horse on 10.2 and checked out 10.3-BETA1. (FreeBSD 10.3-BETA1 #1 r295491M) I've built the VM's and new NFS root with this, however, my binaries/ports = are built against 10.2 still. (not sure if that's the problem). If I still see = the problem happen on 10.3 I'll grab what I can and then I'll attempt to rebuild the ports against 10.3.... --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Thu Feb 11 22:24:53 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 559ACAA6D6A for ; Thu, 11 Feb 2016 22:24:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483E1A6B for ; Thu, 11 Feb 2016 22:24:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1BMOrbm093538 for ; Thu, 11 Feb 2016 22:24:53 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Thu, 11 Feb 2016 22:24:52 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rblayzor@inoc.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 22:24:53 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #40 from rblayzor@inoc.net --- Just experienced the same issue on 10.3-BETA1 FreeBSD 10.3-BETA1 #1 r295491M Failed to write core file for process dovecot (error 14) pid 716 (dovecot), uid 0: exited on signal 11 ls -l /var/spool/tmp/dovecot.core -rw------- 1 root wheel 8925184 Feb 11 19:47 /var/spool/tmp/dovecot.core #0 service_process_create (service=3DCannot access memory at address 0x7fffffffb250 ) at service-process.c:311 311 service-process.c: No such file or directory. in service-process.c (gdb) bt full #0 service_process_create (service=3DCannot access memory at address 0x7fffffffb250 ) at service-process.c:311 uid_counter =3D 7828 process =3D (struct service_process *) Cannot access memory at addr= ess 0x7fffffffb248 Current language: auto; currently minimal (gdb) x/i $rip 0x40dd08 : mov %eax,-0x2c(%rbp) (gdb) info registers rax 0x4a41 19009 rbx 0x0 0 rcx 0x800c66f0a 34372742922 rdx 0x0 0 rsi 0x40d760 4249440 rdi 0x0 0 rbp 0x7fffffffb260 0x7fffffffb260 rsp 0x7fffffffb220 0x7fffffffb220 r8 0x2 2 r9 0x1 1 r10 0x2710 10000 r11 0x202 514 r12 0x7fffffffb4b8 140737488336056 r13 0x7fffffffb4e0 140737488336096 r14 0x7fffffffb4c0 140737488336064 r15 0x3 3 rip 0x40dd08 0x40dd08 eflags 0x10202 66050 cs 0x43 67 ss 0x3b 59 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 procstat -v /var/spool/tmp/dovecot.core PID START END PRT RES PRES REF SHD FL TP P= ATH 716 0x400000 0x417000 r-x 22 23 1 0 CN-- vn 716 0x617000 0x618000 rw- 1 1 1 0 CN-- df 716 0x800617000 0x800635000 r-x 30 30 34 0 CN-- vn /libexec/ld-elf.so.1 716 0x800635000 0x800663000 rw- 36 36 1 0 CN-- df 716 0x800834000 0x800836000 rw- 2 2 1 0 CN-- df 716 0x800836000 0x800983000 r-x 226 232 38 19 CN-- vn /usr/local/lib/dovecot/libdovecot.so.0.0.0 716 0x800983000 0x800b82000 --- 0 0 1 0 CN-- df 716 0x800b82000 0x800b89000 rw- 7 0 1 0 CN-- vn /usr/local/lib/dovecot/libdovecot.so.0.0.0 716 0x800b89000 0x800b8b000 rw- 2 2 1 0 CN-- df 716 0x800b8b000 0x800d03000 r-x 376 387 66 32 CN-- vn /lib/libc.so.7 716 0x800d03000 0x800f02000 --- 0 0 1 0 CN-- df 716 0x800f02000 0x800f0e000 rw- 12 0 1 0 CN-- vn /lib/libc.so.7 716 0x800f0e000 0x800f38000 rw- 13 13 1 0 CN-- df 716 0x801000000 0x801800000 rw- 94 94 1 0 CN-- df 716 0x7ffffffdf000 0x7ffffffff000 rw- 8 0 1 0 C--D df 716 0x7ffffffff000 0x800000000000 r-x 1 1 36 0 ---- ph --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Fri Feb 12 23:24:44 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 508EAAA72EA for ; Fri, 12 Feb 2016 23:24:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 431C99A for ; Fri, 12 Feb 2016 23:24:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id 3DBE3AA72E8; Fri, 12 Feb 2016 23:24:44 +0000 (UTC) Delivered-To: threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CEBFAA72E6; Fri, 12 Feb 2016 23:24:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 2989D97; Fri, 12 Feb 2016 23:24:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id A01C456497; Fri, 12 Feb 2016 17:24:43 -0600 (CST) Subject: Re: libthr shared locks References: <20151223172528.GT3625@kib.kiev.ua> From: Eric van Gyzen X-Enigmail-Draft-Status: N1110 To: Konstantin Belousov , threads@freebsd.org, arch@freebsd.org Message-ID: <56BE69B8.9020808@FreeBSD.org> Date: Fri, 12 Feb 2016 17:24:40 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20151223172528.GT3625@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 23:24:44 -0000 On 12/23/2015 11:25, Konstantin Belousov wrote: > The implementation in the patch > https://www.kib.kiev.ua/kib/pshared/pshared.1.patch > gives shared mutexes, condvars, rwlocks and barriers. I reviewed everything except kern_umtx.c, which I plan to review on Monday. Here are my comments so far. * thr_mutex.c Thank you for converting some macros to functions. I find functions much cleaner and easier to read and debug. * thr_mutex.c line 116 The parentheses around (m) can be removed now. * thr_mutex.c lines 331-333 m->m_qe.tqe_prev = TAILQ_NEXT(last_priv, m_qe)-> m_qe.tqe_prev; This seems to read the m_qe.tqe_prev field from a shared mutex. Is that safe? It seems like a race. The following would seem more direct, avoiding the shared mutex: m->m_qe.tqe_prev = &TAILQ_NEXT(last_prev, m_qe); * thr_mutex.c line 354 *(q)->tqh_last = last_priv; This seems to modify the tqe_next field in a shared mutex. Is that safe? Furthermore, that mutex was/is the last on the list, but we seem to set its tqe_next pointer to an earlier element, creating a cycle in the list. * thr_mutex.c line 451 __pthread_mutex_trylock() calls __thr_pshared_offpage() twice [for pshared mutexes]. You could eliminate one call by moving mutex_trylock_common() inline. * thr_pshared.c line 165 res = NULL seems unnecessary. * thr_pshared.c In __thr_pshared_offpage(), can pshared_lookup() fail in the !doalloc case? pshared_hash seems to be an authority, not just an optimization. I ask so that I can understand the code and more effectively review it. In particular, if pshared_lookup() fails and UMTX_SHM_LOOKUP succeeds, is it possible to get multiple mappings for the same shm object? * thr_barrier.c line 110 if (bar == NULL) return (EFAULT); POSIX does not mention EFAULT. Should we return ENOMEM, or can we "extend" the standard? (Ditto for all other _init functions.) * thr_cond.c line 106 You could use cattr instead of the ?: expression. * thr_rwlock.c rwlock_init() assumes that __thr_pshared_offpage() does not fail. From owner-freebsd-threads@freebsd.org Sat Feb 13 12:47:08 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A05E4AA686F for ; Sat, 13 Feb 2016 12:47:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9256F1EFB for ; Sat, 13 Feb 2016 12:47:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u1DCl8ZS084093 for ; Sat, 13 Feb 2016 12:47:08 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 204426] Processes terminating cannot access memory Date: Sat, 13 Feb 2016 12:47:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rblayzor@inoc.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 12:47:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D204426 --- Comment #41 from Robert Blayzor --- and here is a recent core (that actually dumped full) for exim: #0 _thr_signal_postfork_child () at /.amd_mnt/juno/pub/FreeBSD/10-STABLE/lib/libthr/thread/thr_sig.c:508 508 /.amd_mnt/juno/pub/FreeBSD/10-STABLE/lib/libthr/thread/thr_sig.c: No such file or directory. in /.amd_mnt/juno/pub/FreeBSD/10-STABLE/lib/libthr/thread/thr_sig.c [New Thread 803006400 (LWP 100045/)] (gdb) bt full #0 _thr_signal_postfork_child () at /.amd_mnt/juno/pub/FreeBSD/10-STABLE/lib/libthr/thread/thr_sig.c:508 No locals. #1 0x000000080120706d in __thr_fork () at /.amd_mnt/juno/pub/FreeBSD/10-STABLE/lib/libthr/thread/thr_fork.c:203 rtld_locks =3D {-4800, 32767, -4760, 32767, -4792, 32767, 3, 0} curthread =3D (struct pthread *) 0x803006400 cancelsave =3D 0 ret =3D 0 errsave =3D 4 #2 0x0000000000428c54 in handle_smtp_call (listen_sockets=3D0x803065140, listen_socket_count=3D4, accept_socket=3D7, accepted=3D0x7fffffffcd38) at daemon.c:355 pid =3D 32767 interface_sockaddr =3D {v4 =3D {sin_len =3D 28 '\034', sin_family = =3D 28 '\034', sin_port =3D 6400, sin_addr =3D {s_addr =3D 0}, sin_zero =3D 0x7fffffffc9a0 "&\a=C3=B0X\001\020"}, v6 =3D {sin6_len =3D= 28 '\034', sin6_family =3D 28 '\034', sin6_port =3D 6400, sin6_flowinfo =3D 0, sin6_ad= dr =3D { __u6_addr =3D {__u6_addr8 =3D 0x7fffffffc9a0 "&\a=C3=B0X\001\020", __= u6_addr16 =3D 0x7fffffffc9a0, __u6_addr32 =3D 0x7fffffffc9a0}}, sin6_scope_id =3D 0}, v0 = =3D { sa_len =3D 28 '\034', sa_family =3D 28 '\034', sa_data =3D 0x7fffffffc9= 9a ""}} ifsize =3D 28 dup_accept_socket =3D 9 max_for_this_host =3D 10 wfsize =3D 100 wfptr =3D 22 use_log_write_selector =3D 1980 whofrom =3D (uschar *) 0x803065e30 "[2607:f058:110:2::f:0]" reset_point =3D (void *) 0x803065e00 #3 0x0000000000427c55 in daemon_go () at daemon.c:2040 accept_socket =3D 7 sk =3D 0 max_socket =3D 6 lcount =3D 0 select_errno =3D 4 select_failed =3D 0 select_listen =3D {__fds_bits =3D 0x7fffffffcc40} accepted =3D {sin6_len =3D 28 '\034', sin6_family =3D 28 '\034', si= n6_port =3D 24059, sin6_flowinfo =3D 0, sin6_addr =3D {__u6_addr =3D { __u6_addr8 =3D 0x7fffffffcd40 "&\a=C3=B0X\001\020", __u6_addr16 =3D 0x7fffffffcd40, __u6_addr32 =3D 0x7fffffffcd40}}, sin6_scope_id =3D 0} len =3D 28 pid =3D 56724 pw =3D (struct passwd *) 0x802698328 listen_sockets =3D (int *) 0x803065140 listen_socket_count =3D 4 addresses =3D (ip_address_item *) 0x803065040 last_connection_time =3D 1455363261 #4 0x000000000044af25 in main (argc=3D3, cargv=3D0x7fffffffed48) at exim.c= :4719 rsopts =3D 0x761b00 argv =3D (uschar **) 0x7fffffffed48 arg_receive_timeout =3D -1 arg_smtp_receive_timeout =3D -1 arg_error_handling =3D 0 filter_sfd =3D -1 filter_ufd =3D -1 group_count =3D 1 i =3D 0 ---Type to continue, or q to quit--- rv =3D 0 list_queue_option =3D 0 msg_action =3D 0 msg_action_arg =3D -1 namelen =3D 20 queue_only_reason =3D 0 perl_start_option =3D 0 recipients_arg =3D 3 sender_address_domain =3D 0 test_retry_arg =3D -1 test_rewrite_arg =3D -1 arg_queue_only =3D 0 bi_option =3D 0 checking =3D 0 count_queue =3D 0 expansion_test =3D 0 extract_recipients =3D 0 flag_G =3D 0 flag_n =3D 0 forced_delivery =3D 0 f_end_dot =3D 0 deliver_give_up =3D 0 list_queue =3D 0 list_options =3D 0 local_queue_only =3D 7868416 more =3D 1 one_msg_action =3D 0 queue_only_set =3D 0 receiving_message =3D 0 sender_ident_set =3D 0 session_local_queue_only =3D -5288 unprivileged =3D 0 removed_privilege =3D 0 usage_wanted =3D 0 verify_address_mode =3D 0 verify_as_sender =3D 0 version_printed =3D 0 alias_arg =3D (uschar *) 0x0 called_as =3D (uschar *) 0x554616 "" cmdline_syslog_name =3D (uschar *) 0x0 start_queue_run_id =3D (uschar *) 0x0 stop_queue_run_id =3D (uschar *) 0x0 expansion_test_message =3D (uschar *) 0x0 ftest_domain =3D (uschar *) 0x0 ftest_localpart =3D (uschar *) 0x0 ftest_prefix =3D (uschar *) 0x0 ftest_suffix =3D (uschar *) 0x0 log_oneline =3D (uschar *) 0x0 malware_test_file =3D (uschar *) 0x0 ---Type to continue, or q to quit--- real_sender_address =3D (uschar *) 0x7fffffffeb58 " \005v" originator_home =3D (uschar *) 0x803065018 "/root" sz =3D 140737488350168 reset_point =3D (void *) 0x80231a310 pw =3D (struct passwd *) 0x802698328 statbuf =3D {st_dev =3D 1895890688, st_ino =3D 5, st_mode =3D 8576,= st_nlink =3D 1, st_uid =3D 0, st_gid =3D 0, st_rdev =3D 5, st_atim =3D {tv_sec =3D 14552= 01710, tv_nsec =3D 90063000}, st_mtim =3D {tv_sec =3D 1455201749, tv_nsec =3D = 0}, st_ctim =3D {tv_sec =3D 1455201749, tv_nsec =3D 0}, st_size =3D 0, st_blocks =3D 0, st_blksize =3D 4096, st_flags =3D 0, st_gen =3D 0, st_lspare =3D 0, st_bi= rthtim =3D {tv_sec =3D -1, tv_nsec =3D 0}} passed_qr_pid =3D 0 passed_qr_pipe =3D -1 group_list =3D 0x7fffffffd8f0 info_flag =3D CMDINFO_NONE info_stdout =3D 0 Current language: auto; currently minimal --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Sat Feb 13 14:38:27 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B243AA7678 for ; Sat, 13 Feb 2016 14:38:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 242041F93 for ; Sat, 13 Feb 2016 14:38:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 1E4F1AA7676; Sat, 13 Feb 2016 14:38:27 +0000 (UTC) Delivered-To: threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D654AA7674; Sat, 13 Feb 2016 14:38:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC6F11F90; Sat, 13 Feb 2016 14:38:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1DEcFKg073947 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 13 Feb 2016 16:38:16 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1DEcFKg073947 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1DEcFBY073946; Sat, 13 Feb 2016 16:38:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Feb 2016 16:38:15 +0200 From: Konstantin Belousov To: Eric van Gyzen Cc: threads@freebsd.org, arch@freebsd.org Subject: Re: libthr shared locks Message-ID: <20160213143815.GB91220@kib.kiev.ua> References: <20151223172528.GT3625@kib.kiev.ua> <56BE69B8.9020808@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BE69B8.9020808@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2016 14:38:27 -0000 Thank you for the review. On Fri, Feb 12, 2016 at 05:24:40PM -0600, Eric van Gyzen wrote: > * thr_mutex.c line 116 > > The parentheses around (m) can be removed now. Done. > > * thr_mutex.c lines 331-333 > > m->m_qe.tqe_prev = > TAILQ_NEXT(last_priv, m_qe)-> > m_qe.tqe_prev; > > This seems to read the m_qe.tqe_prev field from a shared mutex. Is that > safe? It seems like a race. The following would seem more direct, > avoiding the shared mutex: > > m->m_qe.tqe_prev = &TAILQ_NEXT(last_prev, m_qe); This is indeed racy, relying on the parent process not unlocking the shared mutexes. But after your note, I think that the whole list iteration is unsafe, because of the same unlocking in parent. So in fact I have to return to what I did in the previous version of the patch, where I kept two queues for each type of the mutexes, one total, and one private. The private queue keeps the order of the total, so that reinitialization of the total queue on the fork is correct for ceiling ordering. > * thr_mutex.c line 354 > > *(q)->tqh_last = last_priv; > > This seems to modify the tqe_next field in a shared mutex. Is that > safe? Furthermore, that mutex was/is the last on the list, but we seem > to set its tqe_next pointer to an earlier element, creating a cycle in > the list. This code is gone due to the previous note. > > * thr_mutex.c line 451 > > __pthread_mutex_trylock() calls __thr_pshared_offpage() twice [for > pshared mutexes]. You could eliminate one call by moving > mutex_trylock_common() inline. I see. In fact, I really wanted to eliminate the CHECK_AND_INIT_MUTEX. See my attempt in the updated patch. > > * thr_pshared.c line 165 > > res = NULL seems unnecessary. Done. > > * thr_pshared.c > > In __thr_pshared_offpage(), can pshared_lookup() fail in the !doalloc > case? pshared_hash seems to be an authority, not just an optimization. > I ask so that I can understand the code and more effectively review it. > In particular, if pshared_lookup() fails and UMTX_SHM_LOOKUP succeeds, > is it possible to get multiple mappings for the same shm object? Do you mean, is it possible (and if yes, is it harmful) to have several virtual addresses in one process for the same key ? I think there is a bug in pshared_insert() where I preferred new val over the hashed val (mapping address). In the situation where there are two threads trying to lock the same object, it may cause first thread to operate on unmapped address. The scenario is: - both threads do not find the key in hash; - first thread performs pshared_insert() and returns the address; - second thread performs pshared_insert() and replaces the address in hash, also invalidating the address still used by first thread. I changed the pshared_insert() to keep the existing hash value, and unmap the new val. That said, I think it is probably not very harmful to have different callers to operate on different mappings for the same key (of course, the backing page must be shared). I can only think of the problems due to locked mutex list manipulation functions failing if the address of element changed. I said that this should not be very harmful since I suspect that only list invariants checks would fail, and not actual removal, but I did not checked it. For now, I think that the invariant I have to ensure is that calls to lock and unlock from the same thread for the same key get the same offpage virtual address. > > * thr_barrier.c line 110 > > if (bar == NULL) > return (EFAULT); > > POSIX does not mention EFAULT. Should we return ENOMEM, or can we > "extend" the standard? (Ditto for all other _init functions.) I think EFAULT is permitted by the 'undefined behaviour' clause, since the primary cause for the offpage allocation failure is wrong address passed to the __thr_pshared_offpage(). In other words, if an implementation did not used offpage, but directly write something to the *m memory, it would get SIGSEGV. As noted above, malloc() failure would also lead to EFAULT (and this is what probably caused your question), but I would consider this improbable, while invalid address passed to the init function a more likely cause. I do not want to complicate code to distinguish the cases. > > * thr_cond.c line 106 > > You could use cattr instead of the ?: expression. Done. > > * thr_rwlock.c > > rwlock_init() assumes that __thr_pshared_offpage() does not fail. Done, I return EFAULT in case offpage allocation fails. If you object still against other EFAULTs, I would change all of them to be consistent. Updated patch is at https://www.kib.kiev.ua/kib/pshared/pshared.2.patch