Re: CVS commit: src/tests/modules

2020-02-21 Thread Paul Goyette

OK, I over-reacted and didn't completely read the original commit
message.

The t_builtin.c stuff is indeed a test-of-module-functionality
so it does belong here.

But some of the other stuff here does not belong, such as the 
threadpool, fetchstore, and kcov stuff.  As far as I can see,

those all belong somewhere else, probably in the tests/sys/...
hierarchy.

Anyway, my apologies for over-reacting to this commit.  And
thanks to riastradh@ for pointing this out (on IRC).



On Fri, 21 Feb 2020, Paul Goyette wrote:


Really, the tests/modules directory should be only used for tests-that-
relate-to-module-functionality.  It should NOT be used for modules-
that-support-tests-of-other-functionality.

In the future, please do not put support modules here;  put them in the
samae place as the tests that they support.


On Sat, 22 Feb 2020, Kamil Rytarowski wrote:


Module Name:src
Committed By:   kamil
Date:   Sat Feb 22 00:18:55 UTC 2020

Modified Files:
src/tests/modules: t_builtin.c

Log Message:
Avoid undefined behavior in disabledstat

t_builtin.c:174:16, member access within misaligned address 0x741271c25004
for type 'struct modstat_t'

t_builtin.c:175:4, member access within misaligned address 0x741271c251c4
for type 'struct modstat_t'


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/modules/t_builtin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


!DSPAM:5e5073af66043393299806!




++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+



++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+


Re: CVS commit: src/tests/modules

2020-02-21 Thread Paul Goyette

Really, the tests/modules directory should be only used for tests-that-
relate-to-module-functionality.  It should NOT be used for modules-
that-support-tests-of-other-functionality.

In the future, please do not put support modules here;  put them in the
samae place as the tests that they support.


On Sat, 22 Feb 2020, Kamil Rytarowski wrote:


Module Name:src
Committed By:   kamil
Date:   Sat Feb 22 00:18:55 UTC 2020

Modified Files:
src/tests/modules: t_builtin.c

Log Message:
Avoid undefined behavior in disabledstat

t_builtin.c:174:16, member access within misaligned address 0x741271c25004
for type 'struct modstat_t'

t_builtin.c:175:4, member access within misaligned address 0x741271c251c4
for type 'struct modstat_t'


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/modules/t_builtin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


!DSPAM:5e5073af66043393299806!




++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+


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

2020-02-21 Thread Kamil Rytarowski
On 21.02.2020 23:53, matthew green wrote:
>> Disable ubsan instrumentation on the operation.
> 
> +#if defined(__clang__)
> +__attribute__((no_sanitize("undefined")))
> +#else
> +__attribute__((no_sanitize_undefined))
> +#endif
> 
> can we get a __disable_sanitizer or something i cdefs.h?
> 
> 
> .mrg.
> 

I will do it.



signature.asc
Description: OpenPGP digital signature


re: CVS commit: src/tests/lib/libc/gen

2020-02-21 Thread matthew green
> Disable ubsan instrumentation on the operation.

+#if defined(__clang__)
+__attribute__((no_sanitize("undefined")))
+#else
+__attribute__((no_sanitize_undefined))
+#endif

can we get a __disable_sanitizer or something i cdefs.h?


.mrg.


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-21 Thread Joerg Sonnenberger
On Fri, Feb 21, 2020 at 11:13:24AM +0100, Kamil Rytarowski wrote:
> On 21.02.2020 07:20, Martin Husemann wrote:
> > On Fri, Feb 21, 2020 at 03:01:45AM +0100, Kamil Rytarowski wrote:
> >> I consider calling ncurses-dev essential as a bug.
> > 
> > My knee jerk reaction was: if a unix compiler needs terminfo (especially
> > when it only does that to create coloured unreadable messages) it needs
> > to be moved to pkgsrc. Same goes for a command line debugger.
> > 
> > But if I understood Joerg's (extremely terse) objection:
> > there should be logic in the tools build dealing with missing terminfo
> > libs and this case needs more analyzis to understand why it fails.
> > 
> > Martin
> > 
> 
> This patch changes cryptic failure in linking to a verbose message:
> 
> http://netbsd.org/~kamil/patch-00231-llvm-terminfo-tools.txt
> 
> Does it look to commit?

No, absolutely not. This is just making the problem a 100 times worse.

Joerg


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-21 Thread Valery Ushakov
On Fri, Feb 21, 2020 at 11:13:24 +0100, Kamil Rytarowski wrote:

> This patch changes cryptic failure in linking to a verbose message:
> 
> http://netbsd.org/~kamil/patch-00231-llvm-terminfo-tools.txt
> 
> Does it look to commit?

The "devel library" is linux-specific terminology.
There's no need for ALL CAPS.

-uwe


Re: CVS commit: src

2020-02-21 Thread Kamil Rytarowski
On 22.12.2019 20:47, Andrew Doran wrote:
> Module Name:  src
> Committed By: ad
> Date: Sun Dec 22 19:47:35 UTC 2019
> 
> Modified Files:
>   src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_ctldir.c
>   src/sys/kern: vfs_mount.c vfs_subr.c vfs_syscalls.c
>   src/sys/miscfs/genfs: genfs_vfsops.c
>   src/sys/nfs: nfs_export.c
>   src/sys/sys: mount.h vnode.h vnode_impl.h
>   src/sys/ufs/lfs: ulfs_vfsops.c
>   src/sys/ufs/ufs: ufs_vfsops.c ufs_wapbl.c
> 
> Log Message:
> Make mntvnode_lock per-mount, and address false sharing of struct mount.
> 

This change broke kUBSan syzbot.

The sanitizer is now very noisy as struct mount requires 64 byte alignment.

http://netbsd.org/~kamil/kubsan/mount-alignment.txt

> diff -u src/sys/sys/mount.h:1.234 src/sys/sys/mount.h:1.235
> --- src/sys/sys/mount.h:1.234 Tue Jan  1 10:06:54 2019
> +++ src/sys/sys/mount.h   Sun Dec 22 19:47:34 2019
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: mount.h,v 1.234 2019/01/01 10:06:54 hannken Exp $  */
> +/*   $NetBSD: mount.h,v 1.235 2019/12/22 19:47:34 ad Exp $   */
>  
>  /*
>   * Copyright (c) 1989, 1991, 1993
> @@ -133,29 +133,38 @@ struct vattr;
>   * array of operations and an instance record.
>   */
>  struct mount {
> - TAILQ_HEAD(, vnode_impl) mnt_vnodelist; /* list of vnodes this mount */
> + /*
> +  * Mostly stable data.
> +  */
> + kmutex_t*mnt_vnodelock; /* lock on mnt_vnodelist */
>   struct vfsops   *mnt_op;/* operations on fs */
>   struct vnode*mnt_vnodecovered;  /* vnode we mounted on */
>   struct mount*mnt_lower; /* fs mounted on */
> - int mnt_synclist_slot;  /* synclist slot index */
>   void*mnt_transinfo; /* for FS-internal use */
>   void*mnt_data;  /* private data */
> - kmutex_tmnt_renamelock; /* per-fs rename lock */
> - int mnt_refcnt; /* ref count on this structure 
> */
> + kmutex_t*mnt_renamelock;/* per-fs rename lock */
>   int mnt_flag;   /* flags */
>   int mnt_iflag;  /* internal flags */
>   int mnt_fs_bshift;  /* offset shift for lblkno */
>   int mnt_dev_bshift; /* shift for device sectors */
> - struct statvfs  mnt_stat;   /* cache of filesystem stats */
>   specificdata_reference
>   mnt_specdataref;/* subsystem specific data */
> - kmutex_tmnt_updating;   /* to serialize updates */
> + kmutex_t*mnt_updating;  /* to serialize updates */
>   const struct wapbl_ops
>   *mnt_wapbl_op;  /* logging ops */
>   struct wapbl*mnt_wapbl; /* log info */
>   struct wapbl_replay
>   *mnt_wapbl_replay;  /* replay support XXX: what? */
>   uint64_tmnt_gen;
> +
> + /*
> +  * Volatile data: pad to keep away from the stable items.
> +  */
> + int mnt_refcnt  /* ref count on this structure 
> */
> + __aligned(COHERENCY_UNIT);
> + int mnt_synclist_slot;  /* synclist slot index */
> + TAILQ_HEAD(, vnode_impl) mnt_vnodelist; /* list of vnodes this mount */
> + struct statvfs  mnt_stat;   /* cache of filesystem stats */
>  };
>  
>  #endif /* defined(_KERNEL) || defined(__EXPOSE_MOUNT) */
> 






signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/sys/kern

2020-02-21 Thread Kamil Rytarowski
On 20.02.2020 22:14, Jaromir Dolecek wrote:
> Module Name:  src
> Committed By: jdolecek
> Date: Thu Feb 20 21:14:23 UTC 2020
> 
> Modified Files:
>   src/sys/kern: subr_autoconf.c
> 
> Log Message:
> protect deferred lists' manipulation by config_misc_lock, same as
> config_pending semaphore itself; right now this also covers
> DVF_ATTACH_INPROGRESS flag
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.265 -r1.266 src/sys/kern/subr_autoconf.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

After this commit kASan breaks on boot:

[   1.2418653] panic: ASan: Unauthorized Access In 0x811e0c46:
Addr 0xa7000f382a58 [8 bytes, read, PoolUseAfterFree]

[   1.2511909] cpu1: Begin traceback...
[   1.2612093] vpanic() at netbsd:vpanic+0x241 sys/kern/subr_prf.c:336
[   1.2812516] snprintf() at netbsd:snprintf
[   1.3012883] kasan_report() at netbsd:kasan_report+0x98
kasan_code_name sys/kern/subr_asan.c:186 [inline]
[   1.3012883] kasan_report() at netbsd:kasan_report+0x98
sys/kern/subr_asan.c:196
[   1.3213274] __asan_load8() at netbsd:__asan_load8+0x294
kasan_shadow_4byte_isvalid sys/kern/subr_asan.c:346 [inline]
[   1.3213274] __asan_load8() at netbsd:__asan_load8+0x294
kasan_shadow_8byte_isvalid sys/kern/subr_asan.c:360 [inline]
[   1.3213274] __asan_load8() at netbsd:__asan_load8+0x294
kasan_shadow_check sys/kern/subr_asan.c:412 [inline]
[   1.3213274] __asan_load8() at netbsd:__asan_load8+0x294
sys/kern/subr_asan.c:1182
[   1.3413734] config_interrupts_thread() at
netbsd:config_interrupts_thread+0x68 sys/kern/subr_autoconf.c:459
[   1.3513931] cpu1: End traceback...
[   1.3513931] fatal breakpoint trap in supervisor mode
[   1.3614094] trap type 1 code 0 rip 0x8021e4b5 cs 0x8 rflags
0x246 cr2 0 ilevel 0 rsp 0xa7017de07d60
[   1.3714294] curlwp 0xa700116a16c0 pid 0.30 lowest kstack
0xa7017de002c0
Stopped in pid 0.30 (system) at netbsd:breakpoint+0x5:  leave
db{1}>

https://syzkaller.appspot.com/bug?extid=1f0aefb06a387371fa14



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-21 Thread Kamil Rytarowski
On 21.02.2020 07:20, Martin Husemann wrote:
> On Fri, Feb 21, 2020 at 03:01:45AM +0100, Kamil Rytarowski wrote:
>> I consider calling ncurses-dev essential as a bug.
> 
> My knee jerk reaction was: if a unix compiler needs terminfo (especially
> when it only does that to create coloured unreadable messages) it needs
> to be moved to pkgsrc. Same goes for a command line debugger.
> 
> But if I understood Joerg's (extremely terse) objection:
> there should be logic in the tools build dealing with missing terminfo
> libs and this case needs more analyzis to understand why it fails.
> 
> Martin
> 

This patch changes cryptic failure in linking to a verbose message:

http://netbsd.org/~kamil/patch-00231-llvm-terminfo-tools.txt

Does it look to commit?

A real fix (assuming we want terminfo in tools) is to build terminfo
together with tools. I defer this to someone else.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-21 Thread Kamil Rytarowski
On 21.02.2020 09:17, Leonardo Taccari wrote:
> Kamil Rytarowski writes:
>> [...]
>> ./build.sh tools for LLVM is broken when host ships with no terminfo
>> devel libraries. I tried to disable this superfluous feature for tools
>> (for colors in a terminal), but it got reverted (breaking TNF rules) here.
>> [...]
> 
> Apart possible technical arguments, AFAICS the revert probably haven't
> broken the rules: you have asked for feedback on #NetBSD@Freenode IRC
> channel and then  replied with a no but you have committed them
> anyway.
> 

This message was not reached/noted on my end (as it was not prefixed
with my login over there) and later (next day) it was out of IRC log
scroll buffer.

I don't object formally.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-21 Thread Leonardo Taccari
Kamil Rytarowski writes:
> [...]
> ./build.sh tools for LLVM is broken when host ships with no terminfo
> devel libraries. I tried to disable this superfluous feature for tools
> (for colors in a terminal), but it got reverted (breaking TNF rules) here.
> [...]

Apart possible technical arguments, AFAICS the revert probably haven't
broken the rules: you have asked for feedback on #NetBSD@Freenode IRC
channel and then  replied with a no but you have committed them
anyway.