[osgeo4w-dev] [Qgis-developer] Crash in thread on FILE opened by a lib compiled by MinGW

Radim Blazek radim.blazek at gmail.com
Fri Jun 19 03:00:07 PDT 2015

On Fri, Jun 19, 2015 at 11:27 AM, Jürgen E. <jef at norbit.de> wrote:
> Hi Radim,
> On Fri, 19. Jun 2015 at 11:04:39 +0200, Radim Blazek wrote:
>> I am trying to fix QGIS (compiled by MSVC) crashes with GRASS 7
>> (compiled by MinGW) on Windows. I have traced down that it crashes
>> when functions are called on a FILE structure which was created by a
>> library (libgrass_gis.7.0.0.dll in this case) compiled by MinGW in a
>> thread in an application compiled by MSVC. It crashes in Microsoft
>> _lock_file(FILE *pf) where pf is casted to _FILEX:
> Did you also track down what calls that?
> Maybe something in QGIS that uses a file pointer function (fclose?) on
> something returned from GRASS?  There should be some G_ function to call
> instead.

It is called by GRASS functions, but I have mixed GRASS gis lib
compiled by MinGW with GRASS vector lib compiled by MSVC to be able to
debug at all. That is causing the problem I have described. So I am
back on the beginning not being able to debug with crashing libs
(MinGW) and not getting the crash with debuggable libs (MSVC).


> I remember there was something similar that happend when GRASS was using a MSVC
> built libpng (not lock_file in particular, but mixing up msvcrt file pointers).
> Jürgen
> --
> Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31
> Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50
> Software Engineer           D-26506 Norden             http://www.norbit.de
> QGIS release manager (PSC)  Germany                    IRC: jef on FreeNode

More information about the osgeo4w-dev mailing list