Bug 235077 - [regression] x11/nvidia-driver-304: segfault in libnvidia-tls in 12.0-RELEASE but works in 11.2
Summary: [regression] x11/nvidia-driver-304: segfault in libnvidia-tls in 12.0-RELEASE...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Some People
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-20 12:37 UTC by Lena
Modified: 2019-07-11 03:11 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (danfe)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lena 2019-01-20 12:37:18 UTC
After upgrade from 11.2 to 12.0 i386 (with freebsd-update and `pkg upgrade -f`),
launch of firefox (from packages for 12) caused segmentation fault:

Core was generated by `firefox'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x22aeb63f in _nv024tls () from /usr/local/lib/libnvidia-tls.so.1
(gdb) bt
#0  0x22aeb63f in _nv024tls () at /usr/local/lib/libnvidia-tls.so.1
#1  0xffbfc9ac in  ()
#2  0x21038d1e in  () at /libexec/ld-elf.so.1
#3  0x2103553b in  () at /libexec/ld-elf.so.1
#4  0x21035394 in dlopen () at /libexec/ld-elf.so.1
#5  0x01027d1f in mozilla::GetBootstrap(char const*) ()
#6  0x01006ed8 in InitXPCOMGlue() ()
#7  0x01006b2e in main ()
(gdb)

~ # pkg info -o firefox
firefox-64.0_3,1               www/firefox
~ # pkg which /usr/local/lib/libnvidia-tls.so.1
/usr/local/lib/libnvidia-tls.so.1 was installed by package nvidia-driver-304-304.137_2

I recompiled nvidia-driver-304 from port and rebooted - same error.
Launch of www/palemoon also caused segfault.

Motherboard ASUS M2NPV-MX with integrated video GeForce 6150.

I had to restore 11.2 from backup.

Same error reported by another user:
https://devtalk.nvidia.com/default/topic/1045764/sigsegv-on-freebsd-12-0-with-304-137-on-geforce-6200/
Comment 1 VVD 2019-03-13 16:27:58 UTC
Same here with Firefox.

Hardware: P4 3GHz HT, ASUS P4P800SE, GeForce 6600 "NV43 [GeForce 6600]", FreeBSD 12.0 i386, nvidia-driver-304-304.137_2:
$ grep OPTIONS_FILE_ /var/db/ports/x11_nvidia-driver-304/options
OPTIONS_FILE_SET+=ACPI_PM
OPTIONS_FILE_UNSET+=DOCS
OPTIONS_FILE_UNSET+=FREEBSD_AGP
OPTIONS_FILE_SET+=LINUX
OPTIONS_FILE_UNSET+=PAE
OPTIONS_FILE_SET+=WBINVD

$ ls -l /usr/local/lib/libnvidia-tls.so.1
-r--r--r-- 1 root wheel 3588 Dec 14 20:59 /usr/local/lib/libnvidia-tls.so.1
$ md5 /usr/local/lib/libnvidia-tls.so.1
MD5 (/usr/local/lib/libnvidia-tls.so.1) = a875d7e0faae6ef59e3434a1ffad8969

This file is same on 11.2 i386.


P.S. I had to return to the FreeBSD 11.2 i386.
Comment 3 VVD 2019-03-14 10:16:04 UTC
(In reply to Alex S from comment #2)
> https://lists.freebsd.org/pipermail/svn-src-all/2017-November/153892.html ?
And after this report they keep jemalloc without changes?…
Comment 4 Alex S 2019-03-14 10:44:59 UTC
(In reply to VVD from comment #3)

> And after this report they keep jemalloc without changes?

I don't see any relevant commits or bug reports.
Comment 5 VVD 2019-03-14 10:50:45 UTC
(In reply to Alex S from comment #4)
> I don't see any relevant commits or bug reports.
What do you mean "relevant"?
Comment 6 Alex S 2019-03-14 11:11:38 UTC
(In reply to VVD from comment #5)

> What do you mean "relevant"?
I mean something at https://github.com/freebsd/freebsd/commits/master/libexec/rtld-elf that looks like a fix for this particular crash.
Comment 7 VVD 2019-03-14 11:35:14 UTC
(In reply to Alex S from comment #6)

I see fix in your first link:
> JEMALLOC_ALIGNED(16);
> Lowering to 8 byte alignment fixes the crash.
Did anybody else test this? On i386?

Or may be I misunderstood something…
Comment 8 Werner Lehmann 2019-03-20 19:06:01 UTC
I have the same problem after a fresh install of i386 FreeBSD 12.0 on an Aspire 5610 (Nvidia Geforce Go 7300) with nvidia-driver-304 and Firefox and Seamonkey. Opera works though and no other problems with any other software so far. Kodi works, which is most important to me. Everything installed from packages just a few days ago.
Comment 9 Konstantin Belousov freebsd_committer 2019-03-26 12:44:39 UTC
Try https://reviews.freebsd.org/D19072
Comment 10 VVD 2019-04-21 16:49:45 UTC
(In reply to Konstantin Belousov from comment #9)
> Try https://reviews.freebsd.org/D19072
Thanks!
Can you, please, explain how to test this patch on releng/12.0 i386?
Comment 11 Lena 2019-04-21 17:23:50 UTC
I applied the patch to releng/12.0, built world. I think that the patch affects
only /lib/libc.so.7 . I uploaded the resulting patched binary libc.so.7 to

https://drive.google.com/file/d/1_To5J1DrZLiT8zrTqWeQT44lvq0TL89-/view

I still hasn't tested it. If you can test it, it'd be appreciated.
Comment 12 VVD 2019-04-21 18:05:41 UTC
(In reply to Lena from comment #11)
Tested on VM - Firefox work fine!

Thanks!
Comment 13 Werner Lehmann 2019-04-24 12:36:11 UTC
So when will that fix be in the ports?
Comment 14 Lena 2019-04-24 12:57:07 UTC
> So when will that fix be in the ports?

The tested fix is to change base (world), not ports.
Comment 15 VVD 2019-04-24 13:54:05 UTC
(In reply to Lena from comment #14)
Ye, correct questions are "when will that fix be in the head?" and "when will be MFC to stable/12 and to releng/12.0?".
Comment 16 Werner Lehmann 2019-04-24 15:16:32 UTC
Sorry that I as an end user and non-developer I did not realize that. So hopefully this time correctly asked from my end user perspective, when will a "freebsd-update fetch install" solve the problem?
Comment 17 VVD 2019-04-24 15:20:19 UTC
(In reply to Werner Lehmann from comment #16)
Exactly!
Comment 18 VVD 2019-05-11 21:10:39 UTC
Just build gegl-0.4.14 for update gimp and got segfault during compile.
Found that is issue:
$ gegl test.png -o test2.png
Segmentation fault (стек памяти сброшен на диск)
$ gdb /usr/local/bin/gegl gegl.core
GNU gdb (GDB) 8.2.1 [GDB v8.2.1 for FreeBSD]
Copyright (C) 2018 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 "i386-portbld-freebsd12.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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"...
Reading symbols from /usr/local/bin/gegl...(no debugging symbols found)...done.
[New LWP 100657]
[New LWP 100571]
[New LWP 100576]
[New LWP 100581]
Core was generated by `gegl test.png -o test2.png'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x2eb8e63f in _nv024tls () from /usr/local/lib/libnvidia-tls.so.1
[Current thread is 1 (LWP 100657)]
(gdb) bt
#0  0x2eb8e63f in _nv024tls () at /usr/local/lib/libnvidia-tls.so.1
#1  0xffbfd9b4 in  ()
#2  0x2805ad1e in  () at /libexec/ld-elf.so.1
#3  0x2805753b in  () at /libexec/ld-elf.so.1
#4  0x28057394 in dlopen () at /libexec/ld-elf.so.1
#5  0x28142374 in g_module_open () at /usr/local/lib/libgmodule-2.0.so.0
#6  0x280f5356 in  () at /usr/local/lib/libgegl-0.4.so.0
#7  0x280f520a in gegl_module_new () at /usr/local/lib/libgegl-0.4.so.0
#8  0x280f6741 in  () at /usr/local/lib/libgegl-0.4.so.0
#9  0x280f4e2d in gegl_datafiles_read_directories () at /usr/local/lib/libgegl-0.4.so.0
#10 0x280f64de in gegl_module_db_load () at /usr/local/lib/libgegl-0.4.so.0
#11 0x280a9835 in  () at /usr/local/lib/libgegl-0.4.so.0
#12 0x2850f441 in g_slist_foreach () at /usr/local/lib/libglib-2.0.so.0
#13 0x280a92bb in  () at /usr/local/lib/libgegl-0.4.so.0
#14 0x284fdc8b in g_option_context_parse () at /usr/local/lib/libglib-2.0.so.0
#15 0x280a8b31 in gegl_init () at /usr/local/lib/libgegl-0.4.so.0
#16 0x0804ac18 in main ()

But firefox work fine with patched libc.so.7!
Comment 19 Lena 2019-05-12 13:00:55 UTC
> Just build gegl-0.4.14 for update gimp and got segfault during compile.

If you install gegl and gimp from packages with `pkg install`, does gimp work?
Opening an image, saving as .png?
Saving as .jpg with preview while choosing compression/quality?
Adjusting brightness/contrast with preview?
Comment 20 VVD 2019-05-20 18:24:15 UTC
(In reply to Lena from comment #19)
It's headless VM, and it's don't work now after update from 12.0-p3 to 12.0-p4 - kernel panic:
start_init: trying /sbin/init
panic: vm_fault_hold: fault on nofault entry, addr: 0
cpuid = 1
time = 1558376095
KDB: stack backtrace:
#0 0x110854f at kdb_backtrace+0x4f
#1 0x10bb517 at vpanic+0x147
#2 0x10bb3cb at panic+0x1b
#3 0x1404a25 at vm_fault_hold+0x2a45
#4 0x1401f8e at vm_fault+0x5e
#5 0x1691f97 at trap_pfault+0xc7
#6 0x169154f at trap+0x3cf
#7 0xffc0315d at PTDpde+0x4165
Uptime: 1s

Boot fine with kernel 12.0-p3 and this panic with kernel 12.0-p4.
(I think it's different issue, but anyway support of i386 becomes worse and worse every day…)
Comment 21 VVD 2019-05-20 20:33:34 UTC
(In reply to VVD from comment #20)
Found: /usr/src/UPDATING
20190515        p5      FreeBSD-EN-19:07.mds [revised]

        Fixed error in patch causing panic on i386 architecture. [SA-19:07.mds]

Will test soon.
Comment 22 VVD 2019-05-21 00:45:08 UTC
12.0-p5 boot fine on i386.
Comment 23 VVD 2019-05-21 12:33:12 UTC
(In reply to Lena from comment #19)
Tested with self-builded gimp and gegl: error during export to jpg with x11/nvidia-driver-304 installed (and with your libc.so.7). Without x11/nvidia-driver-304 export work fine.

"pkg install gegl gimp" installing gegl-0.4.12_3 and gimp-2.10.8,2, but in ports gegl-0.4.14_1 and gimp-2.10.10,2.
Comment 24 VVD 2019-07-11 03:11:38 UTC
gegl was updated to 0.4.16 and it work fine now - no core dumps with nvidia-driver-304 installed.