Re: Bug#8482: Uninitialized memory read in gio.



Hi Benjamin,

> It looks like g_io_unix_check is being called on a fd before it is
> polled.  This means that revents is not being set and is thus being read
> uninitialized.  No bad things have occured to me because of this, but
> thought I should point it out.

That indeed is a bug. But actually it seems to reveal a problem inside
g_main_iterate. After staring at the code for sometime I'm thinking, that
this can only happen in the following case: 

g_main_iterate finds a source of priority 'current_priority' to be ready in
'prepare' and thus it doesn't check further for sources with smaller
priorities. Then it polls all sources with priorities greater or equal to
'current_priority'. Then afterwards it searches for sources to be ready in
'check' and because (assumed here) no sources of priority greater or equal to
'current_priority' are ready wrt 'check', it continues searching for lower
priorities, where the revents field wasn't set by g_poll (because g_poll
didn't touch them at all). I hope that makes sense. I'll leave the fix to Owen
or Tim, as they are more intimate with the main loop and furthermore there is
the chance, that all I wrote so far is rubbish. (Though actually that is
already the 3rd completly rewritten draft of that mail, and now I think, I got
it right)

> ****  Purify instrumented ./chat (pid 21761)  ****
> IPR: Invalid pointer read:
>   * This is occurring while in:
>         strlen         [rtlib.o]
>         g_strdup       [gstrfuncs.c:56]
>         _g_module_symbol [gmodule.c:124]
>         g_module_symbol [gmodule.c:382]
>         g_module_open  [gmodule.c:270]
>         main           [main.c:48]
>   * Reading 59 bytes from 0xef1900d8 between the heap and the stack.

<<lots of erros deleted>>

I'll just kindly ignore these error messages, hoping they do not point on
me......... ;-)

Bye,
Sebastian
-- 
Sebastian Wilhelmi                   |            här ovanför alla molnen
mailto:wilhelmi@ira.uka.de           |     är himmlen så förunderligt blå
http://goethe.ira.uka.de/~wilhelmi   |



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