Re: odd assertion in gtktextiter.c



Skip Montanaro <skip pobox com> writes:
> I'm getting an assertion error in forward_line_leaving_caches_unmodified in
> gtktextiter.c (this is from the vanilla 1.3.5 distribution).  There is a
> test of new_line:
> 
>   if (new_line != NULL)
>     {
>     ... do some stuff ...
>     }
>   else
>     {
>       /* There is no way to move forward; we were already
>          at the "end" index. (the end index is the last
>          line pointer, segment_byte_offset of 0) */
> 
>       g_assert (real->line_char_offset == 0 ||
>                 real->line_byte_offset == 0);
>     ... do some other stuff ...
>     }
> 
> I'm landing in the else clause.  The assertion is failing because
> real_line_char_offset is -1 and real->line_byte_offset is 25.  I looked at
> new_line and discovered its value to be 0xffffffff.  So my confusion is
> two-fold.  One, new_line's value looks mighty suspicious to me.  (Looks like
> -1 instead of a valid pointer.)  Two, how in the heck could new_line have
> compared equal to NULL?  I don't believe I did anything unusual when
> compiling Gtk, so the gcc compilation flags where probably just "-g -O2".
> I'll try rebuilding without any optimization and see if that helps.  Any
> other debugging suggestions would be appreciated.
> 

The value of new_line is probably either the stack getting messed up
or gdb getting confused.

If you can make a test case for this so I can reproduce it, I'll try
to sort it out.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]