Description
I've a couple of big sketches (custom board and platform files...) which crashes the builder on second run. I have to close and restart the IDE to rebuild it.
Here the java crash log... please tell me if you need more :
panic: runtime error: index out of range
goroutine 1 [running]:
panic(0x556bc0, 0xc420010140)
/home/jenkins/go/src/runtime/panic.go:500 +0x1a1
arduino.cc/builder.findIncludesUntilDone(0xc420034c00, 0xc4203823f0, 0x556f40, 0xc42039b4a0, 0xc4202840d4, 0x10, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/container_find_includes.go:321 +0x138f
arduino.cc/builder.(*ContainerFindIncludes).Run(0x64d248, 0xc420034c00, 0x41bc3c3c, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/container_find_includes.go:149 +0x5e4
arduino.cc/builder.runCommands(0xc420034c00, 0xc420473ae8, 0x22, 0x22, 0x1, 0x0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:191 +0xcd
arduino.cc/builder.(*Builder).Run(0xc420473d38, 0xc420034c00, 0xc420045d88, 0x562240)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:124 +0xb9c
arduino.cc/builder.RunBuilder(0xc420034c00, 0xc420045d88, 0x64d248)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:222 +0x35
main.main()
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/arduino-builder/main.go:338 +0x99c
/home/massimo/Documenti/Elettronica/ARDUINO/arduino-1.8.3/arduino-builder ha restituito 2
Errore durante la compilazione per la scheda Fishino32.
Activity
matthijskooijman commentedon Jun 22, 2017
I think this is the same as arduino/arduino-builder#230. What board are you compiling for? Could you see if the arduino-builder from arduino/arduino-builder#236 fixes this?
MicioMax commentedon Jun 22, 2017
I guess it's the same issue, I'm using a platform.txt derived from chipkit one.
I'll test your builder, thank you!
MicioMax commentedon Jun 22, 2017
Yep... the crash is away.
For the meanwhile, is it possible to modify the platform.txt to make the unpatched IDE work ?
I've got many people using my package, and most of them don't know how to patch it...
MicioMax commentedon Jun 22, 2017
mhhhh.... it shows no error, but it has problems; here the last part of the output, followed by last part of the output of my own IDE (self coded), which uses same platform data; you can see that sketch size is ONE THIRD in arduino ide, and it doesn't even start on my board :
ARDUINO IDE OUTPUT
FISHIDE output :
matthijskooijman commentedon Jun 22, 2017
For an example to fix this in platform.txt, see chipKIT32/chipKIT-core#356
Essentially you're just inlining the compiler.c.flags var into the compiler.cpp.flags var.
As for your other error, I suspect it is a different and unrelated problem. The difference in code size is remarkable, so that would be a good place to start debugging (I have some scripts on github that can help figuring out what's inside and what's the difference). Comparing the full list of gcc commands between both IDEs might also be useful (perhaps different board options or defines are passed on the commandline? Different optimization options?).
MicioMax commentedon Jun 22, 2017
Hi matthijskooijman,
yep, I solved the crash adding compiler.preproc.flags without the -MMD and it builds now.
The size problem is still there, I guess it's a problemi with the linker, I'll investigate it.
In my IDE I use a totally different approach, making all the .ar first and then linking them together.
Probably IDE's linker is missing some library code... the weird stuff is that it doesn't complain at all.
Smaller sketches do work indeed.
MicioMax commentedon Jun 22, 2017
(options are exactly the same on both IDEs. Mine has provisions for changing the optimizations, but I checked the compiler commands and it's exactly the same, just include's order change. Linker command is quite different)
per1234 commentedon Aug 3, 2017
@MicioMax any news on the code size difference? Can this issue be closed now or is there still an outstanding issue with the Arduino IDE?