Query on Glib 2.72 compatibility with Visual Studio 2012 Application


Recently, we have integrated Glib 2.72 version on our application which is built on VS2012. We are facing some issues recently with this application. Our application is crashing at ucrtbase.dll

Could you please help us to understand, can this Glib 2.72 version is compatible with VS 2012 ?


Hi @Hemanth!

Yes, GLib 2.72 fully supports VS2012. However VS2012 uses its own runtime library (msvcr110.dll) and not the UCRT (ucrtbase.dll). The UCRT is used starting with VS2015. Perhaps an other dependency is built with a newer VS version.

Could you get a Call Stack for the crash? See:

Thank you very much for the response! Please find the Exception stack details as mentioned below:

Exception thread stack:

0:314> ~#kv

ChildEBP RetAddr Args to Child

WARNING: Stack unwind information not available. Following frames may be wrong.

37d3fa80 64c5a301 82075710 00000000 37d3fac8 **ucrtbase!abort+0x4b**

37d3fb00 64c22eb6 64c65bb9 64c65d24 00000fba **libglib_2_0_0!g_thread_yield+0x91c1**

37d3fb20 64c50a7f 00000000 7fffffff 7fffffff libglib_2_0_0!**g_assertion_message_expr+0x56**

37d3fb30 64bf8ae2 64c65bb9 64c65d24 00000fba **libglib_2_0_0!g_mutex_unlock+0xf**

37d3fb50 64c50a7f 00000000 0000007d 00000093 **libglib_2_0_0!g_main_context_check+0x1a2**

37d3fb60 77e543e9 240cd9b0 772d6980 37d3fb88 **libglib_2_0_0!g_mutex_unlock+0xf**

37d3fb70 761d0b4c 00000003 091751b4 761d0b58 ntdll!RtlRestoreLastWin32Error+0x39

37d3fba0 64bf90f8 240cd9b0 7fffffff 4c6af438 **ucrtbase!isdigit+0x7c**

*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SYSTEM32\MSVCR110.dll -

37d3fbbc 7419a5e8 82d64900 ffffffff 00000001 libglib_2_0_0!g_main_context_dispatch+0x438

37d3fbec 74196420 82d64900 82d64904 016be900 MSVCR110!Concurrency::critical_section::scoped_lock::scoped_lock+0x3b

37d3fc00 64bf95c1 240cd9b0 6797891c 5fdc6048 MSVCR110!Concurrency::details::_Condition_variable::notify_one+0x3b

*** WARNING: Unable to verify checksum for C:\Program Files (x86)\Unisys\CMM\TeleServer.exe

37d3fc60 016bfa01 52345cf0 7415f28e 8d64a788 libglib_2_0_0!g_main_loop_run+0x71

*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SYSTEM32\MSVCP110.dll -

37d3fc70 740ce796 38338348 7415f28e 8d64a788 TeleServer!std::_LaunchPad<std::_Bind<1,void,void (__cdecl*const)(Media::VnmsStreamProcessor *),Media::VnmsStreamProcessor * const,std::_Nil,std::_Nil,std::_Nil,std::_Nil,std::_Nil,std::_Nil> >::_Go+0x11 (FPO: [0,0,0]) (CONV: thiscall) [c:\program files (x86)\microsoft visual studio 11.0\vc\include\thr\xthread @ 187]

37d3fc98 7415f2e9 6322d850 21d9ca85 7415f28e MSVCP110!std::_Pad::_Release+0x6c

37d3fcd0 7415f2cd 7415f28e 37d3fcf0 749d62c4 MSVCR110!_get_flsindex+0x61

*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\System32\KERNEL32.DLL -

37d3fcdc 749d62c4 9e626428 749d62a0 8dfcf869 MSVCR110!_get_flsindex+0x45

37d3fcf0 77e61b69 9e626428 091757e4 00000000 KERNEL32!BaseThreadInitThunk+0x24

37d3fd38 77e61b34 ffffffff 77e8342c 00000000 ntdll!RtlSubscribeWnfStateChangeNotification+0x439

37d3fd48 00000000 7415f28e 9e626428 00000000 ntdll!RtlSubscribeWnfStateChangeNotification+0x404

The stacktrace does not contain many info, but looksnlike a secondary thread is awaken to process a notification, and then tries to spin the GLib main loop. However a GMainContext can be used only from one thread at a time. I suggest using g_idle_add from the notification handler. g_idle_add queues a callback to be executed on the main thread. From the callback you can do anything with the GLib main loop safely

See GLib.idle_add

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.