Linker Bug?!?
Posted: Sat Jul 08, 2023 7:04 pm
LOTS of debugging of random crashes - boils down to this:
My Code:
When I do:
As you might expect - it tells me:
(Because 6x 32-bit "longs" of 4 bytes each should be 24 bytes total)
Problem was - when I was writing into indexes above "3" on this map, a buffer pointer started experiences corruption. So I look at the memory map and it tells me:
(i.e. rc_val is right before savebuf but they are only 12 bytes apart. i.e. When I write to rc_val[3] - it corrupts savebuf).
Is it my - or is this this a legit linker issue?!?!?!?!
My Code:
Code: Select all
#define RC_CHANNELS 6
unsigned long rc_val[RC_CHANNELS];Code: Select all
ESP_LOGE(TAG,"rc_val ptr is at %p size is %d",rc_val,sizeof(rc_val));Code: Select all
E (1972) CouchLED: rc_val ptr is at 0x3ffb2a84 size is 24Problem was - when I was writing into indexes above "3" on this map, a buffer pointer started experiences corruption. So I look at the memory map and it tells me:
Code: Select all
.bss.rc_val 0x000000003ffb2a84 0x2 esp-idf/neopixel/libneopixel.a(neopixel.c.obj)
0x000000003ffb2a84 rc_val
*fill* 0x000000003ffb2a86 0x2
.bss.used_channels
0x000000003ffb2a88 0x8 esp-idf/neopixel/libneopixel.a(neopixel.c.obj)
.bss.savebuf 0x000000003ffb2a90 0x4 esp-idf/neopixel/libneopixel.a(neopixel.c.obj)
.bss.neopixel_buffer
0x000000003ffb2a94 0x4 esp-idf/neopixel/libneopixel.a(neopixel.c.obj)Is it my - or is this this a legit linker issue?!?!?!?!