StoreProhibited Error

cyberumut
Posts: 1
Joined: Thu May 26, 2022 1:13 pm

StoreProhibited Error

Postby cyberumut » Thu May 26, 2022 7:21 pm

  1. void testInt(void* self, int offset, int32_t val)
  2. {
  3.  
  4.   *(int32_t*)(((uint8_t*)self) + offset) = val;
  5.    
  6. }
  1. Guru Meditation Error: Core 0 panic'ed (StoreProhibited). Exception was unhandled.
  2.  
  3. Core 0 register dump:
  4. PC : 0x40152899 PS : 0x00060130 A0 : 0x800d4eb0 A1 : 0x3ffba940
  5. 0x40152899: setInt at /home/rootx/esp/umut/main/test.c:256
  6.  
  7. A2 : 0x00000008 A3 : 0x00000004 A4 : 0x00000010 A5 : 0x00000001
  8. A6 : 0x00000004 A7 : 0x3ffb6ee8 A8 : 0x00000077 A9 : 0x3ffba920
  9. A10 : 0x3ffbabb4 A11 : 0x00000000 A12 : 0x3ffb6f14 A13 : 0x00000000
  10. A14 : 0x00000004 A15 : 0x00000000 SAR : 0x0000000c EXCCAUSE: 0x0000001d
  11. EXCVADDR: 0x00000008 LBEG : 0x40089c08 LEND : 0x40089c24 LCOUNT : 0xffffffff
  12. 0x40089c08: memcpy at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/machine/xtensa/memcpy.S:175
  13.  
  14. 0x40089c24: memcpy at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/machine/xtensa/memcpy.S:197
my function falls into core panic why ?
maybe void *self null pointer return how to fix ?

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: StoreProhibited Error

Postby ESP_Sprite » Fri May 27, 2022 12:53 am

Without seeing what calls that testInt code, it's hard to say, but it looks like self is indeed NULL. You can tell by the EXCVADDR value, which reflects where the erroneous store was supposed to happen: it's 8 (so probaby self=NULL, offset=2) On how to fix it... erm... don't feed a null pointer to this function?

Who is online

Users browsing this forum: No registered users and 125 guests