[Ovmsdev] nmc_list and ListConnections

Michael Balzer dexter at expeedo.de
Fri Jul 27 06:06:35 HKT 2018


That sure looks like a garbled stack, I doubt gdb will get any better info from this.

I also still see occasional crashes with nonsense backtraces from user modules. Example:

    balzer at leela:~/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3> a2l tmp/3.1.008-76-ga33b30e-elf/ovms3.elf 0x40081b9c 0x40081d5e 0x400db815 0x40091acb
    0x40083f65 0x400844e5 0x4000bec7 0x4015f57d 0x4017256a 0x4011da06 0x400e5da5 0x400e5f45 0x400e5fad 0x400e5fbd
    Using elf file: tmp/3.1.008-76-ga33b30e-elf/ovms3.elf
    0x40081b9c is at /home/balzer/esp/esp-idf/components/esp32/dport_panic_highint_hdl.S:189.
    184        movi    a0, _l4_intr_stack
    185        l32i    a2, a0, L4_INTR_A2_OFFSET
    186        l32i    a3, a0, L4_INTR_A3_OFFSET
    187        rsync                                   /* ensure register restored */
    188   
    189        rsr     a0, EXCSAVE_4                   /* restore a0 */
    190        rfi     4
    191   
    192    #endif // CONFIG_FREERTOS_UNICORE
    193   
    0x40081d5e is in esp_restart_noos (/home/balzer/esp/esp-idf/components/esp32/system_api.c:321).
    316        WRITE_PERI_REG(GPIO_FUNC3_IN_SEL_CFG_REG, 0x30);
    317        WRITE_PERI_REG(GPIO_FUNC4_IN_SEL_CFG_REG, 0x30);
    318        WRITE_PERI_REG(GPIO_FUNC5_IN_SEL_CFG_REG, 0x30);
    319   
    320        // Reset wifi/bluetooth/ethernet/sdio (bb/mac)
    321        DPORT_SET_PERI_REG_MASK(DPORT_CORE_RST_EN_REG,
    322             DPORT_BB_RST | DPORT_FE_RST | DPORT_MAC_RST |
    323             DPORT_BT_RST | DPORT_BTMAC_RST | DPORT_SDIO_RST |
    324             DPORT_SDIO_HOST_RST | DPORT_EMAC_RST | DPORT_MACPWR_RST |
    325             DPORT_RW_BTMAC_RST | DPORT_RW_BTLP_RST);
    0x400db815 is in ConsoleSSH::HandleDeviceEvent(void*)
    (/home/balzer/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/console_ssh/src/console_ssh.cpp:754).
    749                m_buffer[5] != ' ')
    750                msg.append("bad mode ").append(&m_buffer[1], 4).append("\n");
    751              else if ((m_size = strtoul(&m_buffer[6], &end, 10)) < 0 || m_size > 10485760 || *end++ != ' ')
    752                msg.append("size unacceptable: ").append(&m_buffer[6], end-&m_buffer[6]).append("\n");
    753              else if ((strchr(end, '/') != NULL) || (strcmp(end, "..") == 0))
    754                msg.append("unexpected filename: ").append(end).append("\n");
    755              else
    756                {
    757                level = m_dirs.front();
    758                m_path.resize(level.size);
    0x40091acb is in xTaskRemoveFromEventList (/home/balzer/esp/esp-idf/components/freertos/tasks.c:3167).
    3162        }
    3163   
    3164        if( xTaskCanBeReady )
    3165        {
    3166            ( void ) uxListRemove( &( pxUnblockedTCB->xGenericListItem ) );
    3167            prvAddTaskToReadyList( pxUnblockedTCB );
    3168        }
    3169        else
    3170        {
    3171            /* The delayed and ready lists cannot be accessed, so hold this task
    0x40083f65 is in psram_spi_init (/home/balzer/esp/esp-idf/components/esp32/spiram_psram.c:407).
    402        if (mode!=PSRAM_CACHE_F80M_S80M) {
    403            i = 1;      //Pre-divider
    404            k = 2;      //Main divider. Divide by 2 so we get 40MHz
    405             //clear bit 31, set SPI clock div
    406            CLEAR_PERI_REG_MASK(SPI_CLOCK_REG(spi_num), SPI_CLK_EQU_SYSCLK);
    407            WRITE_PERI_REG(SPI_CLOCK_REG(spi_num),
    408                    (((i - 1) & SPI_CLKDIV_PRE) << SPI_CLKDIV_PRE_S) |
    409                    (((k - 1) & SPI_CLKCNT_N) << SPI_CLKCNT_N_S) |
    410                    ((((k + 1) / 2 - 1) & SPI_CLKCNT_H) << SPI_CLKCNT_H_S) | //50% duty cycle
    411                    (((k - 1) & SPI_CLKCNT_L) << SPI_CLKCNT_L_S));
    0x400844e5 is in psram_enable (/home/balzer/esp/esp-idf/components/esp32/spiram_psram.c:599).
    594            SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_DATA2_U, FUN_DRV, 3, FUN_DRV_S);
    595            SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_DATA3_U, FUN_DRV, 3, FUN_DRV_S);
    596            SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CMD_U, FUN_DRV, 3, FUN_DRV_S);
    597            SET_PERI_REG_BITS(PERIPHS_IO_MUX_SD_CLK_U, FUN_DRV, 3, FUN_DRV_S);
    598            SET_PERI_REG_BITS(GPIO_PIN_MUX_REG[PSRAM_CS_IO], FUN_DRV, 3, FUN_DRV_S);
    599            SET_PERI_REG_BITS(GPIO_PIN_MUX_REG[PSRAM_CLK_IO], FUN_DRV, 3, FUN_DRV_S);
    600            #endif
    601        }
    602        uint32_t id;
    603        psram_read_id(&id);
    0x4015f57d is in xks_vin(int, OvmsWriter*, OvmsCommand*, int, char const* const*)
    (/home/balzer/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_kiasoulev/src/ks_commands.cpp:270).
    265            {
    266            writer->printf("Gwangju (Korea)\n");
    267            }
    268        else if(soul->m_vin[10]=='T')
    269            {
    270            writer->printf("Seosan (Korea)\n");
    271            }
    272        else
    273            {
    274            writer->printf("Unknown %c\n", soul->m_vin[10]);
    0x4017256a is in OvmsVehicleRenaultTwizy::SendGPSLog()
    (/home/balzer/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/vehicle_renaulttwizy/src/rt_notify.cpp:241).
    236        StdMetrics.ms_v_pos_longitude->IsModifiedAndClear(m_modifier) |
    237        StdMetrics.ms_v_pos_altitude->IsModifiedAndClear(m_modifier) |
    238        StdMetrics.ms_v_pos_direction->IsModifiedAndClear(m_modifier) |
    239        StdMetrics.ms_v_pos_gpsspeed->IsModifiedAndClear(m_modifier) |
    240        StdMetrics.ms_v_pos_speed->IsModifiedAndClear(m_modifier) |
    241        StdMetrics.ms_v_bat_power->IsModifiedAndClear(m_modifier) |
    242        StdMetrics.ms_v_bat_energy_used->IsModifiedAndClear(m_modifier) |
    243        StdMetrics.ms_v_bat_energy_recd->IsModifiedAndClear(m_modifier) |
    244        StdMetrics.ms_v_bat_current->IsModifiedAndClear(m_modifier) |
    245        StdMetrics.ms_v_bat_coulomb_used->IsModifiedAndClear(m_modifier) |
    0x4011da06 is in nvs_get<unsigned char>(nvs_handle, char const*, unsigned char*) (/home/balzer/esp/esp-idf/components/nvs_flash/src/nvs_storage.hpp:73).
    68        }
    69   
    70        template<typename T>
    71        esp_err_t readItem(uint8_t nsIndex, const char* key, T& value)
    72        {
    73            return readItem(nsIndex, itemTypeOf(value), key, &value, sizeof(value));
    74        }
    75   
    76        esp_err_t eraseItem(uint8_t nsIndex, const char* key)
    77        {
    0x400e5da5 is in esp_log_level_set (/home/balzer/esp/esp-idf/components/log/log.c:181).
    176    {
    177        while( !SLIST_EMPTY(&s_log_tags)) {
    178            SLIST_REMOVE_HEAD(&s_log_tags, entries );
    179        }
    180        s_log_cache_entry_count = 0;
    181        s_log_cache_max_generation = 0;
    182    #ifdef LOG_BUILTIN_CHECKS
    183        s_log_cache_misses = 0;
    184    #endif
    185    }
    0x400e5f45 is in ExternalRamRealloc (/home/balzer/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/ovms_malloc.c:67).
    62        heap_caps_free(ptr);
    63        return NULL;
    64        }
    65      void* ret = heap_caps_realloc(ptr, size, MALLOC_CAP_SPIRAM);
    66      if (ret)
    67        return ret;
    68      else
    69        return realloc(ptr, size);
    70      }
    71   
    0x400e5fad is in test_spiram(int, OvmsWriter*, OvmsCommand*, int, char const* const*)
    (/home/balzer/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/test_framework.cpp:238).
    233      writer->printf("Metrics (%p) are in %s RAM (%d bytes for a base metric)\n",
    234        StandardMetrics.ms_m_version,
    235        (((unsigned int)StandardMetrics.ms_m_version >= 0x3f800000)&&
    236         ((unsigned int)StandardMetrics.ms_m_version <= 0x3fbfffff))?
    237         "SPI":"INTERNAL",
    238         sizeof(OvmsMetric));
    239      }
    240   
    241    void test_strverscmp(int verbosity, OvmsWriter* writer, OvmsCommand* cmd, int argc, const char* const* argv)
    242      {
    0x400e5fbd is in test_chargen(int, OvmsWriter*, OvmsCommand*, int, char const* const*)
    (/home/balzer/esp/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/main/test_framework.cpp:124).
    119      {
    120      int numlines = 1000;
    121      int delay = 0;
    122      if (argc>=1)
    123        {
    124        numlines = atoi(argv[0]);
    125        }
    126      if (argc>=2)
    127        {
    128        delay = atoi(argv[1]);


…complete nonsense.

I also still get these:

3.1.008-76-ga33b30e/ota_0/edge (build idf v3.2-dev-168-g0fb2019f Jul 22 2018 21:45:28),1,Crash,8,14,1,0,IllegalInstruction,0,0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ,

…and these:

3.1.008-76-ga33b30e/ota_1/edge (build idf v3.2-dev-168-g0fb2019f Jul 22 2018 21:45:28),32,Crash,8,14,2,0,InstrFetchProhibited,1,0x00000000 0x00060730 0x8012afa0
0x3ffc05c0 0x3f804094 0x00000001 0x00000908 0x3f812dfc 0x3f81ec5c 0x00000091 0x800e9b1a 0x3ffc05a0 0x3f81ec5c 0x00000001 0x00000000 0x3ffc0668 0x00000000
0xff000000 0x0000001f 0x00000014 0x00000000 0x4009bad4 0x4009bb02 0x00000000 ,


I've got no idea about these.

Regards,
Michael


Am 26.07.2018 um 16:21 schrieb Mark Webb-Johnson:
> I am seeing quite a few crashes from my modules, like this:
>
>     # xtensa-esp32-elf-addr2line -pfiaC -e 3.1.008-76-ga33b30e.ovms3.elf 0x4008fac5 0x40090355 0x4008f23f 0x400914a1 0x40083e6a 0x4020c6b3 0x400f514d
>     0x400f69cb 0x400f6d95 0x400f705f 0x400f3cba 0x400eafe6 0x400eb035
>     0x4008fac5: uxPortCompareSet at /home/openvehicles/build/esp-idf/components/freertos/tasks.c:3564
>      (inlined by) vPortCPUAcquireMutexIntsDisabledInternal at /home/openvehicles/build/esp-idf/components/freertos/portmux_impl.inc.h:86
>      (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/openvehicles/build/esp-idf/components/freertos/portmux_impl.h:98
>      (inlined by) vTaskEnterCritical at /home/openvehicles/build/esp-idf/components/freertos/tasks.c:4267
>     0x40090355: xTaskIncrementTick at /home/openvehicles/build/esp-idf/components/freertos/tasks.c:3564
>     0x4008f23f: xPortSysTickHandler at /home/openvehicles/build/esp-idf/components/freertos/port.c:406
>     0x400914a1: _frxt_timer_int at /home/openvehicles/build/esp-idf/components/freertos/portasm.S:303
>     0x40083e6a: _xt_lowint1 at /home/openvehicles/build/esp-idf/components/freertos/xtensa_vectors.S:1105
>     0x4020c6b3: esp_vApplicationWaitiHook at /home/openvehicles/build/esp-idf/components/esp32/freertos_hooks.c:66
>     0x400f514d: mg_sock_addr_to_str at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400f69cb: mg_http_handler2 at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400f6d95: mg_mgr_handle_conn at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400f705f: mg_socket_if_poll at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400f3cba: mg_add_conn at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400eafe6: OvmsNetManager::ListConnections(int, OvmsWriter*) at
>     /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/main/ovms_netmanager.cpp:685
>     0x400eb035: OvmsNetManager::CloseConnection(unsigned int) at
>     /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/main/ovms_netmanager.cpp:702
>     [root at markhk8 edge]# xtensa-esp32-elf-addr2line -pfiaC -e 3.1.008-76-ga33b30e.ovms3.elf 0x400f6893 0x400f7edc 0x4011e623 0x4011e729 0x4011e9e2 0x400f8306
>     0x400f514d 0x400f69cb 0x400f6d95 0x400f705f 0x400f3cba 0x400eafe6 0x400eb035
>     0x400f6893: mg_http_handler2 at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400f7edc: mg_send_mqtt_handshake_opt at
>     /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x4011e623: OvmsServerV3::Ticker1(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void*) at
>     /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/ovms_server_v3/src/ovms_server_v3.cpp:841
>     0x4011e729: OvmsServerV3::IncomingPubRec(int) at
>     /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/ovms_server_v3/src/ovms_server_v3.cpp:488
>     0x4011e9e2: OvmsServerV3MongooseCallback(mg_connection*, int, void*) at
>     /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/ovms_server_v3/src/ovms_server_v3.cpp:66
>     0x400f8306: parse_mqtt at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>      (inlined by) mqtt_handler at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:10606
>     0x400f514d: mg_sock_addr_to_str at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400f69cb: mg_http_handler2 at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400f6d95: mg_mgr_handle_conn at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400f705f: mg_socket_if_poll at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400f3cba: mg_add_conn at /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/mongoose/mongoose/mongoose.c:1701
>     0x400eafe6: OvmsNetManager::ListConnections(int, OvmsWriter*) at
>     /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/main/ovms_netmanager.cpp:685
>     0x400eb035: OvmsNetManager::CloseConnection(unsigned int) at
>     /home/openvehicles/build/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/main/ovms_netmanager.cpp:702
>
>
> Apart from the massive stack, it seems very strange that we would be calling OvmsNetManager::ListConnections() and CloseConnection().
>
> I guess the stack is messed up, or this is some other remnant of a previous call?
>
> Any ideas?
>
> Mark
>

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

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


More information about the OvmsDev mailing list