Skip to content

On recent GCC versions, links no longer work correctly due to stat() of NULL pointer #4

Description

@scotte

I'll be creating a pull request for this shortly. I discovered that links were no longer being moved correctly when running cronolog on Ubuntu Bionic. With some investigation, I determined that this was do to stat() with a NULL pointer, which now results in undefined behavior in GCC when compiling with -O2.

I created a bug at Launchpad for this [1] which was upstreamed and closed in GCC as INVALID [2]. Hence, the right thing to do is guard against stat() on a null pathname, which is a trivial change.

[1] https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1770676
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85778

This is a pretty dead project, but unfortunately this bug results in cronolog breaking when compiled with GCC >5(ish - exact GCC version where this breaks is unknown).

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