Re: r346025: ZFS filesystems do not mount anymore

2019-04-09 Thread Enji Cooper (yaneurabeya)

> On Apr 9, 2019, at 21:51, Enji Cooper  wrote:

…

> CCing crees@, the author of r346017, for context. I will file a PR soon if 
> one hasn’t already been filed.

I filed https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237172 to 
track the issue.
Cheers!
-Enji

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: fix WARNING pid 24503 (uhsoctl): ioctl sign-extension ioctl ffffffff8044692b

2018-11-02 Thread Enji Cooper (yaneurabeya)
FYI!

> On Oct 25, 2018, at 4:38 AM, Marcin Cieslak  wrote:
> 
> The following patch seems to fix the signed ioctl value warnings
> in uhsoctl().
> 
> The code is the same in the current and stable branches.
> 
> Marcin
> 
> Index: usr.sbin/uhsoctl/uhsoctl.c
> ===
> --- usr.sbin/uhsoctl/uhsoctl.c(revision 339406)
> +++ usr.sbin/uhsoctl/uhsoctl.c(working copy)
> @@ -360,7 +360,7 @@
> 
> /* Add/remove IP address from an interface */
> static int
> -ifaddr_ad(int d, const char *ifnam, struct sockaddr *sa, struct sockaddr 
> *mask)
> +ifaddr_ad(unsigned long d, const char *ifnam, struct sockaddr *sa, struct 
> sockaddr *mask)
> {
>   struct ifaliasreq req;
>   int fd, error;


signature.asc
Description: Message signed with OpenPGP


Re: Relatively deterministic panic with sendfile(2) when running tests in the sxlock code

2018-10-15 Thread Enji Cooper (yaneurabeya)

> On Oct 15, 2018, at 6:10 AM, Gleb Smirnoff  wrote:
> 
>  Enji,
> 
> can you please check that with this patch all your tests pass?

Hi Gleb!
It almost compiled. I just needed to dereference the `so` pointer:

$ git diff /usr/src/sys/kern/kern_sendfile.c
diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c
index 438069aa721..50404ce5745 100644
--- a/sys/kern/kern_sendfile.c
+++ b/sys/kern/kern_sendfile.c
@@ -526,6 +526,8 @@ sendfile_getsock(struct thread *td, int s, struct file 
**sock_fp,
*so = (*sock_fp)->f_data;
if ((*so)->so_type != SOCK_STREAM)
return (EINVAL);
+   if (SOLISTENING(*so))
+   return (ENOTCONN);
return (0);
 }


After I applied that and rebuilt the kernel, it doesn’t panic anymore 
(and it fails with the correct errno).
Thank you so very much :)!
-Enji


signature.asc
Description: Message signed with OpenPGP


Re: Relatively deterministic panic with sendfile(2) when running tests in the sxlock code

2018-10-14 Thread Enji Cooper (yaneurabeya)

> On Oct 14, 2018, at 10:17 PM, Enji Cooper (yaneurabeya) 
>  wrote:

...

> Oh yipes. I guess passing in a server socket (a bound and listening socket) 
> instead of a client socket (connect’ed to a server socket) for `s` will 
> result in a crash?
> 
> From 
> https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c#L479
>  
> <https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c#L479>:
> ATF_TC_BODY(s_negative_not_connected_socket, tc)
> {
>   int client_sock, error, fd, port;
> 
>   port = XXX_TEST_PORT_BASE + __LINE__;
>   client_sock = setup_tcp_server(XXX_TEST_DOMAIN, port);
> 
>   fd = open(SOURCE_FILE, O_CREAT|O_RDWR);
>   ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
> 
>   error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
>   ATF_REQUIRE_ERRNO(ENOTCONN, error == -1);
> 
>   (void)close(fd);
>   (void)close(client_sock);
> }
> Let me see if I can track this down..

Can’t repro this on 11.2-RELEASE. Trying 11.2-STABLE.
Thanks!
-Enji



signature.asc
Description: Message signed with OpenPGP


Re: Relatively deterministic panic with sendfile(2) when running tests in the sxlock code

2018-10-14 Thread Enji Cooper (yaneurabeya)

> On Oct 14, 2018, at 10:12 PM, Enji Cooper (yaneurabeya) 
>  wrote:
> 
>> On Oct 14, 2018, at 9:45 PM, Enji Cooper (yaneurabeya) 
>> mailto:yaneurab...@gmail.com>> wrote:
>> 
>> 
>> 
>>> On Oct 14, 2018, at 7:25 PM, Gleb Smirnoff >> <mailto:gleb...@freebsd.org>> wrote:
>>> 
>>>  Hi Enji,
>>> 
>>> On Sun, Oct 14, 2018 at 06:51:42PM -0700, Enji Cooper (yaneurabeya) wrote:
>>> E> Hi,
>>> E>  I’m seeing a semi-deterministic panic on 12.0-ALPHA9 related to 
>>> sendfile(2) when running sendfile_test on the host: 
>>> https://pastebin.com/raw/6Y7xg0ki <https://pastebin.com/raw/6Y7xg0ki>; it 
>>> looks like it’s crashing in the sxlock code when calling sblock on a 
>>> sockbuf. Are there any commands in gdb you would like me to run to display 
>>> lock state?
>>> E>  Repro:
>>> E>
>>> E> mkdir /path/to/git/checkout
>>> E> cd /path/to/git/checkout
>>> E> git clone https://github.com/ngie-eign/freebsd/tree/sendfile_tests 
>>> <https://github.com/ngie-eign/freebsd/tree/sendfile_tests> .
>>> E> git checkout sendfile_tests
>>> E> (cd lib/libc/tests/sys/; make obj; make; sudo make install)
>>> E> kyua test -k /usr/tests/lib/libc/sys/Kyuafile sendfile_test
>>> 
>>> I'd like to reproduce it myself, but looks like URL is
>>> wrong:
>>> 
>>> glebius@erla:/usr/src:|>git clone 
>>> https://github.com/ngie-eign/freebsd/tree/sendfile_tests 
>>> <https://github.com/ngie-eign/freebsd/tree/sendfile_tests>
>>> Клонирование в «sendfile_tests»…
>>> fatal: repository 
>>> 'https://github.com/ngie-eign/freebsd/tree/sendfile_tests/ 
>>> <https://github.com/ngie-eign/freebsd/tree/sendfile_tests/>' not found
>> 
>> Mea culpa. It should be:
>> 
>> $ git clone https://github.com/ngie-eign/freebsd.git 
>> <https://github.com/ngie-eign/freebsd.git> .
>> 
>> Another note is that I’m running GENERIC-NODEBUG, not GENERIC-DEBUG.
>> 
>> I suspect that it’s crashing on :hdtr_negative_bad_pointers or : 
>> s_negative_not_descriptor, because the other items don’t seem terribly 
>> plausible.
>> 
>> The test case (source) can be found here: 
>> https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c
>>  
>> <https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c>
> Aha! It was actually :s_negative_not_connected_socket.
> 
> Updated repro: use `kyua test -k /usr/tests/lib/libc/sys/Kyuafile 
> sendfile_test:s_negative_not_connected_socket` instead of the other kyua call 
> I provided.

Oh yipes. I guess passing in a server socket (a bound and listening socket) 
instead of a client socket (connect’ed to a server socket) for `s` will result 
in a crash?

From 
https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c#L479
 
<https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c#L479>:
ATF_TC_BODY(s_negative_not_connected_socket, tc)
{
int client_sock, error, fd, port;

port = XXX_TEST_PORT_BASE + __LINE__;
client_sock = setup_tcp_server(XXX_TEST_DOMAIN, port);

fd = open(SOURCE_FILE, O_CREAT|O_RDWR);
ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));

error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
ATF_REQUIRE_ERRNO(ENOTCONN, error == -1);

(void)close(fd);
(void)close(client_sock);
}
Let me see if I can track this down..

Thanks!
-Enji


signature.asc
Description: Message signed with OpenPGP


Re: Relatively deterministic panic with sendfile(2) when running tests in the sxlock code

2018-10-14 Thread Enji Cooper (yaneurabeya)


> On Oct 14, 2018, at 9:45 PM, Enji Cooper (yaneurabeya) 
>  wrote:
> 
> 
> 
>> On Oct 14, 2018, at 7:25 PM, Gleb Smirnoff > <mailto:gleb...@freebsd.org>> wrote:
>> 
>>  Hi Enji,
>> 
>> On Sun, Oct 14, 2018 at 06:51:42PM -0700, Enji Cooper (yaneurabeya) wrote:
>> E> Hi,
>> E>   I’m seeing a semi-deterministic panic on 12.0-ALPHA9 related to 
>> sendfile(2) when running sendfile_test on the host: 
>> https://pastebin.com/raw/6Y7xg0ki <https://pastebin.com/raw/6Y7xg0ki>; it 
>> looks like it’s crashing in the sxlock code when calling sblock on a 
>> sockbuf. Are there any commands in gdb you would like me to run to display 
>> lock state?
>> E>   Repro:
>> E>
>> E> mkdir /path/to/git/checkout
>> E> cd /path/to/git/checkout
>> E> git clone https://github.com/ngie-eign/freebsd/tree/sendfile_tests 
>> <https://github.com/ngie-eign/freebsd/tree/sendfile_tests> .
>> E> git checkout sendfile_tests
>> E> (cd lib/libc/tests/sys/; make obj; make; sudo make install)
>> E> kyua test -k /usr/tests/lib/libc/sys/Kyuafile sendfile_test
>> 
>> I'd like to reproduce it myself, but looks like URL is
>> wrong:
>> 
>> glebius@erla:/usr/src:|>git clone 
>> https://github.com/ngie-eign/freebsd/tree/sendfile_tests 
>> <https://github.com/ngie-eign/freebsd/tree/sendfile_tests>
>> Клонирование в «sendfile_tests»…
>> fatal: repository 'https://github.com/ngie-eign/freebsd/tree/sendfile_tests/ 
>> <https://github.com/ngie-eign/freebsd/tree/sendfile_tests/>' not found
> 
> Mea culpa. It should be:
> 
> $ git clone https://github.com/ngie-eign/freebsd.git 
> <https://github.com/ngie-eign/freebsd.git> .
> 
> Another note is that I’m running GENERIC-NODEBUG, not GENERIC-DEBUG.
> 
> I suspect that it’s crashing on :hdtr_negative_bad_pointers or : 
> s_negative_not_descriptor, because the other items don’t seem terribly 
> plausible.
> 
> The test case (source) can be found here: 
> https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c
>  
> <https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c>
Aha! It was actually :s_negative_not_connected_socket.

Updated repro: use `kyua test -k /usr/tests/lib/libc/sys/Kyuafile 
sendfile_test:s_negative_not_connected_socket` instead of the other kyua call I 
provided.

Thanks!
-Enji


signature.asc
Description: Message signed with OpenPGP


Re: Relatively deterministic panic with sendfile(2) when running tests in the sxlock code

2018-10-14 Thread Enji Cooper (yaneurabeya)


> On Oct 14, 2018, at 7:25 PM, Gleb Smirnoff  wrote:
> 
>  Hi Enji,
> 
> On Sun, Oct 14, 2018 at 06:51:42PM -0700, Enji Cooper (yaneurabeya) wrote:
> E> Hi,
> E>I’m seeing a semi-deterministic panic on 12.0-ALPHA9 related to 
> sendfile(2) when running sendfile_test on the host: 
> https://pastebin.com/raw/6Y7xg0ki; it looks like it’s crashing in the sxlock 
> code when calling sblock on a sockbuf. Are there any commands in gdb you 
> would like me to run to display lock state?
> E>Repro:
> E>
> E> mkdir /path/to/git/checkout
> E> cd /path/to/git/checkout
> E> git clone https://github.com/ngie-eign/freebsd/tree/sendfile_tests .
> E> git checkout sendfile_tests
> E> (cd lib/libc/tests/sys/; make obj; make; sudo make install)
> E> kyua test -k /usr/tests/lib/libc/sys/Kyuafile sendfile_test
> 
> I'd like to reproduce it myself, but looks like URL is
> wrong:
> 
> glebius@erla:/usr/src:|>git clone 
> https://github.com/ngie-eign/freebsd/tree/sendfile_tests
> Клонирование в «sendfile_tests»…
> fatal: repository 'https://github.com/ngie-eign/freebsd/tree/sendfile_tests/' 
> not found

Mea culpa. It should be:

$ git clone https://github.com/ngie-eign/freebsd.git 
<https://github.com/ngie-eign/freebsd.git> .

Another note is that I’m running GENERIC-NODEBUG, not GENERIC-DEBUG.

I suspect that it’s crashing on :hdtr_negative_bad_pointers or : 
s_negative_not_descriptor, because the other items don’t seem terribly 
plausible.

The test case (source) can be found here: 
https://github.com/ngie-eign/freebsd/blob/95b96470a3a0270c36c4e7fb5eedc150fe124fac/lib/libc/tests/sys/sendfile_test.c

Thanks!
-Enji


signature.asc
Description: Message signed with OpenPGP


Relatively deterministic panic with sendfile(2) when running tests in the sxlock code

2018-10-14 Thread Enji Cooper (yaneurabeya)
Hi,
I’m seeing a semi-deterministic panic on 12.0-ALPHA9 related to 
sendfile(2) when running sendfile_test on the host: 
https://pastebin.com/raw/6Y7xg0ki; it looks like it’s crashing in the sxlock 
code when calling sblock on a sockbuf. Are there any commands in gdb you would 
like me to run to display lock state?
Repro:

mkdir /path/to/git/checkout
cd /path/to/git/checkout
git clone https://github.com/ngie-eign/freebsd/tree/sendfile_tests .
git checkout sendfile_tests
(cd lib/libc/tests/sys/; make obj; make; sudo make install)
kyua test -k /usr/tests/lib/libc/sys/Kyuafile sendfile_test

Thank you!
-Enji


signature.asc
Description: Message signed with OpenPGP