Arduino: Compile/Upload failure when using some debug features in 2.4.2 ONLY

Created on 13 Aug 2018  路  5Comments  路  Source: esp8266/Arduino

Basic Infos

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

Platform

  • Hardware: [ESP-8266]
  • Core Version: [2.4.2]
  • Development Env: [Arduino IDE]
  • Operating System: [Ubuntu]

Settings in IDE

  • Module: [Adafruit Feather Huzzah]
  • Flash Mode: [?]
  • Flash Size: [4MB/1MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [?]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [921600]

Problem Description

When using some debug systems (like Core or OOM) the sketch refuses to compile/upload, most likely due to a conflict with ESP8266mDNS in Arduino OTA.

Is there any other way debugging could be done? I included the minimal code that still reproduces the problem.

Is it just my configuration or an actual bug?

MCVE Sketch

#include <ArduinoOTA.h>


void setup() {
}
void loop() {

}

Debug Messages

Arduino: 1.8.5 (Linux), Board: "Adafruit Feather HUZZAH ESP8266, 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Serial, SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM, Only Sketch, 921600"

/home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/arduino-builder -dump-prefs -logger=machine -hardware /home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/hardware -hardware /home/simon/.arduino15/packages -tools /home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/tools-builder -tools /home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/hardware/tools/avr -tools /home/simon/.arduino15/packages -built-in-libraries /home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/libraries -libraries /home/simon/Arduino/libraries -fqbn=esp8266:esp8266:huzzah:CpuFrequency=80,VTable=flash,FlashSize=4M1M,LwIPVariant=v2mss536,Debug=Serial,DebugLevel=SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM,FlashErase=none,UploadSpeed=921600 -ide-version=10805 -build-path /tmp/arduino_build_171356 -warnings=none -build-cache /tmp/arduino_cache_228890 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=/home/simon/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2 -prefs=runtime.tools.mkspiffs.path=/home/simon/.arduino15/packages/esp8266/tools/mkspiffs/0.2.0 -prefs=runtime.tools.esptool.path=/home/simon/.arduino15/packages/esp8266/tools/esptool/0.4.13 -verbose /home/simon/Arduino/bug_report/bug_report.ino
/home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/arduino-builder -compile -logger=machine -hardware /home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/hardware -hardware /home/simon/.arduino15/packages -tools /home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/tools-builder -tools /home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/hardware/tools/avr -tools /home/simon/.arduino15/packages -built-in-libraries /home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/libraries -libraries /home/simon/Arduino/libraries -fqbn=esp8266:esp8266:huzzah:CpuFrequency=80,VTable=flash,FlashSize=4M1M,LwIPVariant=v2mss536,Debug=Serial,DebugLevel=SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM,FlashErase=none,UploadSpeed=921600 -ide-version=10805 -build-path /tmp/arduino_build_171356 -warnings=none -build-cache /tmp/arduino_cache_228890 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=/home/simon/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2 -prefs=runtime.tools.mkspiffs.path=/home/simon/.arduino15/packages/esp8266/tools/mkspiffs/0.2.0 -prefs=runtime.tools.esptool.path=/home/simon/.arduino15/packages/esp8266/tools/esptool/0.4.13 -verbose /home/simon/Arduino/bug_report/bug_report.ino
Using board 'huzzah' from platform in folder: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2
Using core 'esp8266' from platform in folder: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2
Detecting libraries used...
"/home/simon/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/lwip2/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/arduino_build_171356/core" -c -w  -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DARDUINO=10805 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESP12"   -DESP8266 "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/variants/adafruit" "/tmp/arduino_build_171356/sketch/bug_report.ino.cpp" -o "/dev/null"
"/home/simon/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/lwip2/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/arduino_build_171356/core" -c -w  -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DARDUINO=10805 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESP12"   -DESP8266 "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/variants/adafruit" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ArduinoOTA" "/tmp/arduino_build_171356/sketch/bug_report.ino.cpp" -o "/dev/null"
"/home/simon/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/lwip2/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/arduino_build_171356/core" -c -w  -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DARDUINO=10805 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESP12"   -DESP8266 "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/variants/adafruit" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ArduinoOTA" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src" "/tmp/arduino_build_171356/sketch/bug_report.ino.cpp" -o "/dev/null"
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ArduinoOTA/ArduinoOTA.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiClient.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiServer.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiServerSecureAxTLS.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp
Using cached library dependencies for file: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiUdp.cpp
"/home/simon/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/lwip2/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/arduino_build_171356/core" -c -w  -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DARDUINO=10805 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESP12"   -DESP8266 "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/variants/adafruit" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ArduinoOTA" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS" "/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS/ESP8266mDNS.cpp" -o "/dev/null"
Generating function prototypes...
"/home/simon/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/lwip2/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/arduino_build_171356/core" -c -w  -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DARDUINO=10805 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESP12"   -DESP8266 "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/variants/adafruit" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ArduinoOTA" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS" "/tmp/arduino_build_171356/sketch/bug_report.ino.cpp" -o "/tmp/arduino_build_171356/preproc/ctags_target_for_gcc_minus_e.cpp"
"/home/simon/Downloads/arduino-1.8.5-linux64/arduino-1.8.5/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/tmp/arduino_build_171356/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/home/simon/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/lwip2/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/arduino_build_171356/core" -c -w  -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DARDUINO=10805 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESP12"   -DESP8266 "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/variants/adafruit" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ArduinoOTA" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS" "/tmp/arduino_build_171356/sketch/bug_report.ino.cpp" -o "/tmp/arduino_build_171356/sketch/bug_report.ino.cpp.o"
Compiling libraries...
Compiling library "ArduinoOTA"
Using previously compiled file: /tmp/arduino_build_171356/libraries/ArduinoOTA/ArduinoOTA.cpp.o
Compiling library "ESP8266WiFi"
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/BearSSLHelpers.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/CertStoreBearSSL.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/ESP8266WiFi.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/ESP8266WiFiAP.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/ESP8266WiFiScan.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/WiFiClient.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/WiFiServer.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
Using previously compiled file: /tmp/arduino_build_171356/libraries/ESP8266WiFi/WiFiUdp.cpp.o
Compiling library "ESP8266mDNS"
"/home/simon/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/lwip2/include" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/arduino_build_171356/core" -c -w  -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DARDUINO=10805 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESP12"   -DESP8266 "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/variants/adafruit" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ArduinoOTA" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src" "-I/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS" "/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS/ESP8266mDNS.cpp" -o "/tmp/arduino_build_171356/libraries/ESP8266mDNS/ESP8266mDNS.cpp.o"
**In file included from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Arduino.h:307:0,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/CertStoreBearSSL.h:23,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h:29,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h:24,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/WiFiServerSecure.h:21,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFi.h:41,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS/ESP8266mDNS.h:46,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS/ESP8266mDNS.cpp:41:
/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc_cfg.h:181:40: error: mem_debug_file causes a section type conflict with __c
 #define malloc(s) ({ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; malloc_loc(s, mem_debug_file, __LINE__); })
                                        ^
/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/include/mem.h:43:19: note: in expansion of macro 'malloc'
 #define os_malloc malloc
                   ^
/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS/ESP8266mDNS.cpp:761:36: note: in expansion of macro 'os_malloc'
         answer->hostname = (char *)os_malloc(strlen(answerHostName) + 1);
                                    ^
In file included from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.h:29:0,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/IPAddress.h:24,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFi.h:31,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS/ESP8266mDNS.h:46,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS/ESP8266mDNS.cpp:41:
/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/pgmspace.h:16:51: note: '__c' was declared here
 #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
                                                   ^
/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/libc/xtensa-lx106-elf/include/assert.h:18:29: note: in expansion of macro 'PSTR'
              __ASSERT_FUNC, PSTR(#__e)))
                             ^
/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/include/UdpContext.h:154:9: note: in expansion of macro 'assert'
         assert(isValidOffset(pos));
         ^
Using library ArduinoOTA at version 1.0 in folder: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ArduinoOTA 
Using library ESP8266WiFi at version 1.0 in folder: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi 
Using library ES                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFi.h:31,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS/ESP8266mDNS.h:46,
                 from /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS/ESP8266mDNS.cpp:41:
/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/pgmspace.h:16:51: note: '__c' was declared here
 #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
                                                   ^
/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/tools/sdk/libc/xtensa-lx106-elf/include/assert.h:18:29: note: in expansion of macro 'PSTR'
              __ASSERT_FUNC, PSTR(#__e)))
                             ^**
/home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/include/UdpContext.h:154:9: note: in expansion of macro 'assert'
         assert(isValidOffset(pos));
         ^P8266mDNS in folder: /home/simon/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266mDNS (legacy)
exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.

Most helpful comment

If you manually change the segment you can get this specific problem to go away: __attribute__((section(".irom.text.mallocdebug"))) in place of icache_ro_data and store_attr in the umm_malloc_cfg.h file builds working executables.

It's not a general fix because, per GCC manuals, section should only be used on _global_ variables:
https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variable-Attributes.html
````
Use the section attribute with an initialized definition of a global variable, as shown in the example. GCC issues a warning and otherwise ignores the section attribute in uninitialized variable declarations.

You may only use the section attribute with a fully initialized global definition because of the way linkers work. The linker requires each object be defined once, with the exception that uninitialized variables tentatively go in the common (or bss) section and can be multiply "defined". You can force a variable to be initialized with the -fno-common flag or the nocommon attribute.
````

All 5 comments

This is a section problem related to ICACHE_RODATA_ATTR which I don't yet understand.

Removing that decorator from the static variable in the debug #define malloc() macro in umm_malloc_cfg.h lets things build fine (but places lots of strings in RAM which is not a good thing).

related: #4650

and worth reading: #2078

I think we should introduce a second assert function that emits no error message, that still could be traced back thanks to the stack dump and stack decoder, then we should use it there:
libraries/ESP8266WiFi/src/include/UdpContext.h:154:9
(because this particular one beeing in a .h file is in the way)

and / or

Move this assert in a separate .cpp file.

If you manually change the segment you can get this specific problem to go away: __attribute__((section(".irom.text.mallocdebug"))) in place of icache_ro_data and store_attr in the umm_malloc_cfg.h file builds working executables.

It's not a general fix because, per GCC manuals, section should only be used on _global_ variables:
https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variable-Attributes.html
````
Use the section attribute with an initialized definition of a global variable, as shown in the example. GCC issues a warning and otherwise ignores the section attribute in uninitialized variable declarations.

You may only use the section attribute with a fully initialized global definition because of the way linkers work. The linker requires each object be defined once, with the exception that uninitialized variables tentatively go in the common (or bss) section and can be multiply "defined". You can force a variable to be initialized with the -fno-common flag or the nocommon attribute.
````

Great finding !

@earlephilhower Thanks for this, your suggestion solved my problem! Any idea if this will be fixed in the next releases?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tttapa picture tttapa  路  3Comments

Khorne13 picture Khorne13  路  3Comments

tiestvangool picture tiestvangool  路  3Comments

Chagui- picture Chagui-  路  3Comments

eliabieri picture eliabieri  路  3Comments