segmentation fault occurs when pthread_mutex_lock tries to lock a mutex

Hi, all.

I am porting lldb for a VLIW target with host env gcc-4.8.2/redhat enterprise linux 6.2.

This problem happens in member function lldb_private::Unwind::GetFrameInfoAtIndex() when it tries to lock member “m_unwind_mutex” whose runtime address is 0x10 (checked via GDB).

I am not familiar with mutex errors, does anyone have clues?

Thanks in advance!

Is it me or 0x10 is not a valid address?
At a glance, you get that kind of address when you are dereferencing an iVar of a zeroed-out pointer, and 16 would be the offset of the mutex from the base of the class.
You might want to check along the stack if you are accessing a NULL object without checking first.

Enrico Granata <egranata@🍎.com>

Thank you very much, Granata.

I did not construct frame unwinder for my target ISA in lldb_private::thread::GetUnwinder(), and thus it returned a null pointer.