include path to strtod()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
xserver-xorg-video-sis (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This is in edgy with
libc6-dev 2.4-1ubuntu8
Ok, lets try to explain. The SiS xorg driver does some memcpy() benchmarking on initialization. To that end it needs to read the file /proc/cpuinfo and exctract the line:
cpu MHz : 2533.649
to get to the value which it gets with a call to strtod(). You can see this in the file sis_memcpy.c from the package:
xserver-
look for function SiS_GetCPUFreq().
According to that changelog this code hasn't been changed recently, yet in recent builds of the driver I get this line on Xorg.0.log:
(--) SIS(0): CPU frequency 1236950581.00Mhz
while it was before (on dapper for instance):
(--) SIS(0): CPU frequency 2533.65Mhz
After investigating a bit I discovered that if I #include <stdlib.h> in sis_memcpy.c the value comes out correct. I've isolated all this in a test program foo.c where you can see this behaviour by commenting and uncommenting the stdlib.h include line.
So, what's going on here? Clearly something changed and it was not the driver.
I hope all this makes sense and the bug is assigned to the correct package.
Thanks
Actually after running this test a few times without the <stdlib.h> include I found that the value is not only incorrect but does change on each program invocation.