Skip to content

Fix test_capi on UBSan #151284

Closed
Closed

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

Activity

  1. added a commit that references this issue on Jun 11, 2026
  2. added 3 commits that reference this issue on Jun 11, 2026
  3. added a commit that references this issue on Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-C-APItype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions