<p dir="ltr">I've seen the Ubuntu bug reports about this and also looked through the problem. The assert would not help in this case and I'll try to explain why.</p>
<p dir="ltr">The null error is caused by an memory corruption or refcount issue (file has already been freed, but used in another thread). If you enable assert you will never catch the issue because writing in the console or the check macros (thise use a hashtable for type lookup in the main thread) delays the function long enough to finish using the file in the other thread. And it will go wrong elsewhere.</p>
<p dir="ltr">I was able to reproduce the bug in some case and with a normal g_return_if_fail it did not properly catch the free.</p>
<p dir="ltr">Also in gdb the crash did not occur because the thread order was different or slower.</p>
<p dir="ltr">So the trick is the find the issue and was eventually quite sure it was not in thunar.</p>
<p dir="ltr">Nick</p>
<div class="gmail_quote">Op 8 nov. 2014 11:47 schreef "Alistair Buxton" <<a href="mailto:a.j.buxton@gmail.com">a.j.buxton@gmail.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 8 November 2014 02:36, Matthew Brush <<a href="mailto:mbrush@codebrainz.ca">mbrush@codebrainz.ca</a>> wrote:<br>
<br>
> It's possible the author of that code actually meant to use one of those<br>
> debug precondition checks properly, not expecting it to fail (or crash, in<br>
> release mode) unless it was fed a garbage pointer from outside.<br>
<br>
Agreed.<br>
<br>
> On the bright side, without the checks, it doesn't propagate the error<br>
> further and allows it to crash in the proper place :)  It'd be interesting<br>
> to see why there are NULLs in the GSequence in the first place. It's hard to<br>
> tell from the backtrace since it happens indirectly in that callback<br>
> function and I'm not familiar with Thunar's code (or having time to<br>
> investigate it right now).<br>
<br>
The problem is that the segfault is the first crash I've seen that<br>
allowed be to get some clue to what is going on, and even then it<br>
isn't helpful for fixing it. I would say that at least 50% of all<br>
crashes in Xubuntu reported by apport are weird Thunar memory<br>
corruption bugs, and so far this is the most likely cause I have seen.<br>
<br>
Even though this particular error resulted in a segfault, it isn't<br>
difficult to imagine a situation where a pointer of the wrong type is<br>
written to. This would silently fail in the debug build, and corrupt<br>
memory in release. Neither of which is helpful.<br>
<br>
The question is what can we do about this? It's quite a big issue,<br>
_thunar_return_* is used approximately 1600 times in the Thunar source<br>
code.<br>
<br>
--<br>
Alistair Buxton<br>
<a href="mailto:a.j.buxton@gmail.com">a.j.buxton@gmail.com</a><br>
_______________________________________________<br>
Xfce4-dev mailing list<br>
<a href="mailto:Xfce4-dev@xfce.org">Xfce4-dev@xfce.org</a><br>
<a href="https://mail.xfce.org/mailman/listinfo/xfce4-dev" target="_blank">https://mail.xfce.org/mailman/listinfo/xfce4-dev</a><br>
</blockquote></div>