Skip to content

Known issues in other projects

MicroGoose builds on the Goose compiler and runtime, GCC, ESP-IDF, the Pico SDK, FreeRTOS, newlib and the chips themselves. Some of their bugs and design choices change what a MicroGoose program does, or how fast it runs. This page gathers them in one place. Each row links to the page with the evidence, where the runs and probes are named.

The status column says one of these:

  • Reported, with a link to the upstream report.
  • Drafted: a report is written but not filed.
  • Not reported: these docs record no report.
  • Fixed upstream, but not in the version MicroGoose builds with.
  • Design choice or documented behavior: nothing to report, but it costs MicroGoose something on a microcontroller.

MicroGoose hasn't reported any of these upstream yet. Decisions to report are the maintainer's: What still needs reporting lists them.

Bugs

Project and version Issue What it does to MicroGoose Workaround Status Evidence
Xtensa GCC 15.2 (esp-15.2.0_20251204), ESP32-S3 and ESP32 A 64-bit argument whose type is an under-aligned typedef is passed in the wrong register pair at -O1 and above. double too. Wrong values. The first board run printed pushed 4596609819930001408 squares instead of 100. Goose declares every scalar this way, so nearly any 64-bit value passed to a call that isn't inlined was at risk. 64-bit value typedefs get natural alignment (xtensa_abi_fix), and -fno-tree-sra -fno-ipa-sra. Not reported. The fix would be TYPE_MAIN_VARIANT in xtensa_function_arg_1, as GCC did for ARM (PR target/65956). Findings, section 3
Goose runtime v2026.4 A contained abort keeps memory. Its message is freed only by thread_wait(id, why). The bit array for aborted ids never shrinks. thread_spawn_contained can't report that a thread failed to start. On the H7, about 163 to 171 bytes kept per abort waited without the message or not at all. About 125 KB of bits per million workers started. 50 contained spawns in a row ended the program with cannot create thread. None in the port. A supervisor should wait with thread_wait(id, why). Drafted. Measured with v2026.4. Benchmark findings, item 1
newlib-nano in GNU Arm Embedded 7-2017-q4-major (GCC 7.2.1, PlatformIO's STM32 toolchain) realloc copies the new size out of the old block, so it reads past the old block's end. On the H7, the copy faulted when the next block was a worker's stack, which begins with an MPU guard. abort_records.goose faulted in every run of one build. The port has its own _realloc_r: the toolchain's, with newlib's fix. Fixed upstream in newlib 4.0.0 (ce4044adeebf). The toolchain predates it. Benchmark findings, item 5
newlib in the same toolchain, hard float setjmp doesn't save the FPU's d8–d15, and jmp_buf has no room for them. Hard-float code keeps values there across calls. An abort in a contained worker returns through longjmp, so on the H7 with the FPU it would lose those values. The port has its own setjmp and longjmp. fpu_registers.goose checks them. Not reported. Whether a newer newlib has it isn't checked. Optimizations, section 1
ESP-IDF 6.1 pthreads pthread_cond_timedwait compares the runtime's deadline, which counts from boot, with the wall clock. After ntp_sync set the wall clock, a timed queue wait spun holding the queue's mutex until its deadline. A 500 ms wait for a message sent at 20 ms ran the full 500 ms on both ESP32s. The runtime's own locks (mg_sync) time their waits on the monotonic clock. The message now arrives after 20.1 ms on the S3 and 19.5 ms on the WROOM. Not reported. Optimizations, section 2, Benchmark findings, item 6
RP2350 (Pico 2 W), erratum E9 A pin with only the internal pull-down can stay near 2 V after something drove it high and let go. pin_read returns 1 on such a pin. pin_input(pin, PULL_DOWN) brings the pin low when it's called. A pin that something drives and then releases needs a pull-down of 8.2 kΩ or less on the board. A chip erratum, documented by Raspberry Pi in the RP2350 datasheet. Hardware API, GPIO
Pico SDK 2.3.1 with FreeRTOS 11.3.3 (Raspberry Pi's RP2350 port), heap_3 With the SDK's multicore library linked, PICO_USE_MALLOC_MUTEX is on by default: a mutex round malloc, taken before newlib's own lock. heap_3 calls malloc with the scheduler suspended, and a wait for that mutex then is an event-group wait with no timeout, which FreeRTOS asserts against. A program whose contained workers abort ended at a FreeRTOS assertion (event_groups.c:332). contained_aborts.goose did in 3 of 3 runs, before its 1,000th abort, and so did the benchmark suite's faults group. The port builds with PICO_USE_MALLOC_MUTEX=0. newlib's lock, which the port takes by suspending the scheduler, keeps allocations one at a time on the one core FreeRTOS runs on. Not reported. The cause comes from reading the code, not from a trace. Benchmark findings, item 11

Design choices and documented behavior

Project and version What it does What it does to MicroGoose Workaround Status Evidence
Goose C backend Computes every stride and offset with 8-byte pointers: it targets 64-bit hosts. A struct holding a slice is 28 bytes to Goose and 24 to a 32-bit C compiler. 16_records crashed on the S3. ptr64_layout pads every pointer inside Goose's packed types to 8 bytes. A pointer-size option in Goose would remove it and roughly halve slice and reference sizes. Design choice. Not reported. Findings, Conformance, What would make this first-class
Goose release C Indexes and counts are i64, which takes two registers on these 32-bit cores. heapsort takes 1.93 times C on the S3, 1.94 on the WROOM and 2.12 on the H7. In C, int64_t indexes alone take 1.51 to 1.77 times as long as int. None. MicroGoose can't narrow Goose's i64. Design choice. Optimizations, section 6, section 12
Goose C backend Writes an in-order sum in blocks of 8 through a local array, a shape that vectorizes on a desktop. These chips have no vector float unit. In C, the blocked shape takes 1.49 to 1.58 times as long as the plain loop with int counters, and 2.32 to 2.57 times on the ESP32s with int64_t counters, as Goose's. plain_sums runs every term one at a time, in the same order, with the same results. matmul_f32 went from 3.0 and 3.5 times C to 1.31 and 1.37 on the ESP32s. Design choice. Optimizations, section 6
Goose v2026.5 C backend Writes an in-order sum whose count is a whole number of blocks as the blocked loop alone. plain_sums turned that loop off, and the sum came out as 0, until a fix left it as the compiler wrote it. Then matmul_f32 took 3,870 µs on the S3, 4,976 on the WROOM and 969 on the H7: 2.3 to 2.5 times its time with v2026.4 on the ESP32s. plain_sums rewrites such a sum into the one-at-a-time loop v2026.4 wrote, adding the terms in the same order (76c1c42, 181987f). matmul_f32 takes 1,689, 1,961 and 614 µs again, as with v2026.4. A sum written as blocks alone in another shape still runs as written. Not a bug. Optimizations, section 10, section 12, Changelog
Goose v2026.5 runtime Asks for an 8 MB native stack for each worker thread. A desktop only reserves it. A board would have to allocate it. A worker keeps the port's 16 KB, or the size --worker-stack gives. Design choice for desktops. Changelog
Goose language Never fuses a * followed by a + (Goose's spec, section 7.12). C at GCC's default does. matmul_f32 takes 1.31 times C on the S3, 1.37 on the WROOM and 1.01 on the H7. None: the results would change. Design choice. Optimizations, section 6
ESP-IDF heap (TLSF) An aligned allocation takes the size plus the alignment, then gives the extra back. The hole it leaves when freed is the size alone, and the same call doesn't fit it. With 4 KB data and native stacks, low_heap was refused 3 of 19 workers' data stacks, which ends the program, with 29,712 bytes free: the largest free block was 4,096, and a data stack takes 4,160. A worker's data stack is a plain block, with the stack aligned inside it. Allocator behavior. Not reported. Optimizations, section 10
FreeRTOS on ESP-IDF A task that deleted itself is freed only when an idle task next runs, and an idle task runs only when its core has nothing else to do. ESP-IDF's detached pthreads delete themselves. A finished worker's 16.5 KB could still be held at the next spawn. On the WROOM, spawn_wait was refused a data stack in 2 of 12 boots. Once a WROOM data stack left 8 KB free, not 64, a spawn ran out at its native stack in 1 boot of 10. On the WROVER-E, where four 16 KB native stacks fit in the internal RAM left, the suite stopped at scale_4w in every boot: three running workers kept both cores, and the idle tasks didn't run in the five ticks the spawn waited. With PSRAM (the S3, the WROVER-E), a worker's thread is created joinable and joined as it ends, by a task above the program's priorities, which frees its stack then, and a refused data stack, native stack or worker's globals joins any finished thread first. On every ESP32 a refused one then waits up to five ticks. Documented behavior. Benchmark findings, items 3, 10 and 13; Optimizations, section 16
FreeRTOS on ESP-IDF vTaskDelay counts the tick already under way as the first. delay_ms could return up to a tick early: a 1 ms wait after 9 µs on the S3, and 3,696 of 5,700 waits early there. delay_ms blocks for whole ticks and waits out the rest on the clock micros() reads. None of the 5,700 is early. Documented behavior. Benchmark findings, item 9
PlatformIO's STM32 platform Builds the H743 board for software floating point by default. Float work ran 8.6 to 14 times slower than C built for the FPU. mandel_f64 took 75,453 µs. The H7 port is built for the double-precision FPU: mandel_f64 takes 7,259 µs. A platform default. Optimizations, section 1
GCC 7.2.1 (the H7's toolchain) In C with int64_t indexes, Goose's two bounds checks made heapsort slower on the H7. GCC 15.2 on the ESP32s used them to make it faster. 1,672 µs against 1,242 without the checks on the H7. On the S3, 3,922 against 4,484. None. Not reported. Optimizations, section 6

What still needs reporting

These are the maintainer's to decide. Nothing has been filed.

  • Xtensa GCC: to Espressif (esp-gcc) and to GCC's Xtensa backend. The findings page says it is worth reporting and names the one-line fix.
  • Goose runtime, contained aborts: a report is drafted. It was measured with v2026.4, so it would need checking with v2026.5 before filing.
  • ESP-IDF's pthread_cond_timedwait: these docs show the effect, not whether ESP-IDF supports a condition variable on the monotonic clock. That needs checking first.
  • newlib's setjmp for hard float: whether a newer newlib still lacks d8–d15 needs checking first.
  • The Pico SDK's mutex round malloc under FreeRTOS's heap_3: to Raspberry Pi's pico-sdk or FreeRTOS-Kernel. Which task held the mutex wasn't traced, and whether the SDK means heap_3 to be used with it needs checking first.

The Goose design choices aren't bugs. A pointer-size option in Goose's C backend is the change that would help most (What would make this first-class).

Issues in the other benchmarked implementations

These don't affect MicroGoose, but they change the comparison in the benchmarks. All are TinyGo 0.44.0's.

  • Idle timer wake-up on the ESP32s: a goroutine woken by the timer runs only when the scheduler's sleep ends, so timer_idle_wake has a median of 91,467 µs. TinyGo's ESP32 sleepTicks goes back to sleep after an interrupt (Benchmark findings).
  • timer_busy with the multicore scheduler (S3): no tick arrives. The likely cause is a spinlock taken with interrupts enabled; this is a hypothesis from reading the source (Benchmark findings).
  • On the H7: the RTT console was corrupted, because its control block is in cached memory, and the runtime's clock sometimes ran 31 times too fast, because a timer's prescaler write was lost. The benchmark's board code works around both (Benchmark findings).