The thread local ti_thread object was not initialized for main thread, which caused ASAN to complain about wild pointer. Fixed by assigning a thread local ti_thread object for main thread too.