Skip to content

free(): invalid pointer with numpy and cv2 #245

@NiuBlibing

Description

@NiuBlibing

I got a problem with pulsar when using numpy and cv2, it throws free(): invalid pointer and kill my program.

# load pulsar firstly, it doesn't work, throws "free(): invalid pointer"
import pulsar
import numpy as np
import cv2

binary_matrix = np.ones((3, 2), dtype=np.uint8)
print(cv2.connectedComponentsWithStats(
        binary_matrix, connectivity=4
    ))

But if I load pulsar latter than numpy, it works:

import numpy as np
import cv2
import pulsar


binary_matrix = np.ones((3, 2), dtype=np.uint8)
print(cv2.connectedComponentsWithStats(
        binary_matrix, connectivity=4
    ))

My environment:

Python 3.13.1
pulsar-client v3.6.0
numpy v2.2.2
opencv-python v4.11.0.86

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