Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #3780

Closed
TalkVideo opened this issue May 19, 2018 · 17 comments
Labels

Comments

@TalkVideo
Copy link

TalkVideo commented May 19, 2018

When I run
/mingw64/bin/glade-3.exe

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

I get:

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

Whether installed by pacman or built from source,

When I enable debugging symbols I get more info as below, but at the top of the stack, it mentions 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:
1865 retval = g_stat (filename, &info);
To:
retval = stat (filename, &info);

In
src/glade3-3.8.5/gladeui/glade-utils.c

I get:
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 is 3.8.5

Source:
pkgver=3.8.5
pkgrel=2
sha256sums=('58a5f6e4df4028230ddecc74c564808b7ec4471b1925058e29304f778b6b2735')

It was working fine before. Please fix it. Thx.

@peterbud
Copy link
Contributor

For me glade-3 3.8.5 is working fine (using from the repo). However I'd suggest to use the much more up-to-date glade (3.22.1).

@TalkVideo
Copy link
Author

I need a Glade that is suitable for Gtk2.

I use the newer Glade for Gtk3.

You may see the same error if you do a pacman -Syu

I think an update to mingw-w64-x86_64-glib2 did it. I will be testing earlier commits, as well.

@peterbud
Copy link
Contributor

I have done pacman -Syu before I sent you my reply. Maybe @KrullBorg can also check, he is using glade AFAIK.

@KrullBorg
Copy link
Contributor

the problem isn't well explained, but i get segfault on saving the file, and the file is 0 size; have you tried to update glade3 to 3.8.6?

@TalkVideo
Copy link
Author

I apologize. I forgot to mention that it happens when I try to save a file. The program crashes, (segfaults), and file size is zero, after selecting or entering a filename, and clicking Save in the File Chooser Dialog. So, @KrullBorg you have duplicated it.

I will try upgrade. I was not aware 5.8.6 is out there. Thx.

@TalkVideo TalkVideo changed the title 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 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 May 21, 2018
@TalkVideo
Copy link
Author

I looked here for 3.8.6:
http://repo.msys2.org/mingw/

None there. Do you mean source from https://glade.gnome.org/ or is there a mingw-w64-x86_64 package available for 3.8.6? Thanks.

@KrullBorg
Copy link
Contributor

Merely update PKGBUILD file and rebuild it

@Alexpux
Copy link
Member

Alexpux commented May 22, 2018

@TalkVideo I'm upload 3.8.6 version. Try it

@TalkVideo
Copy link
Author

Thanks.

I did have the same problem when building from 3.8.6 source downloaded from https://glade.gnome.org

I just tried glade-3.exe (3.8.6) installed via pacman -Syu

Same problem.

I have not yet tried a simple program with a call to g_stat() but I think the problem may actually be in glib-2.0. I will try reverting to a previous glib-2.0.

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

@TalkVideo
Copy link
Author

@TalkVideo
Copy link
Author

See:
https://mail.gnome.org/archives/gtk-devel-list/2018-May/msg00033.html

Looks like there was an update, (and a backport) in glib2.

For the mingw-w64-glib2 Source Package, I am at commit:
6b196d8

Also in /var/log/pacman:
[2018-06-04 08:38] [ALPM] upgraded mingw-w64-x86_64-glib2 (2.56.1-1 -> 2.56.1-2)
[2018-06-04 08:38] [ALPM] upgraded mingw-w64-x86_64-glib-networking (2.56.0-2 -> 2.56.1-1)

But...
(Get-Item C:\msys64\mingw64\bin\libglib-2.0-0.dll).VersionInfo
returns:

ProductVersion FileVersion FileName


2.56.1 2.56.1.0 C:\msys64\mingw64\bin\libglib-2.0-0.dll

Looks like this update may not be in place yet. Still having the same problem. Checking further.

@lazka
Copy link
Member

lazka commented Jul 12, 2018

The fix was https://gitlab.gnome.org/GNOME/glib/commit/0bc1e98af6f6ed2f4a5f05f495b0c9a001dc370f

This will either be fixed with glib 2.56.2 or 2.58.0, which ever comes first.

@lazka
Copy link
Member

lazka commented Sep 1, 2018

The first fix is in, but this could also have been 9533ee7 which would need a rebuild of glade.

Is this still a problem?

@lazka lazka added the needinfo label Sep 1, 2018
@TalkVideo
Copy link
Author

TalkVideo commented Sep 27, 2018

On MSYS2, MinGW64 Environment, it still is.

When running glade-3.exe, (Help->About Says 3.8.6)

pacman -Sl
mingw-w64-x86_64-glade3 3.8.6-1

When rebuilding mingw-w64-glade3 from source at commit:
2155c28

The problem persists.

When looking at the source of: mingw-w64-glib2 (Same Commit as above)
src/glib-2.56.1/glib/gstdio.c

I do not see the change to gstdio.c that is mentioned here:
https://gitlab.gnome.org/GNOME/glib/commit/0bc1e98af6f6ed2f4a5f05f495b0c9a001dc370f

Also, PKGBUILD starts as follows which is not the same as this commit:
Alexpux@9533ee7

_realname=glib2
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.58.1
pkgrel=1
url="https://www.gtk.org/"
arch=('any')
pkgdesc="Common C routines used by GTK+ 2.4 and other libs (mingw-w64)"

And then when I try to build with makepkg-mingw:

(I installed mingw-w64-x86_64-meson)

==> Build static version
Traceback (most recent call last):
File "C:\msys64\mingw64\bin\meson-script.py", line 6, in
from pkg_resources import load_entry_point
File "C:/msys64/mingw64/lib/python3.6/site-packages\pkg_resources_init_.py", line 3095, in
@call_aside
File "C:/msys64/mingw64/lib/python3.6/site-packages\pkg_resources_init
.py", line 3079, in call_aside
f(*args, **kwargs)
File "C:/msys64/mingw64/lib/python3.6/site-packages\pkg_resources_init
.py", line 3108, in initialize_master_working_set
working_set = WorkingSet.build_master()
File "C:/msys64/mingw64/lib/python3.6/site-packages\pkg_resources_init
.py", line 570, in build_master
ws.require(requires)
File "C:/msys64/mingw64/lib/python3.6/site-packages\pkg_resources_init
.py", line 888, in require
needed = self.resolve(parse_requirements(requirements))
File "C:/msys64/mingw64/lib/python3.6/site-packages\pkg_resources_init
.py", line 774, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'meson==0.48.0' distribution was not found and is required by the application
==> ERROR: A failure occurred in build().
Aborting...

@lazka
Copy link
Member

lazka commented Sep 28, 2018

You need to update MSYS2 before installing new packages pacman -Suy

@TalkVideo
Copy link
Author

Actually I did that and for whatever reason I still had the problem. Even after removing and re-installing glade, and even libglade, I think. Not sure what I may have missed.

However, on more than one machine with fresh install, or fresh update of MSYS2, the problem is gone.

Issue closed as far as I am concerned.
Thanks.

@lazka lazka closed this as completed Oct 3, 2018
@lazka
Copy link
Member

lazka commented Oct 3, 2018

Thanks for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants