workers: array of pointers (me are the values):
worker array: 0x510a80
me: 0x510b10 tsq: 0x510b30
me: 0x510c40 tsq: 0x510c60
me: 0x510d70 tsq: 0x510d90
me: 0x510ea0 tsq: 0x510ec0
me: 0x510fd0 tsq: 0x510ff0
me: 0x511100 tsq: 0x511120
from gdb on the crash:
(gdb) bt
#0 0x00002b32c0a381f7 in sem_wait () from /lib/libpthread.so.0
#1 0x0000000000401093 in tsq<int>::push (this=0x10001000000, insert=7507) at tsq.cpp:135
#2 0x0000000000400f2b in Eras::seive (this=0x510fd0) at eras.cpp:28
#3 0x0000000000400d16 in main () at main.cpp:62
(gdb) up
#1 0x0000000000401093 in tsq<int>::push (this=0x10001000000, insert=7507) at tsq.cpp:135
135 sem_wait(&produce);
(gdb) up
#2 0x0000000000400f2b in Eras::seive (this=0x510fd0) at eras.cpp:28
28 mark(p);
(gdb) print workers[5]
$5 = (Eras *) 0x510000
Somehow, workers[5] is getting corrupted. One of the bytes is getting zeroed out; and it's not bad RAM, a second system with the same architecture produces the exact same problem.