Re: CVS commit: src/usr.sbin/sysinst/arch

2020-02-03 Thread Martin Husemann
On Mon, Feb 03, 2020 at 05:45:29PM -, Christos Zoulas wrote:
> Write a function perhaps instead of open-coding it in 3 places?

I'm more inclined to completely remove it as I think it never can
happen with the current editing frontend and disklabel backend, but
going for minimal changes right now as this needs to go into 9.0 and I
can't test localy.

Martin


Re: CVS commit: src/lib/libc/gen

2020-02-03 Thread Kamil Rytarowski
On 03.02.2020 17:24, Kamil Rytarowski wrote:
> On 03.02.2020 17:21, Joerg Sonnenberger wrote:
>> On Sat, Feb 01, 2020 at 03:38:46PM +, Kamil Rytarowski wrote:
>>> Module Name:src
>>> Committed By:   kamil
>>> Date:   Sat Feb  1 15:38:46 UTC 2020
>>>
>>> Modified Files:
>>> src/lib/libc/gen: pthread_atfork.c
>>>
>>> Log Message:
>>> Switch atform allocations from malloc()+free() to mmap()+munmap()
>>>
>>> This avoid bootstrapping malloc too early when libc+libpthread are not
>>> ready. It is called through pthread__init() -> _pthread_atfork().
>>>
>>> This also helps LLVM Leak Sanitizer to pacify false positive reports.
>>
>> Can we please stop adding more and more hacks for the still questionable
>> "new" jemalloc and sit down for a sane init model first please? I'm
>> still at the point to ask to just revert to the known-to-be-working
>> version and therefore would also strongly prefer this change to be
>> reverted.
>>
>> Joerg
>>
> 
> This change was reverted as there was a fallout. Init model is sane
> except for pthread_atfork()+malloc() called prematurely in pthread__init().
> 

OK. The pthread_atfork(3) call was introduced with the following change.

Maybe we should fix Python?

commit 25c9c068b18fceac33cc6fec61a1277b5dc6107c
Author: joerg 
Date:   Wed Dec 25 00:44:45 2019 +

Since pthread_setspecific requires locks, ensure that they are acquired
before fork and dropped in both parent and child. At least Python
depends on TSD after fork, even though it is undefined behavior in
POSIX.

diff --git a/lib/libpthread/pthread_tsd.c b/lib/libpthread/pthread_tsd.c
index 666cbab85f1b..d6e261de0bb9 100644
--- a/lib/libpthread/pthread_tsd.c
+++ b/lib/libpthread/pthread_tsd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_tsd.c,v 1.17 2019/03/05 01:35:52 christos Exp $
*/
+/* $NetBSD: pthread_tsd.c,v 1.18 2019/12/25 00:44:45 joerg Exp $   */

 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */

 #include 
-__RCSID("$NetBSD: pthread_tsd.c,v 1.17 2019/03/05 01:35:52 christos Exp
$");
+__RCSID("$NetBSD: pthread_tsd.c,v 1.18 2019/12/25 00:44:45 joerg Exp $");

 /* Functions and structures dealing with thread-specific data */
 #include 
@@ -61,6 +61,18 @@ null_destructor(void *p)
 #include 
 #include 

+static void
+pthread_tsd_prefork(void)
+{
+   pthread_mutex_lock(_mutex);
+}
+
+static void
+pthread_tsd_postfork(void)
+{
+   pthread_mutex_unlock(_mutex);
+}
+
 void *
 pthread_tsd_init(size_t *tlen)
 {
@@ -68,6 +80,8 @@ pthread_tsd_init(size_t *tlen)
size_t alen;
char *arena;

+   pthread_atfork(pthread_tsd_prefork, pthread_tsd_postfork,
pthread_tsd_postfork);
+
if ((pkm = pthread__getenv("PTHREAD_KEYS_MAX")) != NULL) {
pthread_keys_max = (int)strtol(pkm, NULL, 0);
if (pthread_keys_max < _POSIX_THREAD_KEYS_MAX)







signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/usr.sbin/sysinst/arch

2020-02-03 Thread Christos Zoulas
In article <20200203130929.9de7df...@cvs.netbsd.org>,
Martin Husemann  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  martin
>Date:  Mon Feb  3 13:09:29 UTC 2020
>
>Modified Files:
>   src/usr.sbin/sysinst/arch/hp300: md.c
>   src/usr.sbin/sysinst/arch/mvme68k: md.c
>   src/usr.sbin/sysinst/arch/x68k: md.c
>
>Log Message:
>PR install/54921: skip non-user partitions when checking for overlaps

Write a function perhaps instead of open-coding it in 3 places?

christos



Re: CVS commit: src/lib/libpthread

2020-02-03 Thread Kamil Rytarowski
On 03.02.2020 17:10, Ryo ONODERA wrote:
> Hi,
> 
> Kamil Rytarowski  writes:
> 
>> Please check this workaround:
>>
>> http://netbsd.org/~kamil/patch-00224-firefox-pthread_equal.txt
>>
>> It has to be applied on firefox's package.
> 
> Thank you very much.
> 
> This should be applied to pkgsrc/devel/nspr with slight change.
> (devel/nspr's C files cannot accept // comment.)
> This eliminates segfaults.
> 
> For the record, pthread_equal()'s first thread pointer, mon->owner, is
> invalid in PR_GetMonitorEntryCount() in nspr/pr/src/pthreads/ptsynch.c
> of devel/nspr.
> 

Please patch all affected packages in pkgsrc.

>>
>> The problem has to be reported upstream as a real bug.
> 
> Please file the bug report to Mozilla's bugzilla.
> 

I don't have a direct reproducer as of now myself. Please report a bug.

> Thank you very much.
> 




signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/lib/libpthread

2020-02-03 Thread Ryo ONODERA
Hi,

Kamil Rytarowski  writes:

> On 03.02.2020 17:10, Ryo ONODERA wrote:
>> Hi,
>> 
>> Kamil Rytarowski  writes:
>> 
>>> Please check this workaround:
>>>
>>> http://netbsd.org/~kamil/patch-00224-firefox-pthread_equal.txt
>>>
>>> It has to be applied on firefox's package.
>> 
>> Thank you very much.
>> 
>> This should be applied to pkgsrc/devel/nspr with slight change.
>> (devel/nspr's C files cannot accept // comment.)
>> This eliminates segfaults.
>> 
>> For the record, pthread_equal()'s first thread pointer, mon->owner, is
>> invalid in PR_GetMonitorEntryCount() in nspr/pr/src/pthreads/ptsynch.c
>> of devel/nspr.
>> 
>
> Please patch all affected packages in pkgsrc.

I will commit this patch to devwl/nspr.

>>>
>>> The problem has to be reported upstream as a real bug.
>> 
>> Please file the bug report to Mozilla's bugzilla.
>> 
>
> I don't have a direct reproducer as of now myself. Please report a bug.

O.k. I will submit this to Mozilla.

Thank you very much.

>> Thank you very much.
>> 
>
>

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Re: CVS commit: src/lib/libc/gen

2020-02-03 Thread Kamil Rytarowski
On 03.02.2020 17:21, Joerg Sonnenberger wrote:
> On Sat, Feb 01, 2020 at 03:38:46PM +, Kamil Rytarowski wrote:
>> Module Name: src
>> Committed By:kamil
>> Date:Sat Feb  1 15:38:46 UTC 2020
>>
>> Modified Files:
>>  src/lib/libc/gen: pthread_atfork.c
>>
>> Log Message:
>> Switch atform allocations from malloc()+free() to mmap()+munmap()
>>
>> This avoid bootstrapping malloc too early when libc+libpthread are not
>> ready. It is called through pthread__init() -> _pthread_atfork().
>>
>> This also helps LLVM Leak Sanitizer to pacify false positive reports.
> 
> Can we please stop adding more and more hacks for the still questionable
> "new" jemalloc and sit down for a sane init model first please? I'm
> still at the point to ask to just revert to the known-to-be-working
> version and therefore would also strongly prefer this change to be
> reverted.
> 
> Joerg
> 

This change was reverted as there was a fallout. Init model is sane
except for pthread_atfork()+malloc() called prematurely in pthread__init().



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/lib/libc/gen

2020-02-03 Thread Joerg Sonnenberger
On Sat, Feb 01, 2020 at 03:38:46PM +, Kamil Rytarowski wrote:
> Module Name:  src
> Committed By: kamil
> Date: Sat Feb  1 15:38:46 UTC 2020
> 
> Modified Files:
>   src/lib/libc/gen: pthread_atfork.c
> 
> Log Message:
> Switch atform allocations from malloc()+free() to mmap()+munmap()
> 
> This avoid bootstrapping malloc too early when libc+libpthread are not
> ready. It is called through pthread__init() -> _pthread_atfork().
> 
> This also helps LLVM Leak Sanitizer to pacify false positive reports.

Can we please stop adding more and more hacks for the still questionable
"new" jemalloc and sit down for a sane init model first please? I'm
still at the point to ask to just revert to the known-to-be-working
version and therefore would also strongly prefer this change to be
reverted.

Joerg


Re: CVS commit: src/external/mit/xorg/lib/gallium

2020-02-03 Thread Joerg Sonnenberger
On Fri, Jan 31, 2020 at 09:13:40PM +, Jared D. McNeill wrote:
> Module Name:  src
> Committed By: jmcneill
> Date: Fri Jan 31 21:13:40 UTC 2020
> 
> Modified Files:
>   src/external/mit/xorg/lib/gallium: Makefile
> 
> Log Message:
> Bump MESA_LLVM_VERSION_STRING

Directly use ${LLVM_VERSION}?

Joerg


Re: CVS commit: src/external/mit/xorg/lib

2020-02-03 Thread Joerg Sonnenberger
On Fri, Jan 31, 2020 at 08:58:18PM +, Jared D. McNeill wrote:
> Module Name:  src
> Committed By: jmcneill
> Date: Fri Jan 31 20:58:18 UTC 2020
> 
> Modified Files:
>   src/external/mit/xorg/lib: libmesa.mk
>   src/external/mit/xorg/lib/libglapi: Makefile
> 
> Log Message:
> Change HAVE_LLVM from 0x0700 to 0x0900.

Can we change this to something like:

NUMERIC_LLVM_VERSION!=  ${LLVM_VERSION:R:R} * 256
-DHAVE_LLVM=${NUMERIC_LLVM_VERSION}

(not bothering with the minor, since it will be 0 anyway).

Joerg


Re: CVS commit: src/lib/libpthread

2020-02-03 Thread Ryo ONODERA
Hi,

Kamil Rytarowski  writes:

> Please check this workaround:
>
> http://netbsd.org/~kamil/patch-00224-firefox-pthread_equal.txt
>
> It has to be applied on firefox's package.

Thank you very much.

This should be applied to pkgsrc/devel/nspr with slight change.
(devel/nspr's C files cannot accept // comment.)
This eliminates segfaults.

For the record, pthread_equal()'s first thread pointer, mon->owner, is
invalid in PR_GetMonitorEntryCount() in nspr/pr/src/pthreads/ptsynch.c
of devel/nspr.

>
> The problem has to be reported upstream as a real bug.

Please file the bug report to Mozilla's bugzilla.

Thank you very much.

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Re: CVS commit: src/lib/libpthread

2020-02-03 Thread Kamil Rytarowski
Please check this workaround:

http://netbsd.org/~kamil/patch-00224-firefox-pthread_equal.txt

It has to be applied on firefox's package.

The problem has to be reported upstream as a real bug.

On 03.02.2020 16:01, Ryo ONODERA wrote:
> Hi,
> 
> Ryo ONODERA  writes:
> 
>> Hi,
>>
>> I had tested with PTHREAD_DIAGASSERT however it did not produce any output.
>>
>> I am building current and pkgsrc packages from scratch now.
>>
>> I will reply my situation after this rebuild.
>>
>> Thank you.
> 
> With latest toolchain, kernel and userland,
> my firefox gets sefgault every run.
> 
> The core dump generated from PTHREAD_DIAGASSERT=ae does not show
> any useful things.
> See:
> Core was generated by `firefox'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x743cb39860ca in _lwp_kill () from /usr/lib/libc.so.12
> [Current thread is 1 (process 4)]
> (gdb) bt
> #0  0x743cb39860ca in _lwp_kill () from /usr/lib/libc.so.12
> #1  0x743ca1943721 in ?? () from /usr/pkg/lib/firefox/libxul.so
> #2  0x743ca2172bee in ?? () from /usr/pkg/lib/firefox/libxul.so
> #3  0x743cb38b0140 in opendir () from /usr/lib/libc.so.12
> #4  0x0001000b in ?? ()
> #5  0x in ?? ()
> 
> 
> And I cannot get any text output to stdout.
> As far as I understand correctly, PTHREAD_DIAGASSERT=e enables the output
> to stdout.
> 
> 
> Still I feel that pthread_equal() is cause of my segfault.
> $ gdb /usr/pkg/lib/firefox/firefox
> GNU gdb (GDB) 8.3
> Copyright (C) 2019 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64--netbsd".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> .
> Find the GDB manual and other documentation resources online at:
> .
> 
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from /usr/pkg/lib/firefox/firefox...
> (No debugging symbols found in /usr/pkg/lib/firefox/firefox)
> (gdb) r
> Starting program: /usr/pkg/lib/firefox/firefox
> [New process 18477]
> [Detaching after fork from child process 17695]
> [New LWP 2 of process 18477]
> [New LWP 3 of process 18477]
> [New LWP 4 of process 18477]
> [New LWP 5 of process 18477]
> [New LWP 6 of process 18477]
> [New LWP 7 of process 18477]
> [New LWP 8 of process 18477]
> [New LWP 9 of process 18477]
> [New LWP 10 of process 18477]
> [New LWP 11 of process 18477]
> [New LWP 12 of process 18477]
> [New LWP 13 of process 18477]
> [New LWP 14 of process 18477]
> [New LWP 15 of process 18477]
> [New LWP 16 of process 18477]
> JavaScript error: , line 0: UnknownError: The operation failed for reasons 
> unrelated to the database itself and not covered by any other error code.
> process 18477 is executing new program: /usr/pkg/lib/firefox/firefox
> [New process 18477]
> [Detaching after fork from child process 17526]
> [New LWP 2 of process 18477]
> [New LWP 3 of process 18477]
> [New LWP 4 of process 18477]
> [New LWP 5 of process 18477]
> [New LWP 6 of process 18477]
> [New LWP 7 of process 18477]
> [New LWP 8 of process 18477]
> [New LWP 9 of process 18477]
> [New LWP 10 of process 18477]
> [New LWP 11 of process 18477]
> [New LWP 12 of process 18477]
> [New LWP 13 of process 18477]
> [New LWP 14 of process 18477]
> [New LWP 15 of process 18477]
> [New LWP 16 of process 18477]
> [New LWP 17 of process 18477]
> [New LWP 18 of process 18477]
> [New LWP 19 of process 18477]
> [New LWP 20 of process 18477]
> [New LWP 21 of process 18477]
> [New LWP 22 of process 18477]
> [New LWP 23 of process 18477]
> [New LWP 24 of process 18477]
> [New LWP 25 of process 18477]
> [New LWP 26 of process 18477]
> [New LWP 27 of process 18477]
> [New LWP 28 of process 18477]
> [New LWP 29 of process 18477]
> [New LWP 14 of process 18477]
> [New LWP 30 of process 18477]
> [New LWP 31 of process 18477]
> [New LWP 32 of process 18477]
> [New LWP 33 of process 18477]
> [New LWP 34 of process 18477]
> [New LWP 35 of process 18477]
> [New LWP 36 of process 18477]
> [New LWP 37 of process 18477]
> [New LWP 38 of process 18477]
> [New LWP 39 of process 18477]
> [New process 18477]
> [Detaching after fork from child process 17454]
> [New LWP 39 of process 18477]
> [New LWP 41 of process 18477]
> [New LWP 42 of process 18477]
> [New LWP 43 of process 18477]
> [New LWP 44 of process 18477]
> [New LWP 45 of process 18477]
> [New process 18477]
> [Detaching after fork from child process 15097]
> [New LWP 47 of process 18477]
> [New LWP 48 of process 18477]
> [New LWP 49 of process 18477]
> [New LWP 50 of process 18477]
> [New LWP 51 of process 18477]
> [New LWP 45 of process 18477]

Re: CVS commit: src/lib/libpthread

2020-02-03 Thread Ryo ONODERA
Hi,

Ryo ONODERA  writes:

> Hi,
>
> I had tested with PTHREAD_DIAGASSERT however it did not produce any output.
>
> I am building current and pkgsrc packages from scratch now.
>
> I will reply my situation after this rebuild.
>
> Thank you.

With latest toolchain, kernel and userland,
my firefox gets sefgault every run.

The core dump generated from PTHREAD_DIAGASSERT=ae does not show
any useful things.
See:
Core was generated by `firefox'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x743cb39860ca in _lwp_kill () from /usr/lib/libc.so.12
[Current thread is 1 (process 4)]
(gdb) bt
#0  0x743cb39860ca in _lwp_kill () from /usr/lib/libc.so.12
#1  0x743ca1943721 in ?? () from /usr/pkg/lib/firefox/libxul.so
#2  0x743ca2172bee in ?? () from /usr/pkg/lib/firefox/libxul.so
#3  0x743cb38b0140 in opendir () from /usr/lib/libc.so.12
#4  0x0001000b in ?? ()
#5  0x in ?? ()


And I cannot get any text output to stdout.
As far as I understand correctly, PTHREAD_DIAGASSERT=e enables the output
to stdout.


Still I feel that pthread_equal() is cause of my segfault.
$ gdb /usr/pkg/lib/firefox/firefox
GNU gdb (GDB) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/pkg/lib/firefox/firefox...
(No debugging symbols found in /usr/pkg/lib/firefox/firefox)
(gdb) r
Starting program: /usr/pkg/lib/firefox/firefox
[New process 18477]
[Detaching after fork from child process 17695]
[New LWP 2 of process 18477]
[New LWP 3 of process 18477]
[New LWP 4 of process 18477]
[New LWP 5 of process 18477]
[New LWP 6 of process 18477]
[New LWP 7 of process 18477]
[New LWP 8 of process 18477]
[New LWP 9 of process 18477]
[New LWP 10 of process 18477]
[New LWP 11 of process 18477]
[New LWP 12 of process 18477]
[New LWP 13 of process 18477]
[New LWP 14 of process 18477]
[New LWP 15 of process 18477]
[New LWP 16 of process 18477]
JavaScript error: , line 0: UnknownError: The operation failed for reasons 
unrelated to the database itself and not covered by any other error code.
process 18477 is executing new program: /usr/pkg/lib/firefox/firefox
[New process 18477]
[Detaching after fork from child process 17526]
[New LWP 2 of process 18477]
[New LWP 3 of process 18477]
[New LWP 4 of process 18477]
[New LWP 5 of process 18477]
[New LWP 6 of process 18477]
[New LWP 7 of process 18477]
[New LWP 8 of process 18477]
[New LWP 9 of process 18477]
[New LWP 10 of process 18477]
[New LWP 11 of process 18477]
[New LWP 12 of process 18477]
[New LWP 13 of process 18477]
[New LWP 14 of process 18477]
[New LWP 15 of process 18477]
[New LWP 16 of process 18477]
[New LWP 17 of process 18477]
[New LWP 18 of process 18477]
[New LWP 19 of process 18477]
[New LWP 20 of process 18477]
[New LWP 21 of process 18477]
[New LWP 22 of process 18477]
[New LWP 23 of process 18477]
[New LWP 24 of process 18477]
[New LWP 25 of process 18477]
[New LWP 26 of process 18477]
[New LWP 27 of process 18477]
[New LWP 28 of process 18477]
[New LWP 29 of process 18477]
[New LWP 14 of process 18477]
[New LWP 30 of process 18477]
[New LWP 31 of process 18477]
[New LWP 32 of process 18477]
[New LWP 33 of process 18477]
[New LWP 34 of process 18477]
[New LWP 35 of process 18477]
[New LWP 36 of process 18477]
[New LWP 37 of process 18477]
[New LWP 38 of process 18477]
[New LWP 39 of process 18477]
[New process 18477]
[Detaching after fork from child process 17454]
[New LWP 39 of process 18477]
[New LWP 41 of process 18477]
[New LWP 42 of process 18477]
[New LWP 43 of process 18477]
[New LWP 44 of process 18477]
[New LWP 45 of process 18477]
[New process 18477]
[Detaching after fork from child process 15097]
[New LWP 47 of process 18477]
[New LWP 48 of process 18477]
[New LWP 49 of process 18477]
[New LWP 50 of process 18477]
[New LWP 51 of process 18477]
[New LWP 45 of process 18477]
[New LWP 52 of process 18477]
[New LWP 53 of process 18477]
[New LWP 54 of process 18477]
[New LWP 55 of process 18477]
[New LWP 56 of process 18477]
[New LWP 57 of process 18477]
[New LWP 58 of process 18477]
[New LWP 59 of process 18477]
[New LWP 60 of process 18477]

Thread 21 "Socket Thread" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 4 of process 18477]
0x71a59bc0c2eb in pthread_equal () from /usr/lib/libpthread.so.1
(gdb) bt
#0  0x71a59bc0c2eb in pthread_equal