You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Code fails to compile when Debug Level is set to OOM. The errors are embedded below. Error 1
Note: Error in expansion of realloc and malloc macros
In file included from /Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Arduino.h:307:0,
from /var/folders/f8/2_2p327x6sz15httt766r7c00000gn/T/arduino_build_602235/sketch/sketch_oct27a.ino.cpp:1:
/Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc_cfg.h:183:43: error: mem_debug_file causes a section type conflict with mem_debug_file
#definerealloc(p,s) ({ staticconstchar mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; realloc_loc(p, s, mem_debug_file, __LINE__); })
^
/Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/include/mem.h:45:20: note: in expansion of macro 'realloc'
#defineos_realloc realloc
^
/Users/rushikesh/Documents/Arduino/sketch_oct27a/sketch_oct27a.ino:15:16: note: in expansion of macro 'os_realloc'
temp = (char*)os_realloc(buffer,2000);
^
In file included from /Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Arduino.h:307:0,
from /var/folders/f8/2_2p327x6sz15httt766r7c00000gn/T/arduino_build_602235/sketch/sketch_oct27a.ino.cpp:1:
/Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc_cfg.h:181:40: note: 'mem_debug_file' was declared here
#definemalloc(s) ({ staticconstchar mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; malloc_loc(s, mem_debug_file, __LINE__); })
^
/Users/rushikesh/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/DynamicJsonBuffer.hpp:26:12: note: in expansion of macro 'malloc'return malloc(size);
^
Error 2 If both os_realloc and os_malloc calls are removed, the below error is thrown.
Note: Error in FPSTR and PSTR also.
/Users/rushikesh/Documents/Arduino/sketch_oct27a/sketch_oct27a.ino: In function 'void foo()':
/Users/rushikesh/Documents/Arduino/sketch_oct27a/sketch_oct27a.ino:16:2: warning: 'temp' is used uninitialized in this function [-Wuninitialized]
if(temp==NULL) os_free(buffer);
^
/Users/rushikesh/Documents/Arduino/sketch_oct27a/sketch_oct27a.ino:16:32: warning: 'buffer' may be used uninitialized in this function [-Wmaybe-uninitialized]
if(temp==NULL) os_free(buffer);
^
In file included from /Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Arduino.h:259:0,
from /var/folders/f8/2_2p327x6sz15httt766r7c00000gn/T/arduino_build_602235/sketch/sketch_oct27a.ino.cpp:1:
/Users/rushikesh/Documents/Arduino/sketch_oct27a/sketch_oct27a.ino: At global scope:
/Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/pgmspace.h:16:51: error: __c causes a section type conflict with mem_debug_file
#definePSTR(s) (__extension__({staticconstchar __c[] PROGMEM = (s); &__c[0];}))
^
/Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.h:38:76: note: in definition of macro 'FPSTR'
#defineFPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
^
/Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.h:39:34: note: in expansion of macro 'PSTR'
#defineF(string_literal) (FPSTR(PSTR(string_literal)))
^
/Users/rushikesh/Documents/Arduino/sketch_oct27a/sketch_oct27a.ino:6:17: note: in expansion of macro 'F'
Serial.println(F("Flash string"));
^
In file included from /Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Arduino.h:307:0,
from /var/folders/f8/2_2p327x6sz15httt766r7c00000gn/T/arduino_build_602235/sketch/sketch_oct27a.ino.cpp:1:
/Users/rushikesh/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc_cfg.h:181:40: note: 'mem_debug_file' was declared here
#definemalloc(s) ({ staticconstchar mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; malloc_loc(s, mem_debug_file, __LINE__); })
^
/Users/rushikesh/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/DynamicJsonBuffer.hpp:26:12: note: in expansion of macro 'malloc'return malloc(size);
^
Note: Compilation will be successful if DyanamicJsonBuffer's object is not created
Thanks, @luffykesh. It's been isolated in #5036 with a 1-line MCVE, believe it or not. There's a temporary workaround there, if you're stuck right now.
Basic Infos
Platform
Settings in IDE
Problem Description
The Code fails to compile when Debug Level is set to OOM. The errors are embedded below.
Error 1
Note: Error in expansion of
realloc
andmalloc
macrosError 2
If both
os_realloc
andos_malloc
calls are removed, the below error is thrown.Note: Error in
FPSTR
andPSTR
also.Note: Compilation will be successful if DyanamicJsonBuffer's object is not created
MCVE Sketch
The text was updated successfully, but these errors were encountered: