Skip to content

Umbrella issue: bottleneck C Extension Analysis Report #518

@devdanzin

Description

@devdanzin

Below is part of an analysis report created by cext-review-toolkit. It contains segfaults under OOM, memory leaks on error paths (~80 KB per invalid partition/argpartition call), a per-call reference leak in rankdata on non-C-contiguous arrays, systemic missing NULL checks in INIT/INIT_ONE macros affecting ~46 generated functions, and unchecked malloc in mm_new/mm_new_nan. The full report is available at https://gist.github.com/devdanzin/b9ce99c1971afa418b6a24ca575c67c5.

This is meant as an umbrella issue from which specific sub issues can be created.

bottleneck C Extension Analysis Report

Findings by Priority

FIX

CONSIDER


Summary Table

# Finding Classification Confidence
1-2 #519 move_median MEMORY_ERR segfault FIX HIGH
3-4 #520 partition/argpartition ~80 KB leak on error FIX HIGH
5 #521 nonreducer_axis Ravel reference leak + NULL FIX HIGH
6 #522 nonreducer_axis RUNTIME_ERR without return FIX HIGH
7-8 #523 rankdata/nanrankdata unchecked ArgSort+EMPTY FIX HIGH
9 #524 push unchecked PyArray_Copy FIX HIGH
10-11 #525 INIT/INIT_ONE macro unchecked EMPTY (~46 functions) FIX HIGH
12-14 #526 mm_new/mm_new_nan unchecked malloc + mm_free on NULL FIX HIGH
15 #527 Missing pystr_kth check FIX HIGH
16 #528 iterators.h Ravel unchecked CONSIDER HIGH
17 #529 BUFFER_NEW unchecked malloc CONSIDER HIGH
18 #530 Module leak on init failure CONSIDER MEDIUM
19 #531 Exception clobbering (~15 sites) CONSIDER MEDIUM
20 #532 Free-threading global state CONSIDER HIGH

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions