Skip to content

Debug builds crash on subtraction overflow on non-linux/macos/windows platforms #4880

@nortti0

Description

@nortti0

I've been working on porting Servo to FreeBSD. My debug builds were crashing in Webrender, since this subtraction ends up underflowing. The fix is to instead use .saturating_sub(), but I'm unsure where exactly I should send a fix for this, for it to land in Servo.

Why this only hits FreeBSD and not others is because zeitstempel's fallback implementation starts timestamps off at 0, while other platforms seem to use a timestamp relative to the system bootup – I presume a similar bug would manifest if Servoshell debug builds were to be run on Linux less than one second after boot.

Workaround: build with any profile other than debug, such as --profile medium or --release

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions