[Ovmsdev] MDNS crash

Michael Balzer dexter at expeedo.de
Mon Mar 19 06:19:10 HKT 2018


From a first look at the mdns code in your backtrace, I would guess that's a double free() for the timer, it seems the timer_handle never gets NULLed.

Regards,
Michael


Am 18.03.2018 um 20:59 schrieb Stephen Casner:
> The crash below occurred right upon startup.  I have not done anything
> with the auto start mechanism yet; I just have a script that starts
> wifi in client mode.  I did not dig into this, and after a reset it
> did not repeat.  I have not done more tests.
>
>                                                         -- Steve
>
>
> I (39) ovms_main: Set default logging level for * to WARN
> W (744) esp32wifi: AutoInit: using module password as AP password
>
> Welcome to the Open Vehicle Monitoring System (OVMS) - Async Console
> OVMS > CORRUPT HEAP: Bad head at 0x3ffec1f0. Expected 0xabba1234 got 0x3ffec2c8
> assertion "head != NULL" failed: file "/Users/casner/src/github/esp-idf/components/heap/./multi_heap_poisoning.c", line 201, function: multi_heap_free
> abort() was called at PC 0x400fb243 on core 1
> 0x400fb243: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
>
>
> Backtrace: 0x4008f5d4:0x3ffeb990 0x4008f777:0x3ffeb9b0 0x400fb243:0x3ffeb9d0 0x4008f235:0x3ffeba00 0x40082712:0x3ffeba20 0x40082ca1:0x3ffeba40 0x4000bec7:0x3ffeba60 0x400dbeb9:0x3ffeba80 0x401f2105:0x3ffebaa0 0x401f212b:0x3ffebac0 0x401f4c9c:0x3ffebb00 0x401167eb:0x3ffebb30 0x4011681d:0x3ffebb50 0x40116c3c:0x3ffebb70 0x400e88a9:0x3ffebbb0 0x400e8b45:0x3ffebbe0 0x400ed570:0x3ffebc70 0x400ed591:0x3ffebcc0
> 0x4008f5d4: invoke_abort at /Users/casner/src/github/esp-idf/components/esp32/./panic.c:648
>
> 0x4008f777: abort at /Users/casner/src/github/esp-idf/components/esp32/./panic.c:648
>
> 0x400fb243: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
>
> 0x4008f235: multi_heap_free at /Users/casner/src/github/esp-idf/components/heap/./multi_heap_poisoning.c:326
>
> 0x40082712: heap_caps_free at /Users/casner/src/github/esp-idf/components/heap/./heap_caps.c:388
>
> 0x40082ca1: _free_r at /Users/casner/src/github/esp-idf/components/newlib/./syscalls.c:42
>
> 0x400dbeb9: esp_timer_delete at /Users/casner/src/github/esp-idf/components/esp32/./esp_timer.c:162
>
> 0x401f2105: _mdns_stop_timer at /Users/casner/src/github/esp-idf/components/mdns/./mdns.c:4510
>
> 0x401f212b: _mdns_service_task_stop at /Users/casner/src/github/esp-idf/components/mdns/./mdns.c:4510
>
> 0x401f4c9c: mdns_free at /Users/casner/src/github/esp-idf/components/mdns/./mdns.c:4185
>
> 0x401167eb: OvmsMDNS::StopMDNS() at /Users/casner/src/github/ovms/vehicle/OVMS.V3/components/ovms_mdns/src/ovms_mdns.cpp:111
>
> 0x4011681d: OvmsMDNS::NetworkDown(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*) at /Users/casner/src/github/ovms/vehicle/OVMS.V3/components/ovms_mdns/src/ovms_mdns.cpp:64
>
> 0x40116c3c: void std::_Mem_fn_base<void (OvmsMDNS::*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*), true>::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*, void>(OvmsMDNS*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&) const at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:600
>  (inlined by) void std::_Bind<std::_Mem_fn<void (OvmsMDNS::*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*)> (OvmsMDNS*, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&, 0u, 1u, 2u>(std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&>&&, std::_Index_tuple<0u, 1u, 2u>) at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:1074
>  (inlined by) void std::_Bind<std::_Mem_fn<void (OvmsMDNS::*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*)> (OvmsMDNS*, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*, void>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&) at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:1133
>  (inlined by) std::_Function_handler<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*), std::_Bind<std::_Mem_fn<void (OvmsMDNS::*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*)> (OvmsMDNS*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&) at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:1871
>
> 0x400e88a9: std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*)>::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*) const at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:2271
>
> 0x400e8b45: OvmsEvents::SignalEvent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*) at /Users/casner/src/github/ovms/vehicle/OVMS.V3/main/./ovms_events.cpp:155
>
> 0x400ed570: OvmsNetManager::MongooseTask() at /Users/casner/src/github/ovms/vehicle/OVMS.V3/main/./ovms_netmanager.cpp:322
>
> 0x400ed591: MongooseRawTask(void*) at /Users/casner/src/github/ovms/vehicle/OVMS.V3/main/./ovms_netmanager.cpp:306
>
>
> Entering gdb stub now.
> $T0b#e6GNU gdb (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 7.10
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=x86_64-build_apple-darwin16.3.0 --target=xtensa-esp32-elf".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from /Users/casner/src/github/ovms/vehicle/OVMS.V3/build/ovms3.elf...done.
> Remote debugging using /dev/cu.SLAB_USBtoUART
> 0x4008f5d4 in invoke_abort () at /Users/casner/src/github/esp-idf/components/esp32/./panic.c:139
> 139	        *((int *) 0) = 0;
> (gdb) bt
> #0  0x4008f5d4 in invoke_abort () at /Users/casner/src/github/esp-idf/components/esp32/./panic.c:139
> #1  0x4008f77a in abort () at /Users/casner/src/github/esp-idf/components/esp32/./panic.c:148
> #2  0x400fb246 in __assert_func (
>     file=0x3ffb3730 "/Users/casner/src/github/esp-idf/components/heap/./multi_heap_poisoning.c", line=201,
>     func=<optimized out>, failedexpr=0x3ffb3720 "head != NULL") at ../../../.././newlib/libc/stdlib/assert.c:63
> #3  0x4008f238 in multi_heap_free (heap=0x3ffe4350, p=0x3ffec1fc)
>     at /Users/casner/src/github/esp-idf/components/heap/./multi_heap_poisoning.c:201
> #4  0x40082715 in heap_caps_free (ptr=0x3ffec1fc) at /Users/casner/src/github/esp-idf/components/heap/./heap_caps.c:262
> #5  0x40082ca4 in _free_r (r=0x3ffebdd4, ptr=0x3ffec1fc)
>     at /Users/casner/src/github/esp-idf/components/newlib/./syscalls.c:42
> #6  0x4000beca in ?? ()
> #7  0x400dbebc in esp_timer_delete (timer=0x3ffec1fc)
>     at /Users/casner/src/github/esp-idf/components/esp32/./esp_timer.c:162
> #8  0x401f2108 in _mdns_stop_timer () at /Users/casner/src/github/esp-idf/components/mdns/./mdns.c:4032
> #9  0x401f212e in _mdns_service_task_stop () at /Users/casner/src/github/esp-idf/components/mdns/./mdns.c:4081
> #10 0x401f4c9f in mdns_free () at /Users/casner/src/github/esp-idf/components/mdns/./mdns.c:4185
> #11 0x401167ee in OvmsMDNS::StopMDNS (this=0x3ffb45c8 <MyMDNS>)
>     at /Users/casner/src/github/ovms/vehicle/OVMS.V3/components/ovms_mdns/src/ovms_mdns.cpp:111
> #12 0x40116820 in OvmsMDNS::NetworkDown (this=0x3ffb45c8 <MyMDNS>, event=..., data=0x0)
>     at /Users/casner/src/github/ovms/vehicle/OVMS.V3/components/ovms_mdns/src/ovms_mdns.cpp:64
> #13 0x40116c3f in std::_Mem_fn_base<void (OvmsMDNS::*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*), true>::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*, void>(OvmsMDNS*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&) const (__object=<optimized out>, this=<optimized out>)
>     at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:600
> #14 std::_Bind<std::_Mem_fn<void (OvmsMDNS::*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*)> (OvmsMDNS*, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&, 0u, 1u, 2u>(std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&>&&, std::_Index_tuple<0u, 1u, 2u>) (
>     __args=<unknown type in /Users/casner/src/github/ovms/vehicle/OVMS.V3/build/ovms3.elf, CU 0x2f4c41, DIE 0x3048f6>,
>     this=<optimized out>)
>     at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:1074
> #15 std::_Bind<std::_Mem_fn<void (OvmsMDNS::*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*)> (OvmsMDNS*, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*, void>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&) (this=<optimized out>)
>     at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:1133
> #16 std::_Function_handler<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*), std::_Bind<std::_Mem_fn<void (OvmsMDNS::*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*)> (OvmsMDNS*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, void*&&) (__functor=..., __args#0=<optimized out>,
>     __args#1=<optimized out>)
>     at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:1871
> #17 0x400e88ac in std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*)>::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*) const (
>     this=0x3ffcaef0, __args#0=..., __args#1=0x0)
>     at /Users/casner/src/github/esp-idf/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:2271
> #18 0x400e8b48 in OvmsEvents::SignalEvent (this=0x3ffb4290 <MyEvents>, event=..., data=0x0)
>     at /Users/casner/src/github/ovms/vehicle/OVMS.V3/main/./ovms_events.cpp:155
> #19 0x400ed573 in OvmsNetManager::MongooseTask (this=0x3ffb4314 <MyNetManager>)
> ---Type <return> to continue, or q <return> to quit---
>     at /Users/casner/src/github/ovms/vehicle/OVMS.V3/main/./ovms_netmanager.cpp:322
> #20 0x400ed594 in MongooseRawTask (pvParameters=0x3ffb4314 <MyNetManager>)
>     at /Users/casner/src/github/ovms/vehicle/OVMS.V3/main/./ovms_netmanager.cpp:306
> (gdb)
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26





More information about the OvmsDev mailing list