Error compiling for board Arduino/Genuino Uno

I am getting below error sometimes when I click on "Verify" or "Upload" icons. But after 3 or 4 clicks error is going away. Any idea why this error is coming?

failed MSpanList_Insert 0x313878 0xc92285dc5164 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.MSpanList_Insert(0x2cadd0, 0x313878)
/usr/local/go/src/runtime/mheap.c:692 +0x8f
runtime.MHeap_Alloc(0x2cad60, 0x3, 0x1000000002c, 0xf989)
/usr/local/go/src/runtime/mheap.c:240 +0x66
runtime.MCentral_CacheSpan(0x2d4818, 0x1)
/usr/local/go/src/runtime/mcentral.c:85 +0x167
runtime.MCache_Refill(0x30c000, 0xc20000002c, 0xc208012000)
/usr/local/go/src/runtime/mcache.c:90 +0xa0

goroutine 1 [running]:
runtime.switchtoM()
/usr/local/go/src/runtime/asm_amd64.s:198 fp=0xc2080e5130 sp=0xc2080e5128
runtime.mallocgc(0x1200, 0x1a2480, 0x0, 0xc208015600)
/usr/local/go/src/runtime/malloc.go:178 +0x849 fp=0xc2080e51e0 sp=0xc2080e5130
runtime.newarray(0x1a2480, 0x10, 0xa5ca)
/usr/local/go/src/runtime/malloc.go:365 +0xc1 fp=0xc2080e5218 sp=0xc2080e51e0
runtime.hashGrow(0x1b69a0, 0xc20809c450)
/usr/local/go/src/runtime/hashmap.go:744 +0x86 fp=0xc2080e5248 sp=0xc2080e5218
runtime.mapassign1(0x1b69a0, 0xc20809c450, 0xc2080e5360, 0xc2080e5350)
/usr/local/go/src/runtime/hashmap.go:456 +0x568 fp=0xc2080e52e8 sp=0xc2080e5248
arduino.cc/properties.Map.Merge(0xc20809c450, 0xc2080e5410, 0x1, 0x1, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/properties/properties.go:165 +0x153 fp=0xc2080e53e0 sp=0xc2080e52e8
arduino.cc/properties.Map.Clone(0xc20803d9e0, 0x1f2590)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/properties/properties.go:173 +0xad fp=0xc2080e5438 sp=0xc2080e53e0
arduino.cc/builder/builder_utils.ArchiveCompiledFiles(0xc2080381e0, 0x5f, 0x1d15d0, 0x6, 0xc2080a6000, 0x19, 0x20, 0xc20803d9e0, 0xc20803d901, 0x31ddc8, ...)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder_utils/utils.go:271 +0x27c fp=0xc2080e5560 sp=0xc2080e5438
arduino.cc/builder/phases.compileCore(0xc2080381e0, 0x5f, 0xc20803d9e0, 0x1, 0x7fff5fbffc85, 0x4, 0x31ddc8, 0x2c49b0, 0x0, 0x0, ...)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/phases/core_builder.go:92 +0x79f fp=0xc2080e56e0 sp=0xc2080e5560
arduino.cc/builder/phases.(*CoreBuilder).Run(0x2c49b0, 0xc208068000, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/phases/core_builder.go:55 +0x20f fp=0xc2080e5800 sp=0xc2080e56e0
arduino.cc/builder.runCommands(0xc208068000, 0xc2080e5a98, 0x22, 0x22, 0x1, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:189 +0x139 fp=0xc2080e5890 sp=0xc2080e5800
arduino.cc/builder.(*Builder).Run(0xc2080e5ce0, 0xc208068000, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:124 +0x1227 fp=0xc2080e5cc0 sp=0xc2080e5890
arduino.cc/builder.RunBuilder(0xc208068000, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:220 +0x49 fp=0xc2080e5ce8 sp=0xc2080e5cc0
main.main()
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/arduino-builder/main.go:316 +0x171b fp=0xc2080e5f98 sp=0xc2080e5ce8
runtime.main()
/usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc2080e5fe0 sp=0xc2080e5f98
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc2080e5fe8 sp=0xc2080e5fe0
/Applications/Arduino.app/Contents/Java/arduino-builder returned 2
Error compiling for board Arduino/Genuino Uno.

Error compiling for board Arduino/Genuino Uno.

You failed to post the code you are trying to compile.

I am getting the same problem. Code is example>basics>blink.

My computer: Latest Mac OS 10.12.6. MacBook Pro 2010 2.4 GHz Intel 2 Core Duo.

Uno plugged in directly to MacBook USB port.

Correct Board Selected: Arduino/Genuinio Uno
Correct Port Selected: /dev/cu.usbmodem641 (Arduino/Genuinio Uno)

CODE:
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

Most Arduinos have an on-board LED you can control. On the Uno and
Leonardo, it is attached to digital pin 13. If you're unsure what
pin the on-board LED is connected to on your Arduino model, check
the documentation at http://www.arduino.cc

This example code is in the public domain.

modified 8 May 2014
by Scott Fitzgerald
*/

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}