[Bug jit/98586] libgccjit crashes with segmentation fault on failed gcc_assert

keith.marshall at mailinator dot com gcc-bugzilla@gcc.gnu.org
Fri Jan 8 11:18:27 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98586

--- Comment #2 from Keith Marshall <keith.marshall at mailinator dot com> ---
(In reply to David Malcolm from comment #1)
> I looked at calling diagnostic_initialize.
> 
> Unfortunately, libgccjit supports being linked into multithreaded processes,
> and it guards all of the regular compiler state with a single big mutex,
> including the diagnostic subsystem (and the "global_dc" pointer implicitly
> used by fancy_abort).  This failure is happening before the mutex is
> acquired.

Indeed, yes.  I actually patched the mutex acquisition/release code, to use a
native MS-Windows critical section, in preference to the alien pthreads mutex:

  https://osdn.net/ticket/download.php?group_id=3917&tid=41070&file_id=5791

I thought that, maybe, it was my modification which led to the crash; I was
surprised to find that execution never reached my modified code.

> I'm not sure yet what the best fix is.

I don't know the GCC internals well enough, to advise on this, but I'm willing
to assist with testing, in any way that I can.  In the meantime, I've patched
around the flawed assumption, which leads to the failing assertion, in the
first place:

  https://osdn.net/ticket/download.php?group_id=3917&tid=41070&file_id=5799

Thanks for your attention.


More information about the Gcc-bugs mailing list