Bug 472000

Summary: SIGILL in pixman; PPC signal handling busted
Product: [Fedora] Fedora Reporter: Dan Williams <dcbw>
Component: pixmanAssignee: Adam Jackson <ajax>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: ajax, dwmw2
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-11-18 21:38:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Williams 2008-11-18 03:57:30 UTC
pixman-0.12.0-1.fc10.ppc

For some reason, the SIGILL trapping in pixman-pict.c::pixman_have_vmx() isn't working, and any graphical program I launch from X dies with "Illegal instruction".  However, if I log in to a text VT and set DISPLAY, then stuff runs.  Odd.

Even Apple's suggestion which uses siglongmp() doesn't work.

http://developer.apple.com/hardwaredrivers/ve/g3_compatibility.html

Still fails with "Illegal instruction".  Maybe signal handling is busted on PPC somehow?

Comment 1 Dan Williams 2008-11-18 04:00:13 UTC
the pixman code at fault is:

#include <signal.h>
#include <setjmp.h>

static jmp_buf jump_env;

static void vmx_test(int sig, siginfo_t *si, void *unused) {
    longjmp (jump_env, 1);
}

pixman_bool_t pixman_have_vmx (void) {
    struct sigaction sa, osa;
    int jmp_result;
    if (!initialized) {
        sa.sa_flags = SA_SIGINFO;
        sigemptyset(&sa.sa_mask);
        sa.sa_sigaction = vmx_test;
        sigaction(SIGILL, &sa, &osa);
        jmp_result = setjmp (jump_env);
        if (jmp_result == 0) {
            asm volatile ( "vor 0, 0, 0" );
        }
	sigaction(SIGILL, &osa, NULL);
        have_vmx = (jmp_result == 0);
        initialized = TRUE;
    }
    return have_vmx;
}

It seems like the SIGILL redirection simply isn't working.

glibc-2.9-2.ppc
kernel-2.6.27.5-109.fc10.ppc
gcc-4.3.2-7.ppc

Comment 2 Dan Williams 2008-11-18 04:01:33 UTC
This is an iBook G3 800:

processor	: 0
cpu		: 750FX
temperature 	: 46 C (uncalibrated)
clock		: 400.000000MHz
revision	: 2.3 (pvr 7000 0203)
bogomips	: 24.76
timebase	: 24835245
platform	: PowerMac
model		: PowerBook4,3
machine		: PowerBook4,3
motherboard	: PowerBook4,3 MacRISC2 MacRISC Power Macintosh
detected as	: 257 (iBook 2 rev. 2)
pmac flags	: 0000001b
L2 cache	: 512K unified
pmac-generation	: NewWorld

(not really 400MHz, but cpu throttling is probably on)

Comment 3 David Woodhouse 2008-11-18 14:20:56 UTC
What happened to the patch in bug #451831 ?

Comment 4 Dan Williams 2008-11-18 15:22:48 UTC
Apparently it's not in current builds.  Not sure what ajax was smoking :)

Comment 5 Dan Williams 2008-11-18 15:30:36 UTC
Working with soren to get the patch from bug #451831 upstream.

Comment 6 Dan Williams 2008-11-18 21:38:06 UTC
pixman-0.12.0-2.fc10, committed upstream too