Skip to content

Checking for undefined behavior #49

@ormorph

Description

@ormorph

Describe the update

Information required for a developer to define undefined behavior.

Additional Information

File: /etc/portage/env/ubsan

CFLAGS="${CFLAGS} -fsanitize=undefined -fno-omit-frame-pointer"
CXXFLAGS="${CXXFLAGS} -fsanitize=undefined -fno-omit-frame-pointer"
LDFLAGS="${LDFLAGS} -fsanitize=undefined -fno-omit-frame-pointer"

File: /etc/portage/env/debugsyms


CFLAGS="${CFLAGS} -ggdb3"
CXXFLAGS="${CXXFLAGS} -ggdb3"
FEATURES="${FEATURES} splitdebug compressdebug -nostrip installsources"

Create a configuration file to which you can add the necessary packages for testing:
/etc/portage/package.env/xlibre.env:

x11-base/xlibre-server debugsyms ubsan

Next you need to rebuild the package.

Next, we set up logging:

export UBSAN_OPTIONS=log_path=/tmp/ubsan.log

This command must be executed either before starting xlibre or can be written in /etc/conf.d/display-manager. This is at the discretion of the user.

Next, we read the logs and compare them with the contents of /usr/src/debug.

I don't think this needs to be included in the README, but it is necessary for this information to be available.

Extra fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions