EttusResearch / uhd

The USRP™ Hardware Driver Repository
http://uhd.ettus.com
Other
975 stars 655 forks source link

[UHD Python API] Error in macOS 15.0: pointer being freed was not allocated #778

Open doctormin opened 2 months ago

doctormin commented 2 months ago

Issue Description

I have been successfully using the UHD Python API with USRP devices on macOS. However, recently, after upgrading to the macOS 15.0 developer beta system, my UHD API returns an error when running the following line of code: https://github.com/EttusResearch/uhd/blob/a5ed1872be6d0fc36de9a7e0b508933da1f119bc/host/python/uhd/usrp/multi_usrp.py#L36

The error is as follows:

[INFO] [UHD] Mac OS; Clang version 16.0.6 ; Boost_108400; UHD_4.7.0.0-release
python(28956,0x1f0f218c0) malloc: *** error for object 0x1eee29cc0: pointer being freed was not allocated
python(28956,0x1f0f218c0) malloc: *** set a breakpoint in malloc_error_break to debug

Setup Details

Host OS: macOS 15.0 Python: 3.12.4 UHD: 4.7.0.0-release

ENV setup: I used miniforge to install gnuradio from conda-forge, which automatically installs Python and UHD. For example, I am currently using the latest version: 2024-08-02 at 14 53 02

Suspecting this bug might be related to the versions of Python and UHD, I tried the following: mamba install gnuradio=3.10.7 (UHD=4.5.0.0, Python=3.11.9) but encountered the same error.

Steps to reproduce the problem

  1. Prepare a host with macOS 15.0
  2. install miniforge
  3. mamba create -n <env_name>
  4. mamba activate <env_name>
  5. mamba install gnuradio
  6. Write a python script to evoke UHD API:
    import uhd
    import time
    usrp = uhd.usrp.MultiUSRP()

This error will emerge: 2024-08-02 at 14 58 13

rchmielarz commented 1 month ago

I experience the same issue on MacOS 15.1:

Python 3.12.5 | packaged by conda-forge | (main, Aug 8 2024, 18:32:50) [Clang 16.0.6 ] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import uhd >>> import time >>> usrp = uhd.usrp.MultiUSRP() [INFO] [UHD] Mac OS; Clang version 16.0.6 ; Boost_108400; UHD_4.7.0.0-release python3(33938,0x1f3bd2c40) malloc: error for object 0x1f1ae9cc0: pointer being freed was not allocated python3(33938,0x1f3bd2c40) malloc: set a breakpoint in malloc_error_break to debug zsh: abort python3