Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 377732 Details for
Bug 545307
[abrt] crash detected in xen-runtime-3.4.1-5.fc12
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to fix the bug
xen-detect.patch (text/plain), 1.73 KB, created by
Paolo Bonzini
on 2009-12-11 13:34:16 UTC
(
hide
)
Description:
patch to fix the bug
Filename:
MIME Type:
Creator:
Paolo Bonzini
Created:
2009-12-11 13:34:16 UTC
Size:
1.73 KB
patch
obsolete
>diff --git a/tools/misc/xen-detect.c b/tools/misc/xen-detect.c >--- a/tools/misc/xen-detect.c >+++ b/tools/misc/xen-detect.c >@@ -29,9 +29,11 @@ > #include <stdlib.h> > #include <string.h> > #include <sys/types.h> >-#include <sys/wait.h> >+#include <setjmp.h> >+#include <signal.h> > #include <unistd.h> > >+jmp_buf j; > static int pv_context; > > static void cpuid(uint32_t idx, >@@ -74,6 +76,11 @@ > return 1; > } > >+void sigill_handler (int sig) >+{ >+ longjmp(j, 1); >+} >+ > int main(void) > { > pid_t pid; >@@ -84,33 +91,18 @@ > if ( check_for_xen() ) > return 0; > >- /* Now we check for execution in PV context. */ >- pv_context = 1; >- > /* >- * Fork a child to test the paravirtualised CPUID instruction. >- * If executed outside Xen PV context, the extended opcode will fault. >+ * Setup a signal handler to test the paravirtualised CPUID instruction. >+ * If executed outside Xen PV context, the extended opcode will fault >+ * and we'll print "Not running on Xen". > */ >- pid = fork(); >- switch ( pid ) >- { >- case 0: >- /* Child: test paravirtualised CPUID opcode and then exit cleanly. */ >- cpuid(0x40000000, &dummy, &dummy, &dummy, &dummy); >- exit(0); >- case -1: >- fprintf(stderr, "Fork failed.\n"); >- return 0; >+ signal(SIGILL, sigill_handler); >+ if (setjmp(j) == 0) { >+ pv_context = 1; >+ if ( check_for_xen() ) >+ return 0; > } > >- /* >- * Parent waits for child to terminate and checks for clean exit. >- * Only if the exit is clean is it safe for us to try the extended CPUID. >- */ >- waitpid(pid, &status, 0); >- if ( WIFEXITED(status) && check_for_xen() ) >- return 0; >- > printf("Not running on Xen.\n"); > return 0; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 545307
:
376838
| 377732