Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

InstrFetchProhibited/IllegalInstruction on X509 cert verification #861

Copy link
Copy link
Closed
@tedder

Description

@tedder
Issue body actions

Hardware:

Board: Sparkfun dev board, DOIT kit
Core Installation/update date: 10 Nov 2017
IDE name: Arduino IDE
Flash Frequency: 80Mhz
Upload Speed: 115200, 921600

libraries

Description:

X509 certificate connections crash the board with InstrFetchProhibited (sparkfun) or IllegalInstruction (DOIT). It seems maybe this is a cross-core communication issue, given that wifi is on core0 and the code runs on core1?

I'm not confident with opening this here nor in Pubsubclient, but I think it fits here much better.

I don't think it's a WDT issue, based on the trace.

Noting #657, as shown in the commit above it isn't the small mem/stack issue in there, also noting pubsubclient #84. Both are similar but I don't think they have the same root cause.

Sketch:

Snippet. I can give a full example if it helps.

    espClient.setCertificate(__9a4_public_bin_key);
    espClient.setPrivateKey(__9a4private_bin_key);
    client.setServer(mqtt_server, 8883);


  while (!client.connected()) {
    Serial.println("Attempting MQTT connection...");
    // Create a random client ID
    String clientId = "ESP32Client-";
    clientId += String(random(0xffff), HEX);
    Serial.print("clientid: ");
    Serial.println(clientId.c_str());
    // Attempt to connect
    if (client.connect(clientId.c_str())) { // crashes here (this is line 65)

Debug Messages:

Sparkfun doesn't have the debug menu, but the DOIT does. However I didn't see any more debugging in the logs even with "core debug level=debug".

errors

first, the decoded exception:

Decoding 8 results
0x400d2120: PubSubClient::readPacket(unsigned char*) at /Users/ted/Documents/Arduino/libraries/pubsubclientdiegopx/src/PubSubClient.cpp line 706
0x400d23a8: PubSubClient::connect(char const*, char const*, char const*, char const*, unsigned char, bool, char const*) at /Users/ted/Documents/Arduino/libraries/pubsubclientdiegopx/src/PubSubClient.cpp line 706
0x400d2436: PubSubClient::connect(char const*) at /Users/ted/Documents/Arduino/libraries/pubsubclientdiegopx/src/PubSubClient.cpp line 706
0x400d1e8b: reconnect() at /Users/ted/Documents/Arduino/esp32_mqtt/esp32_mqtt.ino line 65
0x400d1feb: loop() at /Users/ted/Documents/Arduino/esp32_mqtt/esp32_mqtt.ino line 151
0x40134e5c: loopTask(void*) at /Applications/Arduino_183.app/Contents/Java/hardware/espressif/esp32/cores/esp32/main.cpp line 18 (discriminator 1)

and the guru exception:

Guru Meditation Error of type InstrFetchProhibited occurred on core  1. Exception was unhandled.
Register dump:
PC      : 0x0d2dfc40  PS      : 0x00060430  A0      : 0x800d2123  A1      : 0x3ffd5c10  
A2      : 0x3ffc32e8  A3      : 0x3ffd5c32  A4      : 0x0d2dfc40  A5      : 0x000031af  
A6      : 0x3f401079  A7      : 0x3f401c03  A8      : 0x800d20c9  A9      : 0x3ffd5bf0  
A10     : 0x3ffc33a4  A11     : 0x3ffc32ec  A12     : 0xffff877f  A13     : 0x000031af  
A14     : 0x3f401079  A15     : 0x0000001d  SAR     : 0x00000008  EXCCAUSE: 0x00000014  
EXCVADDR: 0x0d2dfc40  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0x00000000  

Backtrace: 0x0d2dfc40:0x3ffd5c10 0x400d2120:0x3ffd5c30 0x400d23a8:0x3ffd5c70 0x400d2436:0x3ffd5cb0 0x400d1e8b:0x3ffd5ce0 0x400d1feb:0x3ffd5d20 0x40134e5c:0x3ffd5d60

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)Issue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.