Quantcast

libjpeg causes crash

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

libjpeg causes crash

luca suriano
Hi, I have an ibook G3 800MHz 750fx (32 VRAM - Late 2002 - Translucent White).

I have a problem with some graphic applications (i.e zathura, xombrero,
netsurf), each of which goes in crash and a core dump file is saved in
my home.

Now, the core dump debugging tell me that the cause is libjpeg (for each
of them):

Program received signal SIGILL, Illegal instruction.
jsimd_idct_islow_altivec () from /usr/local/lib/libjpeg.so.68.1

I use awesome WM, sometimes it also goes in crash also with the same
problem, libjpeg.

--
"Information wants to be Free"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

Juan Francisco Cantero Hurtado
On Sun, Mar 05, 2017 at 11:30:55AM +0100, luca suriano wrote:

> Hi, I have an ibook G3 800MHz 750fx (32 VRAM - Late 2002 - Translucent White).
>
> I have a problem with some graphic applications (i.e zathura, xombrero,
> netsurf), each of which goes in crash and a core dump file is saved in
> my home.
>
> Now, the core dump debugging tell me that the cause is libjpeg (for each
> of them):
>
> Program received signal SIGILL, Illegal instruction.
> jsimd_idct_islow_altivec () from /usr/local/lib/libjpeg.so.68.1
>
> I use awesome WM, sometimes it also goes in crash also with the same
> problem, libjpeg.

We need the dmesg. Maybe your processor doesn't support altivec.

--
Juan Francisco Cantero Hurtado http://juanfra.info

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

Herminio Hernandez Jr.
 G3 CPUs do not support Altivec.

On Sun, Mar 5, 2017 at 4:30 PM, Juan Francisco Cantero Hurtado <
[hidden email]> wrote:

> On Sun, Mar 05, 2017 at 11:30:55AM +0100, luca suriano wrote:
> > Hi, I have an ibook G3 800MHz 750fx (32 VRAM - Late 2002 - Translucent
> White).
> >
> > I have a problem with some graphic applications (i.e zathura, xombrero,
> > netsurf), each of which goes in crash and a core dump file is saved in
> > my home.
> >
> > Now, the core dump debugging tell me that the cause is libjpeg (for each
> > of them):
> >
> > Program received signal SIGILL, Illegal instruction.
> > jsimd_idct_islow_altivec () from /usr/local/lib/libjpeg.so.68.1
> >
> > I use awesome WM, sometimes it also goes in crash also with the same
> > problem, libjpeg.
>
> We need the dmesg. Maybe your processor doesn't support altivec.
>
> --
> Juan Francisco Cantero Hurtado http://juanfra.info
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

luca suriano
* -> 21:09:33 (domenica 05 marzo 2017)
* -> "Herminio Hernandez, Jr.":

>  G3 CPUs do not support Altivec.

It's not totally true.

G3:
- ...
- 750fx (it's my)
- 750gx
- 750vx (+altivec, but it was never released)
- 750cl

G4:
- 7400 (+altivec)

I hope OpenBSD Hackers solve the problem in the next release.

--
"Information wants to be Free"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

Herminio Hernandez Jr.
I knew the G4 supported it but I did not know there some G3 CPUs that did.

Sent from my iPhone

> On Mar 6, 2017, at 3:32 AM, luca <[hidden email]> wrote:
>
> * -> 21:09:33 (domenica 05 marzo 2017)
> * -> "Herminio Hernandez, Jr.":
>
>> G3 CPUs do not support Altivec.
>
> It's not totally true.
>
> G3:
> - ...
> - 750fx (it's my)
> - 750gx
> - 750vx (+altivec, but it was never released)
> - 750cl
>
> G4:
> - 7400 (+altivec)
>
> I hope OpenBSD Hackers solve the problem in the next release.
>
> --
> "Information wants to be Free"
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

Juan Francisco Cantero Hurtado
In reply to this post by luca suriano
On Mon, Mar 06, 2017 at 11:32:33AM +0100, luca wrote:

> * -> 21:09:33 (domenica 05 marzo 2017)
> * -> "Herminio Hernandez, Jr.":
>
> >  G3 CPUs do not support Altivec.
>
> It's not totally true.
>
> G3:
> - ...
> - 750fx (it's my)
> - 750gx
> - 750vx (+altivec, but it was never released)
> - 750cl
>
> G4:
> - 7400 (+altivec)
>
> I hope OpenBSD Hackers solve the problem in the next release.

Are you using -current or 6.0? If you're using -current, try this patch.

- Apply the patch
- make clean=all
- make update

diff --git Makefile Makefile
index 302a754201c..3889078895d 100644
--- Makefile
+++ Makefile
@@ -5,7 +5,7 @@ COMMENT= SIMD-accelerated JPEG codec replacement of libjpeg
 V= 1.5.1
 DISTNAME= jpeg-turbo-${V}
 PKGNAME= jpeg-${V}
-REVISION= 0
+REVISION= 1
 EPOCH= 0
 
 SHARED_LIBS+= jpeg 68.1 # 64.0
diff --git patches/patch-simd_jsimd_powerpc_c patches/patch-simd_jsimd_powerpc_c
deleted file mode 100644
index 5a5c044d34c..00000000000
--- patches/patch-simd_jsimd_powerpc_c
+++ /dev/null
@@ -1,32 +0,0 @@
-$OpenBSD: patch-simd_jsimd_powerpc_c,v 1.1 2016/12/03 11:22:50 landry Exp $
-
-Detect Altivec support on ppc.
-
---- simd/jsimd_powerpc.c.orig Wed Sep 21 01:36:59 2016
-+++ simd/jsimd_powerpc.c Fri Dec  2 19:23:14 2016
-@@ -26,6 +26,12 @@
- #include <string.h>
- #include <ctype.h>
-
-+#if defined(__OpenBSD__)
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#include <machine/cpu.h>
-+#endif
-+
- static unsigned int simd_support = ~0;
-
- #if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
-@@ -116,6 +122,12 @@ init_simd (void)
-     if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)
-       break;
-   }
-+#elif defined(__OpenBSD__)
-+  int mib[2] = { CTL_MACHDEP, CPU_ALTIVEC };
-+  int altivec;
-+  size_t len = sizeof(altivec);
-+  if (sysctl(mib, 2, &altivec, &len, NULL, 0) == 0 && altivec != 0)
-+    simd_support |= JSIMD_ALTIVEC;
- #endif
-
-   /* Force different settings through environment variables */

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

luca suriano
* -> 18:33:43 (lunedì 06 marzo 2017)
* -> "Juan Francisco Cantero Hurtado":

> Are you using -current or 6.0? If you're using -current, try this patch.
[...]

I'm using 6.0, but I would test your patch immediately.

I'm upgrading to -current right now. As soon as I've done this, I will let
you know (it could be hours).

Thanks.

--
"Information wants to be Free"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

Miod Vallat

> I'm upgrading to -current right now. As soon as I've done this, I will let
> you know (it could be hours).

Could you also post a dmesg and the output of `sysctl machdep'? If your
processor is detected as a 750FX, altivec support should not be
advertized, and libjpeg ought to run flawlessly.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

Juan Francisco Cantero Hurtado
In reply to this post by luca suriano
On Tue, Mar 07, 2017 at 07:04:09PM +0100, luca suriano wrote:

> * -> 18:33:43 (lunedì 06 marzo 2017)
> * -> "Juan Francisco Cantero Hurtado":
>
> > Are you using -current or 6.0? If you're using -current, try this patch.
> [...]
>
> I'm using 6.0, but I would test your patch immediately.
>
> I'm upgrading to -current right now. As soon as I've done this, I will let
> you know (it could be hours).

The -current packages are very outdated. You should build the ports from
source and your machine is very slow, so try with something small.

First, try without the patch. If the port fails, then use the patch.

--
Juan Francisco Cantero Hurtado http://juanfra.info

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

luca suriano
In reply to this post by Miod Vallat
On Tue, 03/07/17, at 21:58:19, Miod Vallat wrote:

> Could you also post a dmesg and the output of `sysctl machdep'? If your
> processor is detected as a 750FX, altivec support should not be
> advertized, and libjpeg ought to run flawlessly.


OpenBSD 6.0-stable (GENERIC) #0: Sun Feb 26 14:08:26 CET 2017
    [hidden email]:/usr/src/sys/arch/macppc/compile/GENERIC
real mem = 268435456 (256MB)
avail mem = 245182464 (233MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root: model PowerBook4,3
cpu0 at mainbus0: 750FX (Revision 0x202): 800 MHz: 512KB L2 cache
mem0 at mainbus0
spdmem0 at mem0: no EEPROM found
spdmem1 at mem0: 128MB SDRAM non-parity PC133CL2
memc0 at mainbus0: uni-n rev 0xc0
kiic0 at memc0 offset 0xf8001000
iic0 at kiic0
admtmp0 at iic0 addr 0xac
mpcpcibr0 at mainbus0 pci: uni-north
pci0 at mpcpcibr0 bus 0
pchb0 at pci0 dev 11 function 0 "Apple Pangea AGP" rev 0x00
agp at pchb0 not configured
radeondrm0 at pci0 dev 16 function 0 "ATI Radeon Mobility M7" rev 0x00
drm0 at radeondrm0
radeondrm0: irq 48
mpcpcibr1 at mainbus0 pci: uni-north
pci1 at mpcpcibr1 bus 0
macobio0 at pci1 dev 23 function 0 "Apple Pangea Macio" rev 0x00
openpic0 at macobio0 offset 0x40000: version 0x4614 feature 3f0302 LE
macgpio0 at macobio0 offset 0x50
macgpio1 at macgpio0 offset 0x9: irq 47
"programmer-switch" at macgpio0 offset 0x11 not configured
"firewire-linkon" at macgpio0 offset 0x5b not configured
"cpu-vcore-select" at macgpio0 offset 0x6b not configured
"extint-gpio4" at macgpio0 offset 0x5c not configured
"gpio9" at macgpio0 offset 0x73 not configured
"extint-gpio12" at macgpio0 offset 0x64 not configured
"escc-legacy" at macobio0 offset 0x12000 not configured
zs0 at macobio0 offset 0x13000: irq 22,23
zstty0 at zs0 channel 0
zstty1 at zs0 channel 1
snapper0 at macobio0 offset 0x10000: irq 30,1,2
"timer" at macobio0 offset 0x15000 not configured
adb0 at macobio0 offset 0x16000: irq 25, via-pmu, 3 targets
apm0 at adb0: battery flags 0x5, 99% charged
piic0 at adb0
iic1 at piic0
akbd0 at adb0 addr 2: iBook keyboard with inverted T (ISO layout)
wskbd0 at akbd0: console keyboard
ams0 at adb0 addr 3: EMP trackpad <tpad> 2-button, 400 dpi
wsmouse0 at ams0 mux 0
abtn0 at adb0 addr 7: brightness/volume/eject buttons
"battery" at macobio0 offset 0x0 not configured
"backlight" at macobio0 offset 0xf300 not configured
kiic1 at macobio0 offset 0x18000
iic2 at kiic1
wdc0 at macobio0 offset 0x1f000 irq 19: DMA
wd0 at wdc0 channel 0 drive 0: <IBM-IC25N030ATCS04-0>
wd0: 16-sector PIO, LBA, 28615MB, 58605120 sectors
atapiscsi0 at wdc0 channel 0 drive 1
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: <LG, CD-ROM CRN-8245B, AHTA> ATAPI 5/cdrom removable
wd0(wdc0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 2
cd0(wdc0:0:1): using PIO mode 4, DMA mode 2, Ultra-DMA mode 2
audio0 at snapper0
ohci0 at pci1 dev 24 function 0 "Apple Pangea USB" rev 0x00: irq 27, version 1.0
ohci1 at pci1 dev 25 function 0 "Apple Pangea USB" rev 0x00: irq 28, version 1.0
usb0 at ohci0: USB revision 1.0
uhub0 at usb0 "Apple OHCI root hub" rev 1.00/1.00 addr 1
usb1 at ohci1: USB revision 1.0
uhub1 at usb1 "Apple OHCI root hub" rev 1.00/1.00 addr 1
mpcpcibr2 at mainbus0 pci: uni-north
pci2 at mpcpcibr2 bus 0
"Apple Pangea FireWire" rev 0x00 at pci2 dev 14 function 0 not configured
gem0 at pci2 dev 15 function 0 "Apple Pangea GMAC" rev 0x00: irq 41, address 00:03:93:cb:52:e2
bmtphy0 at gem0 phy 0: BCM5221 100baseTX PHY, rev. 4
uhidev0 at uhub1 port 1 configuration 1 interface 0 "Logitech Optical USB Mouse" rev 2.00/3.40 addr 2
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse1 at ums0 mux 0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
bootpath: /pci@f2000000/mac-io@17/ata-4@1f000/disk@0:/bsd
root on wd0a (a1a890cdce74b544.a) swap on wd0b dump on wd0b
WARNING: clock lost 8370 days, using FS time -- CHECK AND RESET THE DATE!
error: [drm:pid0:radeon_get_bios] *ERROR* Unable to locate a BIOS ROM
error: [drm:pid0:radeon_agp_init] *ERROR* Unable to acquire AGP: 22
radeondrm0: 1024x768
wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0
wsdisplay0: screen 1-5 added (std, vt100 emulation)
ugen0 at uhub1 port 2 "HCF USB V.90 Data/Fax Modem Apple internal modem" rev 1.10/1.00 addr 3
machdep.allowaperture=2
machdep.altivec=0

--
"Information wants to be Free"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

Donovan Watteau
In reply to this post by luca suriano
luca suriano wrote:

> Hi, I have an ibook G3 800MHz 750fx (32 VRAM - Late 2002 -
> Translucent White).
>
> I have a problem with some graphic applications (i.e zathura,
> xombrero, netsurf), each of which goes in crash and a core
> dump file is saved in my home.
>
> Now, the core dump debugging tell me that the cause is
> libjpeg (for each of them):
>
> Program received signal SIGILL, Illegal instruction.
> jsimd_idct_islow_altivec () from /usr/local/lib/libjpeg.so.68.1
>
> I use awesome WM, sometimes it also goes in crash also with the same
> problem, libjpeg.

Hi,

If you're running OpenBSD/macppc 6.0, you probably have jpeg-1.5.0,
which unconditionally enables Altivec [1].

This was fixed with libjpeg-turbo-1.5.1 + one patch of mine, available
in -current. Altivec is now only enabled when detected at runtime [2].

This was tested on a G3 (with no Altivec) and on a G5 (with Altivec),
so everything should be OK on -current. Let me know if you still see
this problem on -current (or if you need packages), though.

[1]: https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/ChangeLog.md
(see 1.5.1 changes)

[2]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/graphics/jpeg/patches/patch-simd_jsimd_powerpc_c

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

luca suriano
On Fri, 03/10/17, at 17:28:42, Donovan Watteau wrote:
> If you're running OpenBSD/macppc 6.0, you probably have jpeg-1.5.0,
> which unconditionally enables Altivec [1].
>
> This was fixed with libjpeg-turbo-1.5.1 + one patch of mine, available
> in -current. Altivec is now only enabled when detected at runtime [2].
>
> This was tested on a G3 (with no Altivec) and on a G5 (with Altivec),
> so everything should be OK on -current. Let me know if you still see
> this problem on -current (or if you need packages), though.

Hi, after some days (G3 is very slow, I had to read a lot of docs, this is my
first upgrade to -current) I have done.

1) I have upgraded my system from 6.0-stale to -current with a snapshot, in
this case and with your patch everything is OK.

2) Then I have installed from scratch a new system from snapshot, and in
this case it was a total disaster.

--
"Information wants to be Free"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: libjpeg causes crash

luca suriano
On Mon, 03/13/17, at 11:18:56, I wrote:
[...]
> 2) Then I have installed from scratch a new system from snapshot, and in
> this case it was a total disaster.

I'm sorry, I've made a mistake.

--
"Information wants to be Free"

Loading...