[Bug 267606] x11-drivers/xf86-video-nv: Segmentation Fault post update from 1.20.14,1 to 21.1.4

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 28 Dec 2022 23:31:11 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267606

--- Comment #11 from Sergiy <Black_N@ukr.net> ---
(In reply to Gary Jennejohn from comment #10)

Thanks for the tips.

I decided to try the first way. But first I created a special virtual machine
for training on another x64 PC.
There were various try...

I downloaded the ports tree from git and tried 
with quarterly: 
Black_N # git clone https://git.FreeBSD.org/ports.git -b 2022Q4 /usr/ports 
and with HEAD: 
Black_N # git clone https://git.FreeBSD.org/ports.git /usr/ports 
But I only got compilation errors

At first I added CFLAGS+=-g to the Makefile each time.
Then created /etc/make.conf with:
WITH_DEBUG=     yes
DEBUG_FLAGS=    -g -O0

After six unsuccessful attempts to compile xorg-server with debug symbols, a
miracle finally happened for the seventh time.
(After install:
# pkg install ninja meson re2c )

And quarterly branch of the ports tree:
root@debug_sys:/home/Black_N # git clone https://git.FreeBSD.org/ports.git -b
2022Q4 /usr/ports
root@debug_sys:/home/Black_N # cd /usr/ports/x11-servers/xorg-server
root@debug_sys:/usr/ports/x11-servers/xorg-server # ls -lap
total 96
drwxr-xr-x  3 root  wheel   512 28 груд. 15:07 ./
drwxr-xr-x  9 root  wheel   512 28 груд. 15:07 ../
-rw-r--r--  1 root  wheel   168 28 груд. 15:07 distinfo
drwxr-xr-x  2 root  wheel  1024 28 груд. 15:07 files/
-rw-r--r--  1 root  wheel  4034 28 груд. 15:07 Makefile
-rw-r--r--  1 root  wheel   172 28 груд. 15:07 pkg-descr-xephyr
-rw-r--r--  1 root  wheel    78 28 груд. 15:07 pkg-descr-xnest
-rw-r--r--  1 root  wheel   101 28 груд. 15:07 pkg-descr-xorg
-rw-r--r--  1 root  wheel    90 28 груд. 15:07 pkg-descr-xvfb
-rw-r--r--  1 root  wheel  1054 28 груд. 15:07 pkg-message
-rw-r--r--  1 root  wheel  4719 28 груд. 15:07 pkg-plist
root@debug_sys:/usr/ports/x11-servers/xorg-server # cat distinfo
TIMESTAMP = 1659367891
SHA256 (xorg-server-21.1.4.tar.xz) =
5cc4be8ee47edb58d4a90e603a59d56b40291ad38371b0bd2471fc3cbee1c587
SIZE (xorg-server-21.1.4.tar.xz) = 4940176

root@debug_sys:/usr/ports/x11-servers/xorg-server # make
WRKDIRPREFIX=/home/Black_N/test_xorg

And as a result:
$ file
/home/Black_N/test_xorg/usr/ports/x11-servers/xorg-server/work-xorg/stage/usr/local/libexec/Xorg
/home/Black_N/test_xorg/usr/ports/x11-servers/xorg-server/work-xorg/stage/usr/local/libexec/Xorg:
ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked,
interpreter /libexec/ld-elf.so.1, for FreeBSD 13.1, FreeBSD-style, with
debug_info, not stripped

Then I transferred it to the Tosha using tar.

Maybe I did something wrong...
I disabled hardening again. I configured using the file in
/usr/local/etc/X11/xorg.conf.d nv driver, instead of vesa, rebooted...
I got a PC without X.
I removed all Xorg.core.
Tried running:
root@T0SHA:/home/Black_N # exec
/home/Black_N/test_xorg/usr/ports/x11-servers/xorg-server/work-xorg/stage/usr/local/libexec/Xorg

A new Xorg.core file is created.

I executed/got:
Script started on Wed Dec 28 23:12:05 2022
root@T0SHA:/home/Black_N # gdb -c /home/Black_N/Xorg.core
GNU gdb (GDB) 12.1 [GDB v12.1 for FreeBSD]
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-portbld-freebsd13.1".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
[New LWP 100141]
[New LWP 100142]
Core was generated by
`/usr/home/Black_N/test_xorg/usr/ports/x11-servers/xorg-server/work-xorg/stage/us'.
Program terminated with signal SIGABRT, Aborted.
Sent by thr_kill() from pid 1034 and user 0.
#0  0x000000080087733a in ?? ()
[Current thread is 1 (LWP 100141)]
(gdb) bt
#0  0x000000080087733a in ?? ()
#1  0x00000008007efc74 in ?? ()
#2  0x000000000001872d in ?? ()
#3  0x149c2d2ac447088c in ?? ()
#4  0x00007fffffffdab4 in ?? ()
#5  0x00007fffffffe070 in ?? ()
#6  0x00007fffffffdad0 in ?? ()
#7  0x00000008008a1109 in ?? ()
#8  0x149c2d2ac447088c in ?? ()
#9  0x0000000000000000 in ?? ()
(gdb) exit

Before this, I also tried to run the resulting Xorg from under lldb and gdb,
but when running this way, everything freezes as expected and Xorg.core is not
created.
When running like this, the message in gdb disappeared (No debugging symbols
found in ...)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.