Discussion:
Error build nvidia-driver with r334555
(too old to reply)
Alex V. Petrov
2018-06-03 11:48:01 UTC
Permalink
cc -O2 -pipe -fno-strict-aliasing -DNV_VERSION_STRING=\"390.59\"
-D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O2
-fno-strict-aliasing -mno-red-zone -mcmodel=kernel -Wno-sign-co
mpare -Wno-format-extra-args -UDEBUG -U_DEBUG -DNDEBUG -Werror=undef
-Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I../common/inc -I.
-I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-
common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
-MF.depend.nvlink_freebsd.o -MTnvlink_freebsd.o -mcmodel=kernel
-mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchr
onous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointe
r-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
-fdiagnostics-show-option -Wno-unknown-pragmas
-Wno-error-tautological-compare -Wno-error-empty-body
-Wno-error-parentheses-equ
ality -Wno-error-unused-function -Wno-error-pointer-sign
-Wno-error-shift-negative-value -Wno-address-of-packed-member -mno-aes
-mno-avx -std=iso9899:1999 -c nvlink_freebsd.c -o nvlink_fre
ebsd.o


--- nvidia_subr.o ---


nvidia_subr.c:367:26: error: 'memset' call operates on objects of type
'struct nv_ioctl_card_info' while the size is based on a different type
'struct nv_ioctl_card_info *' [-Werror,-Wsizeof
-pointer-memaccess]
memset(ci, 0, sizeof(ci));
~~ ^~
nvidia_subr.c:367:26: note: did you mean to dereference the argument to
'sizeof' (and multiply it by the number of elements)?

memset(ci, 0, sizeof(ci));
^~
1 error generated.
*** [nvidia_subr.o] Error code 1

make[4]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59/src/nvidia
1 error

make[4]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59/src/nvidia
*** [all_subdir_src/nvidia] Error code 2

make[3]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59/src
1 error

make[3]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59/src
*** [all_subdir_src] Error code 2

make[2]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59
1 error

make[2]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1
--
-----
Alex.
David Wolfskill
2018-06-03 12:08:34 UTC
Permalink
Post by Alex V. Petrov
....
--- nvidia_subr.o ---
nvidia_subr.c:367:26: error: 'memset' call operates on objects of type
'struct nv_ioctl_card_info' while the size is based on a different type
'struct nv_ioctl_card_info *' [-Werror,-Wsizeof
-pointer-memaccess]
memset(ci, 0, sizeof(ci));
~~ ^~
nvidia_subr.c:367:26: note: did you mean to dereference the argument to
'sizeof' (and multiply it by the number of elements)?
memset(ci, 0, sizeof(ci));
^~
1 error generated.
*** [nvidia_subr.o] Error code 1
....
Aye; please ref.
<https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228709> for
additional details.

The issue has been narrowed down to the range r334529 - r334535; I'm
suspecting r334533 and/or r334534. (Not that the commits are in any way
"faulty" -- merely that the nvidia-driver port may need some "evasive
action" to allow for the change).

Peace,
david
--
David H. Wolfskill ***@catwhisker.org
Mr. Trump, you reap what you sow: This is YOUR trade war.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.
Konstantin Belousov
2018-06-03 12:21:42 UTC
Permalink
Post by David Wolfskill
Post by Alex V. Petrov
....
--- nvidia_subr.o ---
nvidia_subr.c:367:26: error: 'memset' call operates on objects of type
'struct nv_ioctl_card_info' while the size is based on a different type
'struct nv_ioctl_card_info *' [-Werror,-Wsizeof
-pointer-memaccess]
memset(ci, 0, sizeof(ci));
~~ ^~
nvidia_subr.c:367:26: note: did you mean to dereference the argument to
'sizeof' (and multiply it by the number of elements)?
memset(ci, 0, sizeof(ci));
^~
1 error generated.
*** [nvidia_subr.o] Error code 1
....
Aye; please ref.
<https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228709> for
additional details.
The issue has been narrowed down to the range r334529 - r334535; I'm
suspecting r334533 and/or r334534. (Not that the commits are in any way
"faulty" -- merely that the nvidia-driver port may need some "evasive
action" to allow for the change).
Even not looking at the actual code, I am quite sure that the line
nvidia_subr.c:367 should be changed to
memset(ci, 0, sizeof(*ci));
This is a bug in the driver sources.
Waitman Gobble
2018-06-03 12:34:13 UTC
Permalink

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Post by Konstantin Belousov
Post by David Wolfskill
Post by Alex V. Petrov
....
--- nvidia_subr.o ---
nvidia_subr.c:367:26: error: 'memset' call operates on objects of type
'struct nv_ioctl_card_info' while the size is based on a different type
'struct nv_ioctl_card_info *' [-Werror,-Wsizeof
-pointer-memaccess]
memset(ci, 0, sizeof(ci));
~~ ^~
nvidia_subr.c:367:26: note: did you mean to dereference the argument to
'sizeof' (and multiply it by the number of elements)?
memset(ci, 0, sizeof(ci));
^~
1 error generated.
*** [nvidia_subr.o] Error code 1
....
Aye; please ref.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228709 for
additional details.
The issue has been narrowed down to the range r334529 - r334535; I'm
suspecting r334533 and/or r334534. (Not that the commits are in any way
"faulty" -- merely that the nvidia-driver port may need some "evasive
action" to allow for the change).
Even not looking at the actual code, I am quite sure that the line
nvidia_subr.c:367 should be changed to
memset(ci, 0, sizeof(*ci));
This is a bug in the driver sources.
https://lists.freebsd.org/mailman/listinfo/freebsd-current
That solved the build problem for me.
I haven't noticed any other issues with nvidia driver.


Waitman Gobble

Sent with ProtonMail Secure Email.​
Tomoaki AOKI
2018-06-03 12:42:22 UTC
Permalink
This is caused by r334533 and/or r334534 (memset-related changes).
sysutils/lsof is also affected.

You should revert r334533 and r334534 temporarily until nvidia-driver
support this change.

CC'ing the revision author and maintainers of both ports.


On Sun, 3 Jun 2018 18:48:01 +0700
Post by Alex V. Petrov
cc -O2 -pipe -fno-strict-aliasing -DNV_VERSION_STRING=\"390.59\"
-D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O2
-fno-strict-aliasing -mno-red-zone -mcmodel=kernel -Wno-sign-co
mpare -Wno-format-extra-args -UDEBUG -U_DEBUG -DNDEBUG -Werror=undef
-Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I../common/inc -I.
-I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-
common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD
-MF.depend.nvlink_freebsd.o -MTnvlink_freebsd.o -mcmodel=kernel
-mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchr
onous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointe
r-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs
-fdiagnostics-show-option -Wno-unknown-pragmas
-Wno-error-tautological-compare -Wno-error-empty-body
-Wno-error-parentheses-equ
ality -Wno-error-unused-function -Wno-error-pointer-sign
-Wno-error-shift-negative-value -Wno-address-of-packed-member -mno-aes
-mno-avx -std=iso9899:1999 -c nvlink_freebsd.c -o nvlink_fre
ebsd.o
--- nvidia_subr.o ---
nvidia_subr.c:367:26: error: 'memset' call operates on objects of type
'struct nv_ioctl_card_info' while the size is based on a different type
'struct nv_ioctl_card_info *' [-Werror,-Wsizeof
-pointer-memaccess]
memset(ci, 0, sizeof(ci));
~~ ^~
nvidia_subr.c:367:26: note: did you mean to dereference the argument to
'sizeof' (and multiply it by the number of elements)?
memset(ci, 0, sizeof(ci));
^~
1 error generated.
*** [nvidia_subr.o] Error code 1
make[4]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59/src/nvidia
1 error
make[4]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59/src/nvidia
*** [all_subdir_src/nvidia] Error code 2
make[3]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59/src
1 error
make[3]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59/src
*** [all_subdir_src] Error code 2
make[2]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59
1 error
make[2]: stopped in
/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.59
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1
--
-----
Alex.
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-current
--
Tomoaki AOKI <***@dec.sakura.ne.jp>
Mateusz Guzik
2018-06-03 13:20:24 UTC
Permalink
Post by Tomoaki AOKI
This is caused by r334533 and/or r334534 (memset-related changes).
sysutils/lsof is also affected.
You should revert r334533 and r334534 temporarily until nvidia-driver
support this change.
CC'ing the revision author and maintainers of both ports.
Support in what sense? The error message clearly indicates a bug in the
driver
(also trivially fixable). Is there a problem adding a patch to files/?

diff -ru src.orig/nvidia/nvidia_subr.c src/nvidia/nvidia_subr.c
--- src.orig/nvidia/nvidia_subr.c 2018-06-03 13:19:56.490480000 +0000
+++ src/nvidia/nvidia_subr.c 2018-06-03 13:21:15.289344000 +0000
@@ -364,7 +364,7 @@
}

ci = args;
- memset(ci, 0, sizeof(ci));
+ memset(ci, 0, sizeof(*ci));

for (i = 0; i < NV_MAX_DEVICES; i++) {
sc = devclass_get_softc(nvidia_devclass, i);


As for lsof:
--- dlsof.h.orig 2018-06-03 13:16:14.712701000 +0000
+++ dlsof.h 2018-06-03 13:17:15.042655000 +0000
@@ -489,6 +489,12 @@
# endif /* FREEBSDV>=2020 */

#undef bzero /* avoid _KERNEL conflict */
+#undef bcmp
+#undef bcopy
+#undef memcmp
+#undef memmove
+#undef memcpy
+#undef memset
#include <string.h>
--
Mateusz Guzik <mjguzik gmail.com>
Larry Rosenman
2018-06-03 13:30:54 UTC
Permalink
sysutils/lsof fixed in r471495.



Thanks, Mateusz!
--
Larry Rosenman http://www.lerctr.org/~ler

Phone: +1 214-642-9640 E-Mail: ***@lerctr.org

US Mail: 5708 Sabbia Drive, Round Rock, TX 78665-2106



From: Mateusz Guzik <***@gmail.com>
Date: Sunday, June 3, 2018 at 8:20 AM
To: <***@dec.sakura.ne.jp>
Cc: "freebsd-***@freebsd.org" <freebsd-***@freebsd.org>, <***@gmail.com>, Mateusz Guzik <***@freebsd.org>, Alexey Dokuchaev <***@freebsd.org>, <***@freebsd.org>
Subject: Re: Error build nvidia-driver with r334555



On Sun, Jun 3, 2018 at 2:42 PM, Tomoaki AOKI <***@dec.sakura.ne.jp> wrote:

This is caused by r334533 and/or r334534 (memset-related changes).
sysutils/lsof is also affected.

You should revert r334533 and r334534 temporarily until nvidia-driver
support this change.

CC'ing the revision author and maintainers of both ports.





Support in what sense? The error message clearly indicates a bug in the driver

(also trivially fixable). Is there a problem adding a patch to files/?

diff -ru src.orig/nvidia/nvidia_subr.c src/nvidia/nvidia_subr.c
--- src.orig/nvidia/nvidia_subr.c 2018-06-03 13:19:56.490480000 +0000
+++ src/nvidia/nvidia_subr.c 2018-06-03 13:21:15.289344000 +0000
@@ -364,7 +364,7 @@
}

ci = args;
- memset(ci, 0, sizeof(ci));
+ memset(ci, 0, sizeof(*ci));

for (i = 0; i < NV_MAX_DEVICES; i++) {
sc = devclass_get_softc(nvidia_devclass, i);

As for lsof:
--- dlsof.h.orig 2018-06-03 13:16:14.712701000 +0000
+++ dlsof.h 2018-06-03 13:17:15.042655000 +0000
@@ -489,6 +489,12 @@
# endif /* FREEBSDV>=2020 */

#undef bzero /* avoid _KERNEL conflict */
+#undef bcmp
+#undef bcopy
+#undef memcmp
+#undef memmove
+#undef memcpy
+#undef memset
#include <string.h>
--
Mateusz Guzik <mjguzik gmail.com>
Tomoaki AOKI
2018-06-04 12:25:06 UTC
Permalink
On Sun, 3 Jun 2018 15:20:24 +0200
Post by Mateusz Guzik
Post by Tomoaki AOKI
This is caused by r334533 and/or r334534 (memset-related changes).
sysutils/lsof is also affected.
You should revert r334533 and r334534 temporarily until nvidia-driver
support this change.
CC'ing the revision author and maintainers of both ports.
Support in what sense? The error message clearly indicates a bug in the
driver
I meant "need some work to be built with r334533 (and r334534),
including fix for newly-became-prominent bug(s), because both
x11/nvidia-driver and sysutils/lsof were built OK before r334533.

Now understood that 3rd param SHALL be the size of destination "value",
NOT the size of destination "pointer".
Post by Mateusz Guzik
(also trivially fixable). Is there a problem adding a patch to files/?
Built and worked fine. Thanks!

Fix for sysutils/lsof is already committed by Larry as r471495.
Thanks, Larry!

As x11/nvidia-driver is the master port for legacy drivers,
and legacy drivers (nvidia-driver-304 and nvidia-driver-340 ATM) has
different src directory layout, it needs some cludge in Makefile.
See attached (edited) Makefile. (Not a diff.)

And at the same time, your patch needs some fix (filename part only,
though).
Attached extra-patch-* must be copied into files/ dir.

*extra-patch-src_nvidia__subr.c is the fixed one for legacy driver.
extra-patch-src_nvidia_nvidia__subr.c contains your original patch.

Note that legacy drivers are only build-tested.

Sorry for delay!
Regards.
Post by Mateusz Guzik
diff -ru src.orig/nvidia/nvidia_subr.c src/nvidia/nvidia_subr.c
--- src.orig/nvidia/nvidia_subr.c 2018-06-03 13:19:56.490480000 +0000
+++ src/nvidia/nvidia_subr.c 2018-06-03 13:21:15.289344000 +0000
@@ -364,7 +364,7 @@
}
ci = args;
- memset(ci, 0, sizeof(ci));
+ memset(ci, 0, sizeof(*ci));
for (i = 0; i < NV_MAX_DEVICES; i++) {
sc = devclass_get_softc(nvidia_devclass, i);
--- dlsof.h.orig 2018-06-03 13:16:14.712701000 +0000
+++ dlsof.h 2018-06-03 13:17:15.042655000 +0000
@@ -489,6 +489,12 @@
# endif /* FREEBSDV>=2020 */
#undef bzero /* avoid _KERNEL conflict */
+#undef bcmp
+#undef bcopy
+#undef memcmp
+#undef memmove
+#undef memcpy
+#undef memset
#include <string.h>
--
Mateusz Guzik <mjguzik gmail.com>
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-current
--
Tomoaki AOKI <***@dec.sakura.ne.jp>
Alexey Dokuchaev
2018-06-04 17:46:36 UTC
Permalink
Post by Tomoaki AOKI
This is caused by r334533 and/or r334534 (memset-related changes).
sysutils/lsof is also affected.
You should revert r334533 and r334534 temporarily until nvidia-driver
support this change.
nVidia driver port was fixed as of r471574.

./danfe
Alex V. Petrov
2018-06-04 17:50:50 UTC
Permalink
Спасибо Алексей!
Thank you!
Post by Alexey Dokuchaev
Post by Tomoaki AOKI
This is caused by r334533 and/or r334534 (memset-related changes).
sysutils/lsof is also affected.
You should revert r334533 and r334534 temporarily until nvidia-driver
support this change.
nVidia driver port was fixed as of r471574.
./danfe
--
-----
Alex.
Continue reading on narkive:
Loading...