Web lists-archives.com

g_stat() In src/glade3-3.8.5/gladeui/glade-utils.c At Line 1865 Causes SIGSEGV in strlen () from C:\Windows\System32\msvcrt.dll When Saving File

Posted Here Also:

This may strictly be an issue on MSYS64 / MinGW64. That is unknown.

The problem has been duplicated: https://github.com/Alexpux/MINGW-packages/issues/3780

The Runtime Environment Is MSYS64 / MinGW64. (MSYS2 20161025 Upgraded with pacman -Syu). It worked fine, previous to my most recent set of pacman updates.

When running: /mingw64/bin/glade-3.exe

And I try to save a file, after selecting or entering a filename, and clicking Save in the File Chooser Dialog, the program crashes, (segfaults), and the file size is zero.

When I use gdb to troubleshoot the Segmentation Fault, I get the following:

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff90f48c981 in strlen () from C:\Windows\System32\msvcrt.dll

Whether I run an executable installed by pacman or built from source.

When I build from source and enable debugging symbols, I get more info as below, but in the first few lines it identifies the file and line below, and the problem has been isolated to that line.

(gdb) bt
    #0 0x00007ff90f48c981 in strlen () from C:\Windows\System32\msvcrt.dll
    #1 0x0000000068611286 in ?? () from C:\msys64\mingw64\bin\libglib-2.0-0.dll
    #2 0x0000000068611f25 in ?? () from C:\msys64\mingw64\bin\libglib-2.0-0.dll
    #3 0x0000000062dbdab4 in glade_util_get_file_mtime (filename=0x0,
error=error@entry=0x0) at ../../glade3-3.8.5/gladeui/glade-utils.c:1865

When I change line 1865 of glade-utils.c from:

retval = g_stat (filename, &info);


retval = stat (filename, &info);

I get the following warning:

warning: Invalid parameter passed to C runtime function.

But the program appears to save the file correctly.

If I hardcode it like this:

1865 // retval = g_stat (filename, &info); 
1866 retval = 0;
I get a message about the filename being null, and it does not appear to save the file correctly, but it does not segfault.

Below is my history of Gtk2 and Glib Installation:

$ grep mingw-w64-x86_64-gtk2 /var/log/pacman.log | grep installed
[2017-11-19 19:29] [ALPM] installed mingw-w64-x86_64-gtk2 (2.24.31-6)

[2018-05-11 02:18] [ALPM] reinstalled mingw-w64-x86_64-gtk2 (2.24.32-1)

$ grep mingw-w64-x86_64-glib2 /var/log/pacman.log | grep installed
[2017-11-19 19:26] [ALPM] installed mingw-w64-x86_64-glib2 (2.54.2-1)

[2018-05-11 01:58] [ALPM] reinstalled mingw-w64-x86_64-glib2 (2.56.1-1)

Glade Version is 3.8.5

Source Info:



gtk-devel-list mailing list