SteMaker / wortuhr

Wortuhr basierend auf ESP-12F incl. Firmware, PCB und Hardware-Beschreibung
MIT License
6 stars 4 forks source link

Exception if clock is booted while website is loaded in browser #7

Closed stan23 closed 4 years ago

stan23 commented 4 years ago

If the wordclock website is open in a browser while the wordclock is powered up and booted, there's an exception.

First NO WLAN is shown, then WLAN, then the exception happens and the clock reboots.

Stack trace:

Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address
PC: 0x4010565c
EXCVADDR: 0x00000003

Decoding stack results
0x40220cb1: dns_gethostbyname_addrtype at core/dns.c line 1502
0x40220d08: dns_gethostbyname at core/dns.c line 1530
0x40229040: mem_free at core/mem.c line 237
0x402226f4: tcp_input at core/tcp_in.c line 501
0x402282ce: ip4_input at core/ipv4/ip4.c line 1467
0x4021f195: ethernet_input_LWIP2 at netif/ethernet.c line 188
0x4021efb4: esp2glue_ethernet_input at glue-lwip/lwip-git.c line 469
0x402449ce: ethernet_input at glue-esp/lwip-esp.c line 365
0x402449df: ethernet_input at glue-esp/lwip-esp.c line 373
0x4021eb79: glue2esp_linkoutput at glue-esp/lwip-esp.c line 301
0x4021ee02: new_linkoutput at glue-lwip/lwip-git.c line 260
0x4021f220: ethernet_output at netif/ethernet.c line 312
0x40229020: mem_malloc at core/mem.c line 210
0x4021f275: do_memp_malloc_pool at core/memp.c line 255
0x4021f2b4: memp_malloc at core/memp.c line 356
0x40226ad7: etharp_query at core/ipv4/etharp.c line 1031
0x4021eb79: glue2esp_linkoutput at glue-esp/lwip-esp.c line 301
0x40226c48: etharp_output_LWIP2 at core/ipv4/etharp.c line 890
0x40228530: ip4_output_if_opt_src at core/ipv4/ip4.c line 1764
0x4021f220: ethernet_output at netif/ethernet.c line 312
0x402285c6: ip4_output_if_src at core/ipv4/ip4.c line 1590
0x4022912b: ip_chksum_pseudo at core/inet_chksum.c line 395
0x402235ec: udp_sendto_if_src at core/udp.c line 893
0x40223643: udp_sendto_if at core/udp.c line 692
0x402236dc: udp_sendto at core/udp.c line 599
0x402206ba: dns_send at core/dns.c line 850
0x4022079b: dns_check_entry at core/dns.c line 1096
0x40220cb1: dns_gethostbyname_addrtype at core/dns.c line 1502
Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address
PC: 0x4010565c
EXCVADDR: 0x00000003

Decoding stack results
0x40229040: mem_free at core/mem.c line 237
0x402226f4: tcp_input at core/tcp_in.c line 501
0x402282ce: ip4_input at core/ipv4/ip4.c line 1467
0x4021f195: ethernet_input_LWIP2 at netif/ethernet.c line 188
0x4021efb4: esp2glue_ethernet_input at glue-lwip/lwip-git.c line 469
0x402449ce: ethernet_input at glue-esp/lwip-esp.c line 365
0x402449df: ethernet_input at glue-esp/lwip-esp.c line 373
0x4021eb79: glue2esp_linkoutput at glue-esp/lwip-esp.c line 301
0x4021ee02: new_linkoutput at glue-lwip/lwip-git.c line 260
0x4021f220: ethernet_output at netif/ethernet.c line 312
0x4021eb79: glue2esp_linkoutput at glue-esp/lwip-esp.c line 301
0x4021ee02: new_linkoutput at glue-lwip/lwip-git.c line 260
0x4021f220: ethernet_output at netif/ethernet.c line 312
0x4022912b: ip_chksum_pseudo at core/inet_chksum.c line 395
0x40229020: mem_malloc at core/mem.c line 210
0x4021f275: do_memp_malloc_pool at core/memp.c line 255
0x4021f2b4: memp_malloc at core/memp.c line 356
0x40226ad7: etharp_query at core/ipv4/etharp.c line 1031
0x40223643: udp_sendto_if at core/udp.c line 692
0x40226c48: etharp_output_LWIP2 at core/ipv4/etharp.c line 890
0x402206ba: dns_send at core/dns.c line 850
0x40228530: ip4_output_if_opt_src at core/ipv4/ip4.c line 1764
0x4022079b: dns_check_entry at core/dns.c line 1096
0x402285c6: ip4_output_if_src at core/ipv4/ip4.c line 1590
0x4022912b: ip_chksum_pseudo at core/inet_chksum.c line 395
0x402235ec: udp_sendto_if_src at core/udp.c line 893
0x40223643: udp_sendto_if at core/udp.c line 692
0x402236dc: udp_sendto at core/udp.c line 599
SteMaker commented 4 years ago

Crash seems to occur here: https://github.com/SteMaker/wortuhr/blob/master/fw/src/main.cpp#L148.

SteMaker commented 4 years ago

There is a potential fix on branch add_locks_issues_7. I couldn't reproduce any longer, but was rarely able to reproduce anyway. @stan23 Can you retest with this change?

stan23 commented 4 years ago

Just tried it, 0 crashes out of 10 reboots. Without the fix it crashed 2 of 5 times.

SteMaker commented 4 years ago

Fixed with 06bdd98a2ad62b2d2af1609e76567b8c02e3f333