Don't use int constants with a long data type.

Bug #625798 reported by Michael Bienia on 2010-08-28
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Tickcount
High
Unassigned
tickcount (Ubuntu)
Medium
Thierry Carrez

Bug Description

A debug session in #ubuntu-devel initiated by Emmet Hikory for the cause of the FTBFS for powerpc, revealing a but in the tickcount code.

tickcount's C code uses "long" for the variables but uses UINT_MAX for the wrap-around computation. The same applies to the test suite for it, it also uses UINT_MAX. This works for 32bit because sizeof(int)==4==sizeof(long) but not for 64bit where sizeof(int)==4!=8==sizeof(long). Therefore on 64bit the computation is wrong and the test suite doesn't check a wrap around (as the values used fit into 64bit and no wrap-around happens).

Related branches

Michael Bienia (geser) wrote :
Michael Bienia (geser) wrote :
Emmet Hikory (persia) wrote :

I test-built with the upstream patch (but a slightly different debdiff) against maverick on i386, amd64, armel, and powerpc. In all cases, the package built successfully, including passing all tests.

Changed in tickcount (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Thierry Carrez (ttx) on 2010-09-06
Changed in tickcount (Ubuntu):
assignee: nobody → Thierry Carrez (ttx)
status: Triaged → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tickcount - 0.1-0ubuntu13

---------------
tickcount (0.1-0ubuntu13) maverick; urgency=low

  * Fix wrap-around computation and test suite for it:
    Don't use int constants for a long data type. It doesn't work as expected
    on 64bit. (lp: #625798)
 -- Michael Bienia <email address hidden> Sat, 28 Aug 2010 14:34:37 +0200

Changed in tickcount (Ubuntu):
status: In Progress → Fix Released
Changed in tickcount:
status: New → Triaged
importance: Undecided → High
tags: added: easy
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers