WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Illegal Instruction crash multiple software old hardware  (Read 1245 times)

Offline nitram

  • Hero Member
  • *****
  • Posts: 1052
Illegal Instruction crash multiple software old hardware
« on: October 12, 2016, 01:05:02 AM »
On older SSE only (non-SSE2) hardware both Midori and QupZilla crash with Illegal Instruction error. More information linked, apparently if affects other software too, including VLC, mplayer and Xombrero: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783293

In dCore-jessie problems experienced with Midori, QupZilla and Firefox. Firefox is robust, no outright crash but without the workaround was unable to properly view important bank site information (information did not display, greyed out). For privacy reasons, didn't go through the trouble of an altered screenshot.

Fortunately a work-around was provided, which actually works :-)
Code: [Select]
export JavaScriptCoreUseJIT=0

Example crash JIT set to default (1) fron non SSE2 system:
Code: [Select]
tc@box:~$ echo $JavaScriptCoreUseJIT
1
tc@box:~$ qupzilla news.google.ca
QupZilla: 0 extensions loaded
Illegal instruction

JIT set to 0 everything okay:
Code: [Select]
tc@box:~$ export JavaScriptCoreUseJIT=0
tc@box:~$ echo $JavaScriptCoreUseJIT
0
tc@box:~$ qupzilla news.google.ca
QupZilla: 0 extensions loaded
tc@box:~$

A modified OnDemand script or manually adding the workaround from a terminal only works when the application is launched from OnDemand or that terminal, not global. Adding something like this to ~/.ashrc works:
Code: [Select]
# Illegal instruction workaround for older processor, affects multiple applications:
if cat /proc/cpuinfo | grep sse2 >/dev/null; then
:
else
export JavaScriptCoreUseJIT=0
fi

Not sure if you would consider this Jason or if each individual application needs a special start up script. I'm sure there may be a way, but with poor hacking ability i was unable to set up startup script that globally set JIT=0 so it works if the application is re-launched later in a session.

I have not spent as much time in TC6 and TC7 recently, but did play with several browsers, no outright crashes, didn't properly test banking site via Firefox. Edit: To clarify, TC7 Epiphany does not load web pages with SSE only processor, Oops something went wrong just like dCore-jessie. Works fine in SSE2 system though. Also a few browsers in TC7 are outdated (eg. Icecat, Opera) so maybe not infected with this issue.
« Last Edit: October 12, 2016, 01:13:11 AM by nitram »

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9307
Re: Illegal Instruction crash multiple software old hardware
« Reply #1 on: October 12, 2016, 08:04:10 AM »
This is definitely something that would be good for the wiki or README files.  As few users are now on a Pentium 3 or less, I will ponder putting code in the default dCore .ashrc.  I don't think there is a way to export this variable globally with the startup scripts, and I don't want to resort to using wrapper scripts for the apps though that is a way to export variables and such when launching them.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9591
Re: Illegal Instruction crash multiple software old hardware
« Reply #2 on: October 12, 2016, 09:50:45 AM »
As that var affects most Webkit browsers, why not export it in your .profile?
The only barriers that can stop you are the ones you create yourself.

Offline nitram

  • Hero Member
  • *****
  • Posts: 1052
Re: Illegal Instruction crash multiple software old hardware
« Reply #3 on: October 12, 2016, 10:56:41 AM »
Hi curaga. Not sure if you were addressing Jason/dCore or myself. I've placed it in .ashrc and it works well, as it seems that's where the environment comes from based on .profile entry:
Code: [Select]
if [ -f "$HOME/.ashrc" ]; then
   export ENV="$HOME/.ashrc"
   . "$HOME/.ashrc"
fi

...but this is foreign to me, don't recall how it worked placing direct into .profile, will try again with later reboot.

Offline nitram

  • Hero Member
  • *****
  • Posts: 1052
Re: Illegal Instruction crash multiple software old hardware
« Reply #4 on: October 12, 2016, 11:41:12 AM »
Simply pasting this into .profile doesn't work, in .ashrc it does:
Code: [Select]
export JavaScriptCoreUseJIT=0

Offline marinux

  • WikiUser
  • *
  • Posts: 5
Re: Illegal Instruction crash multiple software old hardware
« Reply #5 on: June 03, 2017, 03:23:29 PM »
Many, many thanks to Nitram.
As I use PIII and Athlon, I was desesperated to find a kiss solution (since some years !) for non SSE2 procs. Recompilation of webkit, use of netsurf (nice but too much sid for using every day) and QTweb (very good but abandonned), your workaround is excellent and I will integrate it as wrapper in futures releases of Xinutop.
Thanks again
Frank

Offline JustinCB

  • WikiUser
  • *
  • Posts: 17
Re: Illegal Instruction crash multiple software old hardware
« Reply #6 on: June 06, 2017, 09:05:42 AM »
firefox_ESR.tcz works on non-SSE2 processors, but firefox.tcz made by firefox_getLatest.tcz does not.  I like to use CFLAGS="-march=i386 -mtune=i386 -Os -pipe" and CXXFLAGS="-march=i386 -mtune=i386 -Os -pipe" when compiling for extensions.  It might be "-mtune=i686"(from the recommended CFLAGS and CXXFLAGS) that causes the crashes, but I don't think it is(but I don't know much about the internals of gcc). 

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9591
Re: Illegal Instruction crash multiple software old hardware
« Reply #7 on: June 06, 2017, 10:01:51 AM »
getLatest does not compile anything, so your flags don't matter. It just downloads Mozilla's binary.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5438
Re: Illegal Instruction crash multiple software old hardware
« Reply #8 on: June 06, 2017, 10:08:01 AM »
Hi JustinCB
It might be "-mtune=i686"(from the recommended CFLAGS and CXXFLAGS) that causes the crashes, but I don't think it is(but I don't know much about the internals of gcc).

The  -mtune=i686  reorders instructions to take advantage of the internal architecture of the  i686  but does not generate
i686  specific instructions.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 2516
Re: Illegal Instruction crash multiple software old hardware
« Reply #9 on: June 06, 2017, 01:06:46 PM »
firefox_ESR.tcz works on non-SSE2 processors,
I'm not sure if this is still true since the latest ESR update??