Skip to content

execl never terminates on 32bit with time64 (on musl?) #111

@martinetd

Description

@martinetd

unixbench never terminated on our 32bit alpine 3.21, it was hung in execl.

Adding a print statement like this and running execl 1:

printf("%lld - %lld >= %d\n", this_time, start_time, duration);

showed start_time is not read properly:

1742518553 - 36102256912 >= 1

The problem is probably that scanf with %ld does not write the upper 32 bits of the 64 bit time_t

Changing the scanf to %lld worked but it depends on time_t size, which might still be 32 bit for old systems.

I'll need to check if initializing the variable to 0 is enough (probably is); if it is I'll send a PR later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions