Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

aioble: Unhandled exception in IRC callback - memory allocation failed

Đang mở
#982 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
embedded-iot

Hướng nghiên cứu

Bắt đầu với dòng 71 của core.py và dòng 61 của central.py, đường dẫn callback IRQ được hiển thị trong traceback. Chạy workload aioble.scan dài hạn cùng với các tác vụ khác và quan sát MemoryError ảnh hưởng đến tác vụ quét như thế nào. Hoàn tất khi hành vi mong muốn đối với lỗi cấp phát đã được xác định và kiểm chứng mà không âm thầm dừng hoạt động quét nền.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi,

I have a function that scans for advertising data and decode the information (Ruuvi temperature sensors). However, when this runs for a while together with some other tasks, I'm running into a memory issue.

Unhandled exception in IRQ callback handler
Traceback (most recent call last):
  File "core.py", line 71, in ble_irq
  File "central.py", line 61, in _central_irq
MemoryError: memory allocation failed, allocating 2048 bytes

This will quit my background BLE scanning task which is updating my temperature data. Of course I can watch the task and restart it, but I hope for a better error handling the the aioble library.

It runs fine for quite some time before it giving the error. It's not reproducible - sometimes it occurs after 5 minutes, sometimes it runs 2h without any issues.

I tried running an exception catcher around the can itself:

        try:
            async with aioble.scan(duration_ms = duration, interval_us=30000, window_us=30000, active = True) as scanner:
                self.scanner = scanner
                async for result in scanner:
                    self._handle_advertisement(result)

        except Exception as e:
            print('!!!!! Exception in aioble scan')
            print(e)

But this doesn't help to prevent the error from happing. Of course I could change the code in central.py myself and see if I can catch the error, but I don't want to mess around with it (yet).

I already have another task that is frequently running a gc.collect() and memory shows up with round 32kB.

Thanks....

Ngôn ngữ chính
Python
Star
2.9k
Fork
1.1k
Merge trung bình
6 ngày 22 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của micropython/micropython-lib

Tất cả issue của micropython/micropython-lib

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.