Hello Simon,
If you want to make the binary and core dump available, I can have a look.
Simon Lundmark wrote:
> If I'm understanding this correctly we're trying to access fun[j] or the
> offset of fun (0x7f45048583d8, which looks reasonable) with j that's
> 4294966813,
> which obviously is problematic. I'm not nearly knowledgeable about the
> code-base to understand all of this but if
>
> j = (long)CROSSDEF_NAME_OFFSET(flags); where flags is
2149711389 and
> we get 4294966813
> then obviously it seems like a function is somehow flagged wrongly.
flags is 0x8021fe1d, CROSSDEF_NAME_OFFSET(flags) should be -483
(0x1fe1d - 0x20000), which would be fine. We are at function #532,
so we would arrive at function #49. So the flags seem sensible to me.
You can check in gdb, whether fun[-483] is a valid memory access.
However gdb shows 4294966813, and fun[4294966813] is very probable an
invalid memory access. 4294966813 is 2^32 - 483. So somehow it's
converting the value to an unsigned 32 bit integer before putting it into j
(which is declared as a long, so it probably is a signed 64 bit integer).
I looked at the code and cannot find a place where this would happen.
flags is an uint32, but it's cast to an int32. INHERIT_MASK being an enum
value should be an int. The return type of CROSSDEF_NAME_OFFSET is a long
as is the target variable. So I don't see where this conversion to uint32
could happen.
Could you check:
ptype CROSSDEF_NAME_OFFSET
ptype j
The first one should give type = long (const funflag_t), the second one
type = long.
This might be interesting as well:
disass CROSSDEF_NAME_OFFSET
With best regards,
Gnomi