Vicente Olivert Riera <[email protected]> writes:

> Then I don't understand what you mean, Petr. function_offset is not

This is the new code:

                        rc = unw_get_proc_name(&cursor, fn_name,
                                               sizeof(fn_name),
                                               &uw_function_offset);
                        function_offset = (arch_addr_t) uw_function_offset;
                        assert(uw_function_offset == (unw_word_t) 
function_offset);
                        if (rc == 0 || rc == -UNW_ENOMEM)

Now imagine that unw_get_proc_name fails.  uw_function_offset is
therefore uninitalized and could contain whatever.  But then you copy
its value over to function_offset.  Since the two can be of different
widths, the value in uw_function_offset may have been trimmed, and the
two end up containing different values.  The assert would then fail.

So either initialize to zero, or just move the code where we know
uw_function_offset was initialized.

Did this help?

Thanks,
Petr

_______________________________________________
Ltrace-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/ltrace-devel

Reply via email to