We had a bug where we forgot to zero the .tbss section (the zero part of
the TLS), which led to preempt_counter not being intialized to zero and therefore preemption not being enabled for new threads. Such non-preemptable threads can monopolize their CPU and cause other threads with the misfortune of being assigned to this CPU to never run. This patch adds a simple test reproducing this bug. Because we don't have an implementation of __tls_get_addr(), we can't "extern" a TLS symbol (here sched::preempt_counter) from the test, and so I had to create a new sched::get_preempt_counter() function which I can "extern" from the test.
tests/tst-preempt.cc
0 → 100644
Please register or sign in to comment