On 12/10/2010 01:19 AM, Aaron Plattner wrote:
On Thu, Dec 09, 2010 at 04:36:15AM -0800, Mike McCormack wrote:
I have run into a problem with pixman's CPU detection code under QEMU ARM.

When trying to run an executable linked with pixman under QEMU, I get a crash 
like this:

21553 open("/proc/self/auxv",O_RDONLY) = 3
...
21553 read(3,0x7ffdb0,8) = 8
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Exit reason and status: signal 11

/proc/self/auxv is from the host x86 kernel, not an ARM kernel, as pixman 
expects.
Parsing /proc/self/auxv will only work on Linux with proc mounted, and not 
under QEMU.

Doesn't this indicate a bug in QEMU, rather than something that needs to be
fixed in the emulated environment?

Though you could say it's a bug in QEMU, I think it's beyond the scope of 
qemu-user to
translate the files in the /proc filesystem.

There are other good reasons to fix this in pixman:

* /proc/self/auxv is linux specific (probably won't work on *BSD/ARM)
* /proc may not be mounted
* consistency with other CPU detection functions in pixman. e.g.
  pixman_have_vmx() in pixman/pixman-cpu.c already uses a SIGILL to detect vmx.

Is there any drawbacks to using a SIGILL over scanning /proc?

thanks,

Mike

_______________________________________________
Pixman mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to