Skip to content

Transferring lots of data to nRF can cause crash #2318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jepler opened this issue Nov 22, 2019 · 1 comment
Closed

Transferring lots of data to nRF can cause crash #2318

jepler opened this issue Nov 22, 2019 · 1 comment
Milestone

Comments

@jepler
Copy link

jepler commented Nov 22, 2019

To trigger, I run dd if=/dev/zero bs=512 count=200 of=/media/jepler/CIRCUITPY/zero.

With a debug build, I can capture this traceback:

Breakpoint 4, reset_into_safe_mode (reason=reason@entry=GC_ALLOC_OUTSIDE_VM)
    at ../../supervisor/shared/safe_mode.c:84
84	void __attribute__((noinline,)) reset_into_safe_mode(safe_mode_t reason) {
(gdb) where
#0  reset_into_safe_mode (reason=reason@entry=GC_ALLOC_OUTSIDE_VM)
    at ../../supervisor/shared/safe_mode.c:84
#1  0x00027dc4 in gc_alloc (n_bytes=n_bytes@entry=64, 
    has_finaliser=has_finaliser@entry=false, long_lived=<optimized out>)
    at ../../py/gc.c:489
#2  0x000274ec in m_malloc_maybe (num_bytes=num_bytes@entry=64, 
    long_lived=long_lived@entry=false) at ../../py/malloc.c:95
#3  0x00047f86 in allocate_ram_cache ()
    at ../../supervisor/shared/external_flash/external_flash.c:327
#4  0x000482f4 in external_flash_write_block (
    data=data@entry=0x200047e4 <_mscd_buf> "", block=block@entry=203)
    at ../../supervisor/shared/external_flash/external_flash.c:518
#5  0x0004839e in supervisor_flash_write_blocks (
    src=0x200047e4 <_mscd_buf> "", block_num=203, num_blocks=2)
    at ../../supervisor/shared/external_flash/external_flash.c:554
#6  0x00043c9a in flash_write_blocks (src=<optimized out>, 
    block_num=<optimized out>, num_blocks=<optimized out>)
    at ../../supervisor/shared/flash.c:121
#7  0x00042bb4 in disk_write (pdrv=pdrv@entry=0x200044e4 <_internal_vfs>, 
    buff=buff@entry=0x200047e4 <_mscd_buf> "", sector=sector@entry=204, 
    count=count@entry=2) at ../../extmod/vfs_fat_diskio.c:120
#8  0x0004ad58 in tud_msc_write10_cb (lun=<optimized out>, lba=204, 
    offset=<optimized out>, buffer=buffer@entry=0x200047e4 <_mscd_buf> "", 
    bufsize=bufsize@entry=1024)
    at ../../supervisor/shared/usb/usb_msc_flash.c:140
#9  0x00049b26 in mscd_xfer_cb (rhport=<optimized out>, 
    ep_addr=<optimized out>, event=<optimized out>, xferred_bytes=1024)
    at ../../lib/tinyusb/src/class/msc/msc_device.c:474
#10 0x0004920a in tud_task () at ../../lib/tinyusb/src/device/usbd.c:330
#11 0x0004ac3e in usb_background () at ../../supervisor/shared/usb/usb.c:79
#12 0x0004b098 in run_background_tasks () at background.c:61
#13 0x0005acea in common_hal_neopixel_write (
    digitalinout=digitalinout@entry=0x20004774 <status_neopixel>, 
    pixels=pixels@entry=0x2000477c <status_neopixel_color> "\v", 
    numBytes=numBytes@entry=3) at common-hal/neopixel_write/__init__.c:203
#14 0x00043de4 in clear_temp_status ()
    at ../../supervisor/shared/rgb_led_status.c:300
#15 0x00047f1e in spi_flash_flush_keep_cache (
    keep_cache=keep_cache@entry=false)
    at ../../supervisor/shared/external_flash/external_flash.c:444
#16 0x00048190 in supervisor_flash_release_cache ()
    at ../../supervisor/shared/external_flash/external_flash.c:455
#17 0x00043aee in filesystem_flush ()
    at ../../supervisor/shared/filesystem.c:127
#18 0x000430fa in start_mp (heap=heap@entry=0x200063c0 <allocations+16>)
    at ../../main.c:116
#19 0x000432aa in run_code_py (safe_mode=safe_mode@entry=NO_SAFE_MODE)
    at ../../main.c:240
#20 0x000435a2 in main () at ../../main.c:464

At this point, the device disconnects from USB and the indicator blinks yellow until reset.

@dhalbert dhalbert added this to the 5.0.0 milestone Nov 26, 2019
@jepler
Copy link
Author

jepler commented Dec 5, 2019

This is a duplicate of #2338 but the discussion there is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants