GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — cpython3:fuzz_builtin_unicode: Use-of-uninitialized-value in maybe_small_long · Issue #102509 · python/cpython

cpython3:fuzz_builtin_unicode: Use-of-uninitialized-value in maybe_small_long #102509

New issue
Copy link
New issue
Copy link
Closed
Closed
cpython3:fuzz_builtin_unicode: Use-of-uninitialized-value in maybe_small_long#102509
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@illia-v
illia-v
opened on Mar 7, 2023
Issue body actions

There is a bug disclosed by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51574.

I can reproduce it by running CC=clang ./configure --with-memory-sanitizer && make -j12.

Linked PRs

  • gh-102509: Start initializing ob_digit of _PyLongValue #102510
  • gh-102509: Ignore acceptable access of an uninitialized value #102838
  • [3.12] gh-102509: Start initializing ob_digit of _PyLongValue (GH-102510) #107464

Activity

  1. illia-v
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Mar 7, 2023
  2. illia-v
    added 2 commits that reference this issue on Mar 7, 2023

    pythongh-102509: Fix use of uninitialized value detected by oss-fuzz

    76a7542

    pythongh-102509: Start initializing `ob_digit` of `_PyLongValue`

    e13f099
  3. terryjreedy commented on Mar 7, 2023

    @terryjreedy
    terryjreedy
    on Mar 7, 2023
    Member
    More actions

    @ammaraskar commented on the report, asking if it has been 'triaged'. There was no response; it appears from text on the report is that it is not monitored by people on the project. The report claims "Issue filed automatically" (without a URL) but I found no evidence searching cpython open/closed issues for 'unicode' or 'uninitialized'.

  4. illia-v commented on Mar 8, 2023

    @illia-v
    illia-v
    on Mar 8, 2023
    ContributorAuthor
    More actions

    @terryjreedy I think "Issue filed automatically" refers to the issue 51574 on https://bugs.chromium.org/p/oss-fuzz/issues/list,

  5. ammaraskar commented on Mar 8, 2023

    @ammaraskar
    ammaraskar
    on Mar 8, 2023
    Member
    More actions

    Terry when I was asking if it was triaged there I was referring to whether the other core devs who have access to the fuzzer results had taken a look and filed a CPython issue.

  6. illia-v
    added a commit that references this issue on Mar 13, 2023

    Merge branch 'main' into pythongh-102509

    3d240a8
  7. mdickinson commented on Mar 18, 2023

    @mdickinson
    mdickinson
    on Mar 18, 2023
    Member
    More actions

    See comments on the PR; I believe this is a false positive, and can safely be closed.

  8. mdickinson
    added
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Mar 18, 2023
  9. mdickinson commented on Mar 18, 2023

    @mdickinson
    mdickinson
    on Mar 18, 2023
    Member
    More actions

    tl;dr: In the case in question, we do retrieve an integer from allocated but uninitialised memory, but we then multiply that integer by zero, so the lack of initialisation has no adverse effect.

  10. illia-v commented on Mar 18, 2023

    @illia-v
    illia-v
    on Mar 18, 2023
    ContributorAuthor
    More actions

    @mdickinson thanks for looking into this! I assumed it is a false positive, but it prevents fuzzing and building --with-memory-sanitizer.

    Can #102510 be accepted to fix the issues?
    If not, the --with-memory-sanitizer flag should let a compiler know that it is a known issue probably. https://clang.llvm.org/docs/SanitizerSpecialCaseList.html

  11. mdickinson commented on Mar 19, 2023

    @mdickinson
    mdickinson
    on Mar 19, 2023
    Member
    More actions

    but it prevents fuzzing and building --with-memory-sanitizer.

    Hmm, that's awkward. Is there no way to annotate to tell the sanitiser that this case has been checked and deemed safe? E.g., something like this: https://clang.llvm.org/docs/SanitizerSpecialCaseList.html

    Slowing down a hot path by adding an unnecessary extra step just so that a tool doesn't emit a false positive error doesn't seem like the right solution.

  12. illia-v
    added a commit that references this issue on Mar 20, 2023

    pythongh-102509: Create an ignore list for sanitizers

    6a0ff63
  13. illia-v commented on Mar 20, 2023

    @illia-v
    illia-v
    on Mar 20, 2023
    ContributorAuthor
    More actions

    Hmm, that's awkward. Is there no way to annotate to tell the sanitiser that this case has been checked and deemed safe? E.g., something like this: https://clang.llvm.org/docs/SanitizerSpecialCaseList.html

    Yes, ignoring is an option, I mentioned it in my previous comment 🙂

    #102838, I checked and it looks to fix python infra/helper.py reproduce cpython3 fuzz_builtin_unicode clusterfuzz-testcase-minimized-fuzz_builtin_unicode-6313066228219904.

  14. illia-v
    added a commit that references this issue on May 17, 2023

    Merge branch 'main' into pythongh-102509-ignorelist

    30bd44c
  15. markshannon commented on Jul 28, 2023

    @markshannon
    markshannon
    on Jul 28, 2023
    Member
    More actions

    The C spec says that an uninitialized value can include trap values, so in theory multiplying by zero could trap.
    That won't happen on any mainstream hardware, but we should probably fix it.

    Reacted by Gregory P. Smith
  16. AlexWaygood
    removed
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Jul 28, 2023
  17. illia-v
    added a commit that references this issue on Jul 28, 2023

    Merge branch 'main' into pythongh-102509

    d1016a6
  18. illia-v commented on Jul 28, 2023

    @illia-v
    illia-v
    on Jul 28, 2023
    ContributorAuthor
    More actions

    @markshannon could you please check if #102510 is an acceptable fix?

  19. markshannon
    added a commit that references this issue on Jul 28, 2023

    gh-102509: Start initializing `ob_digit` of `_PyLongValue` (GH-102510)

    fc130c4
  20. miss-islington
    added a commit that references this issue on Jul 30, 2023

    pythongh-102509: Start initializing `ob_digit` of `_PyLongValue` (pyt…

    47b91f5
  21. Yhg1s
    added a commit that references this issue on Jul 31, 2023

    [3.12] gh-102509: Start initializing `ob_digit` of `_PyLongValue` (GH…

    8f080a2
  22. illia-v commented on Aug 2, 2023

    @illia-v
    illia-v
    on Aug 2, 2023
    ContributorAuthor
    More actions

    I'm closing this issue because the fix has been verified by ClusterFuzz. Thanks everyone involved!

  23. illia-v
    closed this as completedon Aug 2, 2023
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

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.