Skip to content

Crash calling time.localtime() with no input on ESP32-S2 #3439

Closed
@askpatrickw

Description

@askpatrickw

I was able to reproduce this on Kaluga and the FeatherS2.
Build is off of adafruit/main as of Midnight 9/18 (Pacific)

In the REPL

>>> import time
>>> dir(time)
['__class__', '__name__', 'localtime', 'mktime', 'monotonic', 'monotonic_ns', 'sleep', 'struct_time', 'time']
>>> time.localtime()

KALUGA Debug

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x4008e9aa  PS      : 0x00060430  A0      : 0x8008ea36  A1      : 0x3ffdd1e0
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x3ffd12d0
A6      : 0xffffffff  A7      : 0x00000001  A8      : 0x00000000  A9      : 0x00000000
A10     : 0x400b0580  A11     : 0x00000000  A12     : 0x00000000  A13     : 0x3ffd12d0
A14     : 0x3ffd10ec  A15     : 0x00000001  SAR     : 0x0000000c  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x3ffd12d0  LCOUNT  : 0x400290dd

Backtrace:0x4008e9a7:0x3ffdd1e0 0x4008ea33:0x3ffdd200 0x4008d48a:0x3ffdd220 0x4008d4e9:0x3ffdd240 
0x4008d540:0x3ffdd260 0x400aab70:0x3ffdd290 0x400b058d:0x3ffdd2c0 0x4009150b:0x3ffdd2f0 
0x4008d26d:0x3ffdd320 0x4008d36d:0x3ffdd340 0x4009ab46:0x3ffdd360 0x400914a6:0x3ffdd400 
0x4008d26d:0x3ffdd430 0x4008d29a:0x3ffdd450 0x400a8732:0x3ffdd470 0x400a8a55:0x3ffdd520 
0x4009e144:0x3ffdd560 0x4009e1a9:0x3ffdd580 0x4009e39f:0x3ffdd5a0 0x4002fa2c:0x3ffdd5c0

ELF file SHA256: 4059e40b5f14639e
CPU halted.

python tools/decode_backtrace.py espressif_kaluga_1

espressif_kaluga_1
? 0x4008e9a7:0x3ffdd1e0 0x4008ea33:0x3ffdd200 0x4008d48a:0x3ffdd220 0x4008d4e9:0x3ffdd240 
0x4008d540:0x3ffdd260 0x400aab70:0x3ffdd290 0x400b058d:0x3ffdd2c0 0x4009150b:0x3ffdd2f0 
0x4008d26d:0x3ffdd320 0x4008d36d:0x3ffdd340 0x4009ab46:0x3ffdd360 0x400914a6:0x3ffdd400 
0x4008d26d:0x3ffdd430 0x4008d29a:0x3ffdd450 0x400a8732:0x3ffdd470 0x400a8a55:0x3ffdd520 
0x4009e144:0x3ffdd560 0x4009e1a9:0x3ffdd580 0x4009e39f:0x3ffdd5a0 0x4002fa2c:0x3ffdd5c0

got ['0x4008e9a7', '0x4008ea33', '0x4008d48a', '0x4008d4e9', '0x4008d540', '0x400aab70', '0x400b058d', 
'0x4009150b', '0x4008d26d', '0x4008d36d', '0x4009ab46', '0x400914a6', '0x4008d26d', '0x4008d29a', '0x400a8732', 
'0x400a8a55', '0x4009e144', '0x4009e1a9', '0x4009e39f', '0x4002fa2c']
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/obj.c:52
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/obj.c:46
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/runtime.c:1060
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/runtime.c:1093
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/runtime.c:931
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../shared-bindings/rtc/__init__.c:46
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../shared-bindings/time/__init__.c:242
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/objfun.c:129
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/runtime.c:624
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/runtime.c:639
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/vm.c:1017
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/objfun.c:286
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/runtime.c:624
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../py/runtime.c:598
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../lib/utils/pyexec.c:114
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../lib/utils/pyexec.c:520
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../main.c:439
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/../../main.c:504
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/supervisor/port.c:198
/Users/askpatrickw/code/github/circuitpython/ports/esp32s2/build-espressif_kaluga_1/esp-idf/../../esp-idf/components/freertos/xtensa/port.c:511

NOTE: Calling it correctly does work

>>> import time
>>> time.mktime((2020, 9, 14, 23, 22, 15, 0, -1, -1))
1600125735
>>> time.localtime(1600125735)
struct_time(tm_year=2020, tm_mon=9, tm_mday=14, tm_hour=23, tm_min=22, tm_sec=15,
tm_wday=0, tm_yday=258, tm_isdst=-1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcrashespressifapplies to multiple Espressif chips

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions