p_circ_id is a uint32_t, but we print it as a %d
Take for example
Mar 10 05:08:15.000 [info] circuit_expire_old_circuits_serverside(): Closing circ_id -2147477157 (empty 62 secs ago)
This happens because p_circ_id is of type circid_t, which is a uint32_t.
There are a bunch of cases in the code where we print p_circ_id as a %d. I guess the overflow is extra likely because of the "use the first bit to decide which piece of the id-space you'll use" trick.