[Dovecot] Panic in Dovecot 1.1.3: index-mail.c: line 1091: assertion failed: (!mail->data.destroying_stream)

Peter Eriksson peter at ifm.liu.se
Wed Sep 10 18:42:02 EEST 2008



Peter Eriksson wrote:
> Another thing I just noticed (but you probably already is aware
> of that):

A last thing... I did some debugger tracing of the calls to
i_stream_unref and printed the arguments (see the attached file)

It seems the *stream in these two calls to i_stream_unref references the
same 'stream'.

The second call to i_stream_unref is the one wrapped with the
'data.destroying_stream' check that triggers the assert.

I inserted a breakpoint at the index_mail_stream_destroy_callback
function and that one actually gets called correctly with
'mail->data.destroying_stream' set to '1'. If I then check the
'_mail' structure contents back in the i_stream_unref function
it is correctly set to '0'.

But the i_assert() call on line 1091 still triggers for some
unknown reason...

My guess:

Optimizer incorrectly assuming that it doesn't need to refetch
the variable value from the structure since it doesn't understand
that the i_stream_unref(&mail->data.stream) call actually modifies
the whole mail->data structure...

Funny that both Gcc and Sun Studio seems to make the same
assumptions in that case :-)

>                mail->data.destroying_stream = TRUE;
>                i_stream_unref(&mail->data.stream);
>                i_assert(!mail->data.destroying_stream);

- Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 185 bytes
Desc: OpenPGP digital signature
Url : http://dovecot.org/pipermail/dovecot/attachments/20080910/5e79a960/attachment.bin 


More information about the dovecot mailing list