Skip to content

EnumerateDevices() sometimes terminates the application with core dumped #850

@jokubas11

Description

@jokubas11

Describe what you want to implement and what the issue & the steps to reproduce it are:

Never had this kind of issue before, but calling EnumerateDevices() sometimes (not always) following message:

main.py

camera = CameraHandler()
cams = camera.get_cameras_list()

basler_camera.py

class CameraHandler:
    def __init__(self) -> None:
        ...

    @staticmethod
    def get_cameras_list() -> list[tuple[pylon.CDeviceInfo, str]]:
        """
        Return the list of Basler cameras available.

        Returns:
            List[Tuple[pylon.CDeviceInfo, str]]: Returns a list of
                tuples containing two items:
                1. Camera descriptor, used to create camera object
                2. String name, useful if needed to list out all cameras
        """
        tf = pylon.TlFactory.GetInstance()
        lst = [(cam, cam.GetModelName()) for cam in tf.EnumerateDevices()]
        return lst

OUTPUT:

(.venv) jokubasz@PCNAME:~/projects/basler_handler$ python main.py 
[(<pypylon.pylon.DeviceInfo; proxy of <Swig Object of type 'Pylon::CDeviceInfo *' at 0x738570ba9260> >, 'acA2040-90umNIR')]
(.venv) jokubasz@PCNAME:~/projects/basler_handler$ python main.py 
[(<pypylon.pylon.DeviceInfo; proxy of <Swig Object of type 'Pylon::CDeviceInfo *' at 0x721573faea30> >, 'acA2040-90umNIR')]
(.venv) jokubasz@PCNAME:~/projects/basler_handler$ python main.py 
[(<pypylon.pylon.DeviceInfo; proxy of <Swig Object of type 'Pylon::CDeviceInfo *' at 0x792008dcb810> >, 'acA2040-90umNIR')]
(.venv) jokubasz@PCNAME:~/projects/basler_handler$ python main.py 
[(<pypylon.pylon.DeviceInfo; proxy of <Swig Object of type 'Pylon::CDeviceInfo *' at 0x712b73fae820> >, 'acA2040-90umNIR')]
(.venv) jokubasz@PCNAME:~/projects/basler_handler$ python main.py 
pure virtual method called
terminate called without an active exception
Aborted (core dumped)

error always happens on call to

tf.EnumerateDevices()

Camera not an issue, happens without camera connected to PC as well
If this error doesn't happen, cameras work well, no issue with any of the cameras.
Everything works well in pylon viewer

Is your camera operational in Basler pylon viewer on your platform

Yes

Hardware setup used

PC: Linux PCNAME 6.14.0-27-generic 27~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 17:38:49 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
pypylon version: 4.2.0

I recently upgraded my OS from Ubuntu 22 to Ubuntu 24.
Not sure if it is related, but never had the same issue on Ubuntu 22.
Also, not camera related, happens even with camera plugged off.
Also, I have not developed with Basler cameras for a long time, so I am not sure if version has anything to do with this either.

Camera(s) used

Not relevant, happens without camera plugged in.

Runtime information:

python: 3.12.3 (main, Jun 18 2025, 17:59:45) [GCC 13.3.0]
platform: linux/x86_64/6.14.0-27-generic
pypylon: 4.2.0 / 10.2.1.471

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