Bug 252179 - test_altivec fails with SIGILL
test_altivec fails with SIGILL
Product: Fedora
Classification: Fedora
Component: liboil (Show other bugs)
ppc64 Linux
low Severity low
: ---
: ---
Assigned To: Behdad Esfahbod
Fedora Extras Quality Assurance
Depends On:
Blocks: FE-ExcludeArch-ppc64/F-ExcludeArch-ppc64 F-ExcludeArch-ppc
  Show dependency treegraph
Reported: 2007-08-14 11:09 EDT by Bastien Nocera
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version: 0.3.12-9.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-08-27 17:49:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
liboil-0.3.12-altivec-fix.patch (2.06 KB, patch)
2007-08-14 11:54 EDT, Bastien Nocera
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
FreeDesktop.org 11997 None None None Never

  None (edit)
Description Bastien Nocera 2007-08-14 11:09:06 EDT
(Note: this bug makes gst-inspect-0.10 crash, so that totem's configure can't
detect whether required plugins are installed)


Filed upstream at:

# gdb /usr/bin/gst-inspect-0.10 
(gdb) run --gst-disable-registry-fork
Starting program: /usr/bin/gst-inspect-0.10 --gst-disable-registry-fork
Program received signal SIGILL, Illegal instruction.
[Switching to Thread 4398051383792 (LWP 22970)]
test_altivec (ignored=0x0) at liboilcpu.c:647
647       asm volatile ("vor v0, v0, v0\n");
(gdb) bt
#0  test_altivec (ignored=0x0) at liboilcpu.c:647
#1  0x00000400048ff400 in oil_cpu_fault_check_try (func=@0x40004960b80:
0x400048ff300 <test_altivec>, priv=0x0) at liboilcpu.c:209
#2  0x00000400048ff5b8 in _oil_cpu_init () at liboilcpu.c:655
#3  0x0000040004900670 in oil_init () at liboilfunction.c:136
#4  0x0000040005836dd4 in ?? () from
#5  0x0000040005833b30 in ?? () from
#6  0x00000400000956ec in .gst_plugin_get_name () from
#7  0x0000040000095d6c in .gst_plugin_load_file () from
#8  0x000004000009c608 in .gst_default_registry_check_feature_version () from
#9  0x000004000009c8c4 in .gst_registry_scan_path () from
#10 0x0000040000052024 in .gst_registry_fork_set_enabled () from
#11 0x0000040000052344 in .gst_registry_fork_set_enabled () from
#12 0x00000400000538ec in .gst_init () from /usr/lib64/libgstreamer-0.10.so.0
#13 0x00000400002257cc in .g_option_context_parse () from
#14 0x0000000010005fc8 in ?? ()
#15 0x0000008015459f2c in .generic_start_main () from /lib64/libc.so.6
#16 0x000000801545a1c0 in .__libc_start_main () from /lib64/libc.so.6
#17 0x0000000000000000 in ?? ()
Comment 1 Bastien Nocera 2007-08-14 11:25:00 EDT
This problem makes totem not compile on PPC and PPC64 (see upstream bug, the
problem occurs on both arches), adding to the blocker bugs.
Comment 3 Bastien Nocera 2007-08-14 11:54:44 EDT
Created attachment 161278 [details]

For some reason, I'm not in the ACLs for it, so can't commit.

Let me know when the patch is in so I can update the reqs in
gstreamer-plugins-good and gstreamer-plugins-base and gstreamer-plugins-good
Comment 4 Bastien Nocera 2007-08-14 11:59:58 EDT
Note that this needs to go in rawhide and probably F7 (although I won't be
updating deps for F7, takes too long to go through the rebuilds/updates cycles).
Comment 5 Bastien Nocera 2007-08-14 12:19:48 EDT
Never mind, this patch is already in our version of liboil, so it's something else.
Comment 6 Matthias Saou 2007-08-14 12:24:37 EDT
Note that you seem to have committed the patch and spec file changes, though :-/
Comment 7 Bastien Nocera 2007-08-14 12:27:41 EDT
My mistake, I was so sure this would fix it... I reverted the changes already.
Comment 8 Bastien Nocera 2007-08-14 14:10:09 EDT
Here's the second part of the patch that David committed:

I believe this would fix it. Matthias, do you want to do the updates, or you
want me to do them?
Comment 9 Bastien Nocera 2007-08-15 04:31:40 EDT
We're in for a fun ride, the patch doesn't compile (I tested locally first this
time ;):
Comment 10 Bastien Nocera 2007-08-15 04:39:13 EDT
The fix is simple though, building in rawhide now.
Comment 11 Bastien Nocera 2007-08-16 04:44:14 EDT
And we need to remove the hand-made signal saving code as well:

