include path to strtod()

Bug #56649 reported by Rui Matos on 2006-08-17
Affects Status Importance Assigned to Milestone
xserver-xorg-video-sis (Ubuntu)

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-xorg-video-sis 0.9.1-0ubuntu1

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.


Rui Matos (tiagomatos) wrote :

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.

Tormod Volden (tormodvolden) wrote :

See this for more explanation:

If the sis_memcpy uses strtod, it _should_ include strlib.h. It was maybe included in a nested header file before.

Tormod Volden (tormodvolden) wrote :


Tollef Fog Heen (tfheen) wrote :

A fix for this has been committed upstream.

Changed in xserver-xorg-video-sis:
status: Unconfirmed → In Progress
Tormod Volden (tormodvolden) wrote :

This was fixed in the 0.9.3 release.

Changed in xserver-xorg-video-sis:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments