Skip to content

Fix test_capi on UBSan #151284

@vstinner

Description

@vstinner

Bug report

Currently, running test_fromwidechar() of test_capi on UBSan logs UBSan errors. Example:

$ UBSAN_OPTIONS="halt_on_error=1" ./python -m test -v test_capi -m test_fromwidechar
test_fromwidechar (test.test_capi.test_unicode.CAPITest.test_fromwidechar)
Test PyUnicode_FromWideChar() ...

Objects/unicodeobject.c:1942:38: runtime error: addition of unsigned offset to 0x0000017b51d8 overflowed to 0x0000017b51d4
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/unicodeobject.c:1942:38 

I'm working on fixing these errors.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-C-APItype-bugAn unexpected behavior, bug, or error
    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