re: CVS commit: src/external/gpl3/gdb/dist/gdb
"Martin Husemann" writes: > Module Name: src > Committed By: martin > Date: Sat Oct 29 17:02:07 UTC 2016 > > Modified Files: > src/external/gpl3/gdb/dist/gdb: alphanbsd-tdep.c > > Log Message: > Add a skip_solib_resolver, from Rin Okuyama, fixes single stepping for > shared binaries. can we put this function into a netbsd-common file that all ports can reference, rather than repeating it? ie, this is identical to the arm version, and probably others. i noticed that the openbsd version of this is one version. thanks. .mrg.
Re: CVS commit: src/tests/net/net
On Mon, Nov 7, 2016 at 1:43 PM, Ryota Ozaki wrote: > Module Name:src > Committed By: ozaki-r > Date: Mon Nov 7 04:43:14 UTC 2016 > > Modified Files: > src/tests/net/net: t_ping6_opts.sh > > Log Message: > Add tests of ping6 hops optional argument (Type 0 Routing Headers) > > Note that ping6 with the argument can send packets with routing headers > but the kernel doesn't support receiving the packets so that ping6 fails. > Nevertheless, we can test whether sent packets are correct or not. BTW, should we remove the functionality of sending packets with Type 0 Routing Headers in favor of RFC 5095? ozaki-r
Re: CVS commit: src/sys
> On Fri, Nov 04, 2016 at 04:44:10PM +0100, J. Hannken-Illjes wrote: >> - This change results in "panic: ffs_blkfree_common: freeing free block" >> if I put a file system under stress (*1). >> >> - I suppose not zeroing the blocks to be freed before freeing them >> makes the life of fsck harder. >> >> - Running "brelse(bp, BC_INVAL)" doesn't look OK. The brelse(bp, BC_INVAL) call was there before as well, but the condition changed and is wrong. I can repeat the problem with your script and the packaged fsx (thanks Thomas). Whipped up a patch to what looked wrong there, and it no longer panics for me. Patch is attached. I'll test further and commit it tomorrow. Jaromir Index: ffs_inode.c === RCS file: /cvsroot/src/sys/ufs/ffs/ffs_inode.c,v retrieving revision 1.118 diff -u -p -r1.118 ffs_inode.c --- ffs_inode.c 28 Oct 2016 20:38:12 - 1.118 +++ ffs_inode.c 6 Nov 2016 23:09:15 - @@ -675,18 +675,18 @@ ffs_indirtrunc(struct inode *ip, daddr_t * Recursively free blocks on the now last partial indirect block. */ if (level > SINGLE && lastbn >= 0) { - nb = RBAP(ip, last); + last = lastbn % factor; + nb = RBAP(ip, i); if (nb != 0) { error = ffs_indirtrunc(ip, nlbn, FFS_FSBTODB(fs, nb), - lastbn % factor, level - 1, - countp); + last, level - 1, countp); if (error) goto out; } } out: - if (RBAP(ip, 0) == 0) { + if (lastbn < 0 && error == 0) { /* all freed, release without writing back */ brelse(bp, BC_INVAL); } else {
Re: CVS commit: src/tests/kernel
On 06.11.2016 18:26, Nicolas Joly wrote: > On Sun, Nov 06, 2016 at 11:56:31PM +0700, Robert Elz wrote: >> Date:Sun, 6 Nov 2016 16:24:16 + >> From:"Kamil Rytarowski" >> Message-ID: <20161106162416.95d77f...@cvs.netbsd.org> >> >> | assert_pid1 asserts that non-root user cannot attach to PID 1 as it is >> the >> | /dev/init process. This tests is skipped if run as root. >> >> There's no need to skip it, just >> >> child=fork(); /* err if -1 */ >> if (child == 0) { >> (void)setuid(10); >> if (ptrace(.) < 0) >> _exit(errno); >> else >> _exit(0); >> } >> waitpid(child, &status, 0); >> /* and check status */ >> >> If you're root, the setuid() works, and the child isn't root any more. >> if you happened to be uid(10), the setuid() is a no-op, if you were some >> other user the setuid() fails, but you don't care. > > Or use dedicated ATF properties : > > atf_tc_set_md_var(tc, "require.user", "unprivileged"); > > Documented in atf-test-case(4). > It worked, thanks! signature.asc Description: OpenPGP digital signature
Re: CVS commit: src/tests/kernel
On Sun, Nov 06, 2016 at 11:56:31PM +0700, Robert Elz wrote: > Date:Sun, 6 Nov 2016 16:24:16 + > From:"Kamil Rytarowski" > Message-ID: <20161106162416.95d77f...@cvs.netbsd.org> > > | assert_pid1 asserts that non-root user cannot attach to PID 1 as it is the > | /dev/init process. This tests is skipped if run as root. > > There's no need to skip it, just > > child=fork(); /* err if -1 */ > if (child == 0) { > (void)setuid(10); > if (ptrace(.) < 0) > _exit(errno); > else > _exit(0); > } > waitpid(child, &status, 0); > /* and check status */ > > If you're root, the setuid() works, and the child isn't root any more. > if you happened to be uid(10), the setuid() is a no-op, if you were some > other user the setuid() fails, but you don't care. Or use dedicated ATF properties : atf_tc_set_md_var(tc, "require.user", "unprivileged"); Documented in atf-test-case(4). -- Nicolas Joly Cluster & Computing Group Biology IT Center Institut Pasteur, Paris.
Re: CVS commit: src/tests/kernel
On 06.11.2016 17:56, Robert Elz wrote: > Date:Sun, 6 Nov 2016 16:24:16 + > From:"Kamil Rytarowski" > Message-ID: <20161106162416.95d77f...@cvs.netbsd.org> > > | assert_pid1 asserts that non-root user cannot attach to PID 1 as it is the > | /dev/init process. This tests is skipped if run as root. > > There's no need to skip it, just > > child=fork(); /* err if -1 */ > if (child == 0) { > (void)setuid(10); > if (ptrace(.) < 0) > _exit(errno); > else > _exit(0); > } > waitpid(child, &status, 0); > /* and check status */ > > If you're root, the setuid() works, and the child isn't root any more. > if you happened to be uid(10), the setuid() is a no-op, if you were some > other user the setuid() fails, but you don't care. > > kre > Good point. I noted a sequence in other tests like: struct passwd *pw; pw = getpwnam("nobody"); if (pid == 0) { (void)setuid(pw->pw_uid); } I will make use of something similar. I was evaluating whether it's possible to PT_ATTACH to getpid() [I will check documentation later]. It doesn't make sense but we shouldn't hang. I will test it and add an entry for it in the t_ptrace code. Another idea is to test chroot(8) attach failure. I'm inventing potential tests without the usage of wait(2)-like functions, and without help of hacks like sleep(3) - such test would be waste of precious time of execution of the ATF framework and the behavior would not be practical. My intention is to move all other tests to ptrace_wait* files. Thank you for your suggestions! signature.asc Description: OpenPGP digital signature
Re: CVS commit: src
On 06.11.2016 17:38, Robert Elz wrote: > Date:Sun, 6 Nov 2016 15:03:31 + > From:"Kamil Rytarowski" > Message-ID: <20161106150331.25fb2f...@cvs.netbsd.org> > > | The t_wait_noproc_wnohang adds to options (except wait(2), wait3(2)) > > Why exclude wait3() ? (Not that it really matters, wait3() and wait4() > are the same thing modulo the pid paramater, which isn't being used here) > This was my mistake, I will correct it. > Could you also add tests (for wait4() and later, not wait() or wait3()) > where the process has a child, but the pid parameter (which is why not > wait() or wait3() as there isn't one) is not the pid of the child ? > > Also test (for wait3() and later) the WNOHANG case where the child > exists, but has not exited yet ... > > When you do that you also need to do a wait to clean up the child when > it exits ... you get to also test wait returning a value, as the child > should just sleep, then once the first waits (not expected to fetch > the process are finished) kill() the child to avoid waiting for the > sleep() to finish (delaying the test needlessly and perhaps getting > caught up in the qemu timing issues) and what's more you get to check > that the exit reason and signal number are correct (note that for waitid() > you need to supply, and use, a siginfo_t to get the values, and should > for wait6() as well - and verify both it, and wait6's status arg). > > The basic model should be ... > > child = fork(); /* test for -1 ... */ > if (child == 0) { > sleep(10); /* plenty long enough */ > _exit(0); > } > pid = waitpid(child+10, ...); /* expect error */ > pid = waitpid(child, WNOHANG); /* expect 0 */ > kill(child, SIGTERM); > pid = waitpid(child, &status, ...); /* expect child */ > /* expect WIFSIGNALLED(status), and WTERMSIG(status)==SIGTERM) > > you can deal with this in one generic function to do the work, > and N helper functions that do the waits using their different arg > sequences - where all the helper funcs have the same arg lists (even > down to a siginfo_t inall of them) so you can then just call the > generic routine N times, with each of the N different wait funcs > as an arg, like > > int generic_func( int waitfunc(int, int, int *, siginfo_t *), >int flags, int *status, siginfo_t *si) { > { > /* then as above, except instead of calling waitpid() > you would do > pid = (*waitfunc)(child+10, flags, status, si); /* + checks */ > pid = (*waitfunc)(child, flags|WNOHANG, status, si); /* +...*/ > pid = (*waitfunc)(child, flags, status, si); /* check > pid==child */ > return pid; /* then return as rest of checking > depends on which wait func was used */ > > } > > or something along those lines, and call that as > > then implement > waitpid_func(int child, int flags, int *status, siginfo_t *si) > { > return waitpid(child, status, flags); /* si is unused here */ > } > (and so on for the others), and then call > > pid = generic_func(waitpid, WNOHANG, &status, &si); > /* validate results in status - si ignored of course */ > pid = generic_func(waitid, WNOHANG, &status, &si); > /* validate results (from si), expect 0 from final pid, >ignore unused status */ > /*etc etc*/ > > (details need to be fleshed out!) > > > I am not yet certain that the current behaviour of wait6() and waitid() > is actually wrong, so the expected result, and expect_fail for those ones > might be premature. > > kre > Thank you for good suggestions. I will add them once t_ptrace_wait* family of tests will land the sources. I have also other tests in mind in the t_wait* family and I will add them too. I need to go out for few hours and unless there will be issues in the code I plan to finish everything mentioned above tonight. signature.asc Description: OpenPGP digital signature
Re: CVS commit: src/tests/kernel
Date:Sun, 6 Nov 2016 16:24:16 + From:"Kamil Rytarowski" Message-ID: <20161106162416.95d77f...@cvs.netbsd.org> | assert_pid1 asserts that non-root user cannot attach to PID 1 as it is the | /dev/init process. This tests is skipped if run as root. There's no need to skip it, just child=fork(); /* err if -1 */ if (child == 0) { (void)setuid(10); if (ptrace(.) < 0) _exit(errno); else _exit(0); } waitpid(child, &status, 0); /* and check status */ If you're root, the setuid() works, and the child isn't root any more. if you happened to be uid(10), the setuid() is a no-op, if you were some other user the setuid() fails, but you don't care. kre
Re: CVS commit: src
Date:Sun, 6 Nov 2016 15:03:31 + From:"Kamil Rytarowski" Message-ID: <20161106150331.25fb2f...@cvs.netbsd.org> | The t_wait_noproc_wnohang adds to options (except wait(2), wait3(2)) Why exclude wait3() ? (Not that it really matters, wait3() and wait4() are the same thing modulo the pid paramater, which isn't being used here) Could you also add tests (for wait4() and later, not wait() or wait3()) where the process has a child, but the pid parameter (which is why not wait() or wait3() as there isn't one) is not the pid of the child ? Also test (for wait3() and later) the WNOHANG case where the child exists, but has not exited yet ... When you do that you also need to do a wait to clean up the child when it exits ... you get to also test wait returning a value, as the child should just sleep, then once the first waits (not expected to fetch the process are finished) kill() the child to avoid waiting for the sleep() to finish (delaying the test needlessly and perhaps getting caught up in the qemu timing issues) and what's more you get to check that the exit reason and signal number are correct (note that for waitid() you need to supply, and use, a siginfo_t to get the values, and should for wait6() as well - and verify both it, and wait6's status arg). The basic model should be ... child = fork(); /* test for -1 ... */ if (child == 0) { sleep(10); /* plenty long enough */ _exit(0); } pid = waitpid(child+10, ...); /* expect error */ pid = waitpid(child, WNOHANG); /* expect 0 */ kill(child, SIGTERM); pid = waitpid(child, &status, ...); /* expect child */ /* expect WIFSIGNALLED(status), and WTERMSIG(status)==SIGTERM) you can deal with this in one generic function to do the work, and N helper functions that do the waits using their different arg sequences - where all the helper funcs have the same arg lists (even down to a siginfo_t inall of them) so you can then just call the generic routine N times, with each of the N different wait funcs as an arg, like int generic_func( int waitfunc(int, int, int *, siginfo_t *), int flags, int *status, siginfo_t *si) { { /* then as above, except instead of calling waitpid() you would do pid = (*waitfunc)(child+10, flags, status, si); /* + checks */ pid = (*waitfunc)(child, flags|WNOHANG, status, si); /* +...*/ pid = (*waitfunc)(child, flags, status, si); /* check pid==child */ return pid; /* then return as rest of checking depends on which wait func was used */ } or something along those lines, and call that as then implement waitpid_func(int child, int flags, int *status, siginfo_t *si) { return waitpid(child, status, flags); /* si is unused here */ } (and so on for the others), and then call pid = generic_func(waitpid, WNOHANG, &status, &si); /* validate results in status - si ignored of course */ pid = generic_func(waitid, WNOHANG, &status, &si); /* validate results (from si), expect 0 from final pid, ignore unused status */ /*etc etc*/ (details need to be fleshed out!) I am not yet certain that the current behaviour of wait6() and waitid() is actually wrong, so the expected result, and expect_fail for those ones might be premature. kre
Re: CVS commit: src/sys
On Fri, Nov 04, 2016 at 04:44:10PM +0100, J. Hannken-Illjes wrote: > > > On 28 Oct 2016, at 22:38, Jaromir Dolecek wrote: > > > > Module Name:src > > Committed By: jdolecek > > Date: Fri Oct 28 20:38:12 UTC 2016 > > > > Modified Files: > > src/sys/kern: vfs_wapbl.c > > src/sys/sys: wapbl.h > > src/sys/ufs/ffs: ffs_alloc.c ffs_inode.c ffs_snapshot.c > > src/sys/ufs/ufs: ufs_extern.h ufs_inode.c ufs_rename.c ufs_vnops.c > > ufs_wapbl.h > > > > Log Message: > > reorganize ffs_truncate()/ffs_indirtrunc() to be able to partially > > succeed; change wapbl_register_deallocation() to return EAGAIN > > rather than panic when code hits the limit > > > > callers changed to either loop calling ffs_truncate() using new > > utility ufs_truncate_retry() if their semantics requires it, or > > just ignore the failure; remove ufs_wapbl_truncate() > > > > this fixes possible user-triggerable panic during truncate, and > > resolves WAPBL performance issue with truncates of large files > > > > PR kern/47146 and kern/49175 > > - This change results in "panic: ffs_blkfree_common: freeing free block" > if I put a file system under stress (*1). > > - I suppose not zeroing the blocks to be freed before freeing them > makes the life of fsck harder. > > - Running "brelse(bp, BC_INVAL)" doesn't look OK. > > Please fix or revert soon. For easier testing, I've imported fsx as pkgsrc/filesystems/fsx. Cheers, Thomas
Re: CVS commit: src/tests/kernel
On Nov 6, 1:48pm, n...@gmx.com (Kamil Rytarowski) wrote: -- Subject: Re: CVS commit: src/tests/kernel | My plan is to split t_ptrace into t_ptrace_wait, t_ptrace_waitpid etc. I | will try to avoid duplication of the code and prepare something like the | t_mutex and t_timedmutex pair. | | To keep the t_ptrace file there, I will add a new test not using any of | the wait(2) functions. Ok, sounds good. christos
Re: CVS commit: src/tests/kernel
On 03.11.2016 18:08, Kamil Rytarowski wrote: > > For now I'm focusing on functional tests, which are equivalent to > FreeBSD capabilities. This is why I will reschedule combination of > wait(2) usage functions for later and move to on other ptrace(2) use-cases. > With recent reported issues I'm convinced to cover the whole wait(2)-family of interfaces in t_ptrace. There is a need to sort out all possible issues. My plan is to split t_ptrace into t_ptrace_wait, t_ptrace_waitpid etc. I will try to avoid duplication of the code and prepare something like the t_mutex and t_timedmutex pair. To keep the t_ptrace file there, I will add a new test not using any of the wait(2) functions. signature.asc Description: OpenPGP digital signature