Skip to content

exception.what() not a string #8716

Closed
Closed
@mhightower83

Description

@mhightower83

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-01S]
  • Core Version: [80bf716]
  • Development Env: [Arduino IDE]
  • Operating System: [Ubuntu]

Settings in IDE

  • Module: [Generic ESP8266 Module]
  • Flash Mode: [dout]
  • Flash Size: [1MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [nodemcu]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [921600 (serial upload only)

Problem Description

For the case of a missing try/catch around new, a secondary crash within postmortem occurs while processing the unhandled C++ Exception.

The second crash is caused when e.what() returns a value of 0x12.

__unhandled_exception( e.what() );

resulting in a new ESP exception in postmortem at
ets_printf_P(PSTR("\nUnhandled C++ exception: %S\n"), s_unhandled_exception);

MCVE Sketch

/*
   Build with Tools->C++ Exceptions: "enable"
*/
char *p = NULL;

void setup() {
  Serial.begin(115200);
  delay(100);
  Serial.printf("\nUp and running ...\n");

  // loops - crashing in postmortem
  p = new char[128000];

  if (p) {
    Serial.printf("\n%p, \"new\" worked, it should not have!\n", p);
  }
}

void loop() {}

Debug Messages

Up and running ...

User exception (panic/abort/assert)
--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions