Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dev-libs/nss update leads to illegal instruction in Firefox
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
molletts
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2013
Posts: 133

PostPosted: Mon Jun 05, 2023 8:18 pm    Post subject: dev-libs/nss update leads to illegal instruction in Firefox Reply with quote

Hi,

Just wondering if anyone else has seen this yet. I'm still looking into it myself so this is just a quick initial scribble. Also, I thought it might be worth getting it out here in case someone else is struggling to diagnose the same crash.

Updated from dev-libs/nss-3.89.1 to nss-3.90 as part of today's ~amd64 updates. www-client/firefox-113.0.2 exits immediately after creating its main window with an "illegal instruction" message. After re-merging nss-3.89.1, Firefox works fine again. I suspect at least some other nss consumers will be affected too, depending on exactly what function(s) contain the offending opcodes.

Haven't yet tried re-merging Firefox after updating nss in case of some ABI-related weirdness (I'll leave that going tonight to look into tomorrow evening; it takes an hour and a half or so to build).

Using CFLAGS="-O2 -march=native -pipe" on AMD FX-9590 (equivalent to -march=piledriver -mno-lwp). USE etc for nss as follows:
Code:
[ebuild     U  ] dev-libs/nss-3.90::gentoo [3.89.1::gentoo] USE="utils -cacert -test" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="sse3%* -avx2%" 0 KiB

Full cpuid2cpuflags output for the CPU for reference:
Code:
CPU_FLAGS_X86: aes avx f16c fma3 fma4 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop


Regards,
Stephen
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3961

PostPosted: Tue Jun 06, 2023 12:14 am    Post subject: Reply with quote

Ok i just tried updating nss to
Code:

[ebuild     U  ] dev-libs/nss-3.90::gentoo [3.89.1::gentoo] USE="utils -cacert -test" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="avx2%* sse3%*" 0 KiB


with
Code:

CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3
and
COMMON_FLAGS="-march=native -O2 -pipe"

on an i7 and firefox-bin opens ok.
_________________
:)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23355

PostPosted: Tue Jun 06, 2023 12:48 am    Post subject: Reply with quote

"Illegal instruction" errors are often system dependent, since a system with the latest CPU can understand and process instructions that older systems did not. Therefore, if the problem is that a current generation instruction has been introduced in a file which should be usable on older generation CPUs, only people testing on older CPUs will see it. Diagnosing this might be easier if we knew the specific opcodes that are failing, and in what functions they are found.
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2273

PostPosted: Tue Jun 06, 2023 2:09 am    Post subject: Reply with quote

Yes, please build NSS with debugging symbols (and ideally installsources) per https://wiki.gentoo.org/wiki/Debugging#Per-package. Then install gdb and run Firefox under it (or some other crashing application). When it dies, please run 'bt' and 'dis'.

See also https://stackoverflow.com/questions/1902901/show-current-assembly-instruction-in-gdb.

EDIT: This has now been reported as bug 907932.
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4739
Location: Germany

PostPosted: Tue Jun 06, 2023 6:29 am    Post subject: Reply with quote

alamahant wrote:
firefox-bin opens ok
Yes, firefox-bin using probably a bundled nss version (it is visible in about:support ).
Back to top
View user's profile Send private message
molletts
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2013
Posts: 133

PostPosted: Tue Jun 06, 2023 6:28 pm    Post subject: Reply with quote

Just tested the patch referenced in bug 907932 on unmasked nss-3.90 and it fixes the issue for me.

It looks like a bit of a blunt instrument (just disable the bit of code instead of using the instruction set extension conditionally based on a configure-time test or flag) but it's an effective quick fix which presumably doesn't regress anything and buys some time to finesse the fix in a point release.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum