Fix “Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited)”
The ESP32 jumped to an address with no code — usually a null function pointer or callback, a deleted object, or a stack overflow that trashed a return address.
Community draft — report a mistake
What you see
Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x00000000 PS : 0x00060230 A0 : 0x800d1f3a A1 : 0x3ffb2200
A2 : 0x3ffc1a40 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x00000000
...
EXCVADDR: 0x00000000
Backtrace: 0xfffffffd:0x3ffb2200 0x400d1f37:0x3ffb2220 0x400d8a1d:0x3ffb2240 0x4008a2f6:0x3ffb2260
ELF file SHA256: 4f0d9a1b7c2e3856
Rebooting...Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled. Core 1 register dump: PC : 0x00000000 PS : 0x00060230 A0 : 0x800d1f3a A1 : 0x3ffb2200 A2 : 0x3ffc1a40 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x00000000 ... EXCVADDR: 0x00000000 Backtrace: 0xfffffffd:0x3ffb2200 0x400d1f37:0x3ffb2220 0x400d8a1d:0x3ffb2240 0x4008a2f6:0x3ffb2260 ELF file SHA256: 4f0d9a1b7c2e3856 Rebooting...
InstrFetchProhibited means the ESP32 was told to run code at an address where none exists. The register dump’s PC shows that address, and when it reads 0x00000000 the cause is nearly always a function pointer or callback that was never set.
Decode the backtrace entry just after the bad address to find the caller, then check what it called. For the data-side equivalent, see LoadProhibited.
Quick fix — try in order
- 1
PC = 0x00000000? Find the null callback
A function pointer that was never set (an onReceive handler, a menu table entry, a std::function) was called. Check every callback is assigned before the code that triggers it runs.
- 2
Decode the second backtrace entry
The first entry is the bad address itself. The next one (0x400d1f37 above) is the code that made the call — decode it with the ESP Exception Decoder or addr2line.
- 3
Look for use-after-delete
Calling a method on an object that was deleted, or on a pointer that was never created with new, jumps through a garbage vtable. Initialise pointers to nullptr and check them.
- 4
Give tasks enough stack
A FreeRTOS task with a small stack (xTaskCreate with 1024–2048 bytes) that uses Serial.printf, String or Wi-Fi overflows and corrupts its return address. Start with 4096–8192 bytes.
Why it happens
What does InstrFetchProhibited mean?
The CPU tried to fetch its next instruction from an address that isn't executable memory. PC shows where it tried to go — 0x00000000 almost always means a null function pointer.
Virtual methods in a class
Calling a pure virtual function from a constructor or destructor, or on a partly constructed global object, also lands on address 0.
EXCVADDR
For this exception EXCVADDR repeats the address that couldn't be fetched. If it is an odd value like 0x3ffb… (a RAM address), the stack was corrupted.
Board-specific notes
ESP32-CAM: Camera callbacks used after esp_camera_deinit() are a common source. Re-initialise the camera before using it again.
Did this fix it?
Thanks — that helps us keep this page right.