Bug 2431179

Summary: g_file_get_contents fails on windows with 'Invalid Argument'
Product: [Fedora] Fedora Reporter: Jean-Louis Dupond <jean-louis>
Component: mingw-glib2Assignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: fedora, kalevlember, manisandro, marcandre.lureau, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: mingw-glib2-2.87.1-2.fc44 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-01-20 13:08:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jean-Louis Dupond 2026-01-20 12:31:47 UTC
When doing a 'g_file_get_contents' call on windows, it fails with 'Invalid Argument'.

This happend when I build virt-viewer on Fedora Rawhide.

After some troubleshooting, I found out that rebuilding mingw-glib2 without the '0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch' fixes the issue.

Seems like the patch is already quite old, and most likely broke something in more recent glib2 versions.

Reproducible: Always

Comment 1 Richard W.M. Jones 2026-01-20 12:42:06 UTC
I agree.  The patch was added in 2012, and the upstream bug was "RESOLVED OBSOLETE"
in 2018.  If there is still an upstream bug that this patch is supposed to be fixing,
let's get upstream to fix it.  But it seems unlikely that is the case now.

Comment 2 Richard W.M. Jones 2026-01-20 12:43:48 UTC
Scratch build without the patch: https://koji.fedoraproject.org/koji/taskinfo?taskID=141343540

Comment 3 Fedora Update System 2026-01-20 13:06:11 UTC
FEDORA-2026-69ecceae52 (mingw-glib2-2.87.1-2.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-69ecceae52

Comment 4 Fedora Update System 2026-01-20 13:08:23 UTC
FEDORA-2026-69ecceae52 (mingw-glib2-2.87.1-2.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.