use gdb to debug with complicate issue