[Ovmsdev] v3 hardware disconnecting from v2 server

Mark Webb-Johnson mark at webb-johnson.net
Wed Jan 31 15:06:32 HKT 2018


> Hi Mark,
> 
> Cleaned the build stuff, leaving sdkconfig as it is, and there was no change in the crash or line #.
> Changed sdkconfig and re-cleaned and built, and now the crash is gone.
> 
> So, which of the sdkconfig changes did it?  Which would you like reverted?
> 
> Greg

Greg’s config differed from mine, and I gave the following recommendations:

> Clear CONFIG_FATFS_PER_FILE_CACHE (save memory)
> CONFIG_FREERTOS_USE_TRACE_FACILITY=y (needed for module memory command)
> CONFIG_HEAP_POISONING_LIGHT=y (needed for module memory command)
> CONFIG_HEAP_TASK_TRACKING=y (needed for module task command)


His crashes stopped when he set those options.

I just tried turning off CONFIG_HEAP_POISONING_LIGHT (and CONFIG_HEAP_TASK_TRACKING) and got a crash. Backtrace looks clean, and problem is related to deregistering the metrics listener:

Guru Meditation Error: Core  1 panic'ed (LoadProhibited)
. Exception was unhandled.
Register dump:
PC      : 0x4012892a  PS      : 0x00060e30  A0      : 0x80152a97  A1      : 0x3ffdb810
0x4012892a: OvmsMetrics::DeregisterListener(char const*) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_metrics.cpp:327

OvmsMetrics::DeregisterListener (this=0x3ffb7140 <MyMetrics>, caller=0x3f418acc "ovms-server-v2")
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_metrics.cpp:327
327	      if (ec->m_caller == caller)
(gdb) bt
#0  OvmsMetrics::DeregisterListener (this=0x3ffb7140 <MyMetrics>, caller=0x3f418acc "ovms-server-v2")
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_metrics.cpp:327
#1  0x40152a97 in OvmsServerV2::~OvmsServerV2 (this=0x3ffe2974, __in_chrg=<optimized out>)
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_server_v2/src/ovms_server_v2.cpp:1616
#2  0x40152b39 in OvmsServerV2::~OvmsServerV2 (this=0x3ffe2974, __in_chrg=<optimized out>)
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_server_v2/src/ovms_server_v2.cpp:1625
#3  0x4015206e in ovmsv2_stop (verbosity=65535, writer=<optimized out>, cmd=0x3ffc5894, argc=0, argv=0x0)
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_server_v2/src/ovms_server_v2.cpp:1659
#4  0x40122af1 in OvmsCommand::Execute (this=0x3ffc5894, verbosity=65535, writer=0x3ffd8638, argc=0, argv=0x0)
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:268
#5  0x40122be4 in OvmsCommand::Execute (this=0x3ffc57ac, verbosity=65535, writer=0x3ffd8638, argc=1, argv=0x3ffdb9c8)
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:313
#6  0x40122bd6 in OvmsCommand::Execute (this=0x3ffc5738, verbosity=65535, writer=0x3ffd8638, argc=2, argv=0x3ffdb9c8)
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:309
#7  0x40122bd6 in OvmsCommand::Execute (this=0x3ffb7068 <MyCommandApp+4>, verbosity=65535, writer=0x3ffd8638, argc=3, argv=0x3ffdb9c4)
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:309
#8  0x40122c0c in OvmsCommandApp::Execute (this=0x3ffb7064 <MyCommandApp>, verbosity=65535, writer=0x3ffd8638, argc=3, argv=0x3ffdb9c0)
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:641
#9  0x4012be0b in Execute (rl=0x3ffd864c, argc=3, argv=0x3ffdb9c0) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_shell.cpp:47
#10 0x4012ddec in new_line_handler (pThis=0x3ffd864c) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/microrl/./microrl.c:620
#11 0x4012de53 in microrl_insert_char (pThis=0x3ffd864c, ch=10) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/microrl/./microrl.c:668
#12 0x4012be82 in OvmsShell::ProcessChar (this=0x3ffd8638, c=<optimized out>) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_shell.cpp:70
#13 0x4012be99 in OvmsShell::ProcessChars (this=0x3ffd8638,
    buf=0x3ffd8df9 "pAt\300\363\266\330X\312Nz\273\350\210Z6\263\317\061uu)\av\251\312\336;\215\324\025\271\032y!Ņ\220\060\325A\255\317Lz\365\204\f2O[\263\336r\300\235\214V\365\352\341\235}\037\212\366\350i1_\034遽͎\326h<\246\025\301\b\367\313\\Y\005Ź\300r6\217\213G`\030\364Ax$\n\242\255\v\211\365\071~\350\315\324[/\316\367+\227\226=\332\f\343\020\001\221\325p\375\v\375\231)\353ְ\027yu\260\037W3x\020\060/V\374\355\004Y[\273\316SU\205\265\366/\001\323?\307\353\\ \237\211\260ğЃ84E \032\274\303q3F+\353\343\346\324\327\027\"Enk\002\206", <incomplete sequence \371>..., len=1)
    at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_shell.cpp:77
