Hi @themetman . I see a bug report about a similar fault here:
opened 09:34AM - 02 Jun 17 UTC
closed 04:32PM - 31 May 18 UTC
type: imperfection
conclusion: resolved
topic: code
First compilation works perfectly. Second compilation crashes arduino-builder:
…
```
panic: runtime error: index out of range
goroutine 1 [running]:
panic(0x556bc0, 0xc420018130)
/home/jenkins/go/src/runtime/panic.go:500 +0x1a1
arduino.cc/builder.findIncludesUntilDone(0xc420060400, 0xc4202f5d40, 0x556f40, 0xc4201f90e0, 0xc420381162, 0x18, 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, 0xc420060400, 0x41bc3c3c, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/container_find_includes.go:149 +0x5e4
arduino.cc/builder.runCommands(0xc420060400, 0xc42019fad8, 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(0xc42019fd28, 0xc420060400, 0xc420045d88, 0x562240)
/home/jenkins/workspace/arduino-builder-all-cross/src/arduino.cc/builder/builder.go:124 +0xb9c
arduino.cc/builder.RunBuilder(0xc420060400, 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/matt/Downloads/arduino-1.8.2/arduino-builder returned 2
```
Environment
-----------------
Core URL: https://raw.githubusercontent.com/chipKIT32/chipKIT-core/master/package_chipkit_index.json
Test board: chipKIT MAX32
Operating System: Linux (64 bit)
IDE version: 1.8.2
Steps to reproduce
-------------------------
1. Install the required boards package and select the right board
2. Install the required library (below)
3. Paste in the test sketch and compile (succeeds)
4. Compile again - fails.
Test Sketch
---------------
Required library: https://www.dimensionengineering.com/software/SabertoothArduinoLibraries.zip (though any contributed library may do it)
```C++
// playing with motor driver
#include <SabertoothSimplified.h>
#define MAIN_LED_PIN 13
SabertoothSimplified ST( Serial1 );
void setup()
{
pinMode( MAIN_LED_PIN, OUTPUT );
//SabertoothTXPinSerial.begin(38400);
Serial1.begin( 38400 );
}
void loop()
{
ST.motor(1, 127); // Go forward at full power.
ST.motor(2, 127);
delay( 2000 ); // Wait 2 seconds.
ST.motor(1, 0); // Stop.
ST.motor(2, 50);
delay(2000); // Wait 2 seconds.
ST.motor(1, -127); // Reverse at full power.
ST.motor(2, -80 );
delay(2000); // Wait 2 seconds.
ST.motor(1, 0); // Stop.
ST.motor(2, -127 );
delay(2000);
ST.motor( 2, 0 );
delay( 1000 );
// do heartbeat blink
digitalWrite( MAIN_LED_PIN, HIGH );
delay( 500 );
digitalWrite( MAIN_LED_PIN, LOW );
delay( 500 );
}
```
However, that was fixed some time ago. So it is unexpected that you would still experience it if you are using Arduino IDE 1.8.19.
I see you are using a 3rd party modified version of Arduino IDE from a package repository. It is possible the problem is specific to that version. I recommend you to try using the official Arduino IDE build downloaded from the "Software" page here on the arduino.cc website:
If possible, you should use the latest version (currently Arduino IDE 2.1.0). If for some reason you can't or won't use Arduino IDE 2.x, you can download the official build of Arduino IDE 1.8.19 from the links listed farther down the page here:
https://www.arduino.cc/en/software#legacy-ide-18x