Testing now on a pSeries machine. Hopefully will finally fix the problem.
Comment 12 Bastien Nocera 2007-08-16 05:57:06 EDT
You wish it would work by now:
Comment 13 David Woodhouse 2007-08-22 14:23:52 EDT
The problem here is nothing to do with the explicit altivec test.
The problem here is because you've told the compiler it's allowed to use altivec
in normal C code, and recently is grew smart enough to actually do so. Just #if
0 the altivec tests in oil_cpu_detect_powerpc() and see it still die...

Program received signal SIGILL, Illegal instruction.
oil_prototype_from_string (
    s=0x10032c98 "float *dest, int dstr, float *src, int sstr, int n")
    at liboilprototype.c:189
189       OilParameter param = { 0 };
(gdb) bt
#0  oil_prototype_from_string (
    s=0x10032c98 "float *dest, int dstr, float *src, int sstr, int n")
    at liboilprototype.c:189
#1  0x10002f18 in oil_test_new (klass=0x10042d58) at liboiltest.c:73
#2  0x100011a8 in oil_class_optimize (klass=0x10042d58) at liboilfunction.c:350
#3  0x28000488 in ?? ()
#4  0x100014a0 in oil_optimize_all () at liboilfunction.c:179
#5  0x100015b4 in oil_init () at liboilfunction.c:140
#6  0x10000adc in main ()
(gdb) x/i $pc
0x1002fe04 <oil_prototype_from_string+4>:       vxor    v0,v0,v0
Comment 14 David Woodhouse 2007-08-22 15:05:39 EDT
Adding -fno-tree-vectorize to CFLAGS might help but since this project
unfortunately uses autocrap instead of proper makefiles, I cannot test. I
changed ALTIVEC_CFLAGS and LIBOIL_CFLAGS in both the top-level and
liboil/Makefile but it still seems not to use what I set.
Comment 15 David Woodhouse 2007-08-22 15:51:06 EDT
Just -fno-tree-vectorize isn't sufficient. Removing -maltivec seems to work:
        $ sed -i s/-maltivec/-Wa,-maltivec/ configure

Although it might be nice to build it both ways and to link at runtime against
the version which is appropriate. Glibc manages this kind of thing... how hard
would it be for liboil?
Comment 16 Bastien Nocera 2007-08-23 06:43:02 EDT
After some changes:
sed -i 's/CFLAGS="$CFLAGS "-maltivec""/CFLAGS="$CFLAGS "-fno-tree-vectorize
-Wa,-maltivec""/' configure
sed -i 's/LIBOIL_CFLAGS -maltivec/LIBOIL_CFLAGS -fno-tree-vectorize
-Wa,-maltivec/' configure

It still crashes:

Starting program:

Program received signal SIGILL, Illegal instruction.
test_altivec (ignored=0x0) at liboilcpu.c:651
651       asm volatile ("vor v0, v0, v0\n");
(gdb) continue 

Program received signal SIGSEGV, Segmentation fault.
0x00000080154bab88 in .__libc_malloc () from /lib64/libc.so.6
(gdb) bt
#0  0x00000080154bab88 in .__libc_malloc () from /lib64/libc.so.6
#1  0x0000040000038f10 in oil_prototype_from_string (s=0x4000006ce10 "uint8_t
*d_4xn, uint8_t* s_3xn, int n") at liboilprototype.c:195
#2  0x000004000003b518 in oil_test_new (klass=0x40000087fe8) at liboiltest.c:73
#3  0x0000040000036fbc in oil_class_optimize (klass=0x40000087fe8) at
#4  0x0000040000037370 in oil_optimize_all () at liboilfunction.c:181
#5  0x00000400000374f0 in oil_init () at liboilfunction.c:140
#6  0x0000000010000708 in main (argc=24, argv=0x0) at example1.c:41
(gdb) x/i $pc
0x80154bab88 <.__libc_malloc+136>:      ld      r31,0(r9)

I'm at loss.
Comment 17 Bastien Nocera 2007-08-23 07:23:36 EDT
Filed as:

I disabled PPC's altivec tests altogether, and managed to get it running. No
altivec optimisations, but no crashes either.

Testing in 0.3.12-9 now.
Comment 18 Bastien Nocera 2007-08-23 12:36:10 EDT
"Fixed" in 0.3.12-9.

are still there, and there's no Altivec optimisations on PPC though.
Comment 19 Fedora Update System 2007-08-27 17:49:19 EDT
liboil-0.3.12-9.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 20 Josh Boyer 2007-08-30 08:58:48 EDT
David Woodhouse has a build for this that selectively enables Altivec on PPC
platforms that support it:


Note You need to log in before you can comment on or make changes to this bug.