#14 0x40120f54 in ConsoleAsync::HandleDeviceEvent (this=0x3ffd8638, pEvent=<optimized out>) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./console_async.cpp:169
#15 0x40125754 in OvmsConsole::Poll (this=0x3ffd8638, ticks=4294967295, queue=0x3ffd94b0) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_console.cpp:150
#16 0x4012594c in OvmsConsole::Service (this=0x3ffd8638) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_console.cpp:130
#17 0x40120df8 in ConsoleAsync::Service (this=0x3ffd8638) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./console_async.cpp:80
#18 0x40120e07 in non-virtual thunk to ConsoleAsync::Service() ()
#19 0x4012cc80 in TaskBase::Task (object=0x3ffd8de4) at /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./task_base.cpp:156

(gdb) p ec
$1 = (MetricCallbackEntry *) 0xe3ffe32
(gdb) p *ec
$2 = {_vptr$MetricCallbackEntry = 0xffffffff, m_caller = 0xffffffff '\377' <repeats 200 times>...,
  m_callback = {<std::_Maybe_unary_or_binary_function<void, OvmsMetric*>> = {<std::unary_function<OvmsMetric*, void>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {
      static _M_max_size = 8, static _M_max_align = 4, _M_functor = {_M_unused = {_M_object = 0xffffffff, _M_const_object = 0xffffffff, _M_function_pointer = 0xffffffff,
          _M_member_pointer = &virtual table offset -2, this adjustment -1}, _M_pod_data = "\377\377\377\377\377\377\377\377"}, _M_manager = 0xffffffff}, _M_invoker = 0xffffffff}}
(gdb) p *ml
$3 = {<std::__cxx11::_List_base<MetricCallbackEntry*, std::allocator<MetricCallbackEntry*> >> = {
    _M_impl = {<std::allocator<std::_List_node<MetricCallbackEntry*> >> = {<__gnu_cxx::new_allocator<std::_List_node<MetricCallbackEntry*> >> = {<No data fields>}, <No data fields>},
      _M_node = {<std::__detail::_List_node_base> = {_M_next = 0x3ffe3fd4, _M_prev = 0x3ffe3fd4}, _M_data = 0}}}, <No data fields>}

I’m rushing around at the moment, trying to get the hardware finalised, so don’t have a lot of time to work on it.

As a workaround, @Tom please turn on CONFIG_FREERTOS_USE_TRACE_FACILITY, CONFIG_HEAP_POISONING_LIGHT and CONFIG_HEAP_TASK_TRACKING, and see if that works for you. Those settings will also give you the ‘module memory’ and ‘module tasks’ commands (which developers certainly need).

Regards, Mark.

> On 31 Jan 2018, at 1:38 PM, Greg D. <gregd2350 at gmail.com> wrote:
> 
> Sent direct.
> 
> Greg
> 
> 
> Mark Webb-Johnson wrote:
>> Something weird going on here:
>> 
>>> 0x401222ee: OvmsMetrics::DeregisterListener(char const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_metrics.cpp:299
>> My line 299 of ovms_metrics.cpp is the ending curly brace on OvmsMetrics::InitFloat. A good 20+ lines above DeregisterListener (which starts at line 319).
>> 
>> Can you send me your ovms_metrics.cpp and sdkconfig?
>> 
>> Regards, Mark.
>> 
>>> On 31 Jan 2018, at 1:20 PM, Greg D. <gregd2350 at gmail.com> wrote:
>>> 
>>> Crashes here, without fail (2 out of 2 tries).  Latest bits from
>>> Master.  I had log level set to verbose.
>>> 
>>> Greg
>>> 
>>> OVMS > server v2 status
>>> OVMS V2 login successful, and crypto channel established
>>> OVMS > server v2 stop
>>> Stopping OVMS Server V2 connection (oscv2)
>>> Guru Meditation Error: Core  1 panic'ed (LoadProhibited)
>>> . Exception was unhandled.
>>> Register dump:
>>> PC      : 0x401222ee  PS      : 0x00060830  A0      : 0x8014dac3 
>>> A1      : 0x3ffdf310 
>>> 0x401222ee: OvmsMetrics::DeregisterListener(char const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_metrics.cpp:299
>>> 
>>> A2      : 0x3ffe9474  A3      : 0x3f417638  A4      : 0x3ffe3fe8 
>>> A5      : 0x951ac700 
>>> A6      : 0x3ffe88ec  A7      : 0x3ffe88ec  A8      : 0x80122305 
>>> A9      : 0x3ffdf2f0 
>>> A10     : 0x3ffe92bc  A11     : 0x3ffe92e8  A12     : 0x3ffdf330 
>>> A13     : 0x3ffae8d8 
>>> A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x00000008 
>>> EXCCAUSE: 0x0000001c 
>>> EXCVADDR: 0x951ac704  LBEG    : 0x400014fd  LEND    : 0x4000150d 
>>> LCOUNT  : 0xfffffff5 
>>> 
>>> Backtrace: 0x401222ee:0x3ffdf310 0x4014dac0:0x3ffdf340
>>> 0x4014db62:0x3ffdf380 0x4014d0df:0x3ffdf3a0 0x401273d6:0x3ffdf3c0
>>> 0x401274c9:0x3ffdf3f0 0x401274bb:0x3ffdf420 0x401274bb:0x3ffdf450
>>> 0x401274f1:0x3ffdf480 0x4011e894:0x3ffdf4a0 0x40129af5:0x3ffdf4c0
>>> 0x40129b5c:0x3ffdf520 0x4011e90b:0x3ffdf560 0x4011e922:0x3ffdf580
>>> 0x40128855:0x3ffdf5a0 0x40124ac5:0x3ffdf5d0 0x40124cbd:0x3ffdf600
>>> 0x401286fd:0x3ffdf620 0x4012870c:0x3ffdf640 0x4011ddbd:0x3ffdf660
>>> 0x401222ee: OvmsMetrics::DeregisterListener(char const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_metrics.cpp:299
>>> 
>>> 0x4014dac0: OvmsServerV2::~OvmsServerV2() at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_server_v2/src/ovms_server_v2.cpp:1616
>>> 
>>> 0x4014db62: OvmsServerV2::~OvmsServerV2() at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_server_v2/src/ovms_server_v2.cpp:1625
>>> 
>>> 0x4014d0df: ovmsv2_stop(int, OvmsWriter*, OvmsCommand*, int, char const*
>>> const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_server_v2/src/ovms_server_v2.cpp:1659
>>> (discriminator 1)
>>> 
>>> 0x401273d6: OvmsCommand::Execute(int, OvmsWriter*, int, char const*
>>> const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:83
>>> 
>>> 0x401274c9: OvmsCommand::Execute(int, OvmsWriter*, int, char const*
>>> const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:83
>>> 
>>> 0x401274bb: OvmsCommand::Execute(int, OvmsWriter*, int, char const*
>>> const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:83
>>> 
>>> 0x401274bb: OvmsCommand::Execute(int, OvmsWriter*, int, char const*
>>> const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:83
>>> 
>>> 0x401274f1: OvmsCommandApp::Execute(int, OvmsWriter*, int, char const*
>>> const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_command.cpp:83
>>> 
>>> 0x4011e894: Execute(microrl*, int, char const* const*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_shell.cpp:47
>>> 
>>> 0x40129af5: new_line_handler at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/microrl/./microrl.c:620
>>> 
>>> 0x40129b5c: microrl_insert_char at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/microrl/./microrl.c:668
>>> 
>>> 0x4011e90b: OvmsShell::ProcessChar(char) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_shell.cpp:70
>>> 
>>> 0x4011e922: OvmsShell::ProcessChars(char const*, int) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_shell.cpp:77
>>> (discriminator 2)
>>> 
>>> 0x40128855: ConsoleAsync::HandleDeviceEvent(void*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./console_async.cpp:169
>>> 
>>> 0x40124ac5: OvmsConsole::Poll(unsigned int, void*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_console.cpp:150
>>> 
>>> 0x40124cbd: OvmsConsole::Service() at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./ovms_console.cpp:130
>>> (discriminator 1)
>>> 
>>> 0x401286fd: ConsoleAsync::Service() at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./console_async.cpp:80
>>> 
>>> 0x4012870c: non-virtual thunk to ConsoleAsync::Service() at ??:?
>>> 
>>> 0x4011ddbd: TaskBase::Task(void*) at
>>> /home/greg/greg/ovms/Open-Vehicle-Monitoring-System-3-master/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/./task_base.cpp:156
>>> 
>>> 
>>> Rebooting...
>>> 
>>> 
>>> 
>>> Mark Webb-Johnson wrote:
>>>>> Stopping the v2 server causes a panic even when it has connected
>>>>> right after boot. The below stack trace is from current master.
>>>>> Looking at the code where it panics, it seems like the
>>>>> MetricCallbackList is corrupted somehow.
>>>> Trying to repeat this, but can’t. Here is what I get:
>>> _______________________________________________
>>> OvmsDev mailing list
>>> OvmsDev at lists.teslaclub.hk
>>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at lists.teslaclub.hk
>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20180131/ecba1721/attachment.htm>


More information about the OvmsDev mailing list