After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 615494 - Connction timeouts produce partially invalid error messages
Connction timeouts produce partially invalid error messages
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.24.x
Other Windows
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-04-12 05:58 UTC by morshed.nader
Modified: 2010-04-27 13:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample program to trigger invalid error message (427 bytes, text/plain)
2010-04-12 05:58 UTC, morshed.nader
  Details
GSocket: fix garbled error messages on windows (1.20 KB, patch)
2010-04-12 14:24 UTC, Dan Winship
committed Details | Review

Description morshed.nader 2010-04-12 05:58:49 UTC
Created attachment 158462 [details]
Sample program to trigger invalid error message

When trying to connect to a server with the function g_socket_client_connect_to_host, the error message produced is only valid for the first 146 bytes at which point garbage characters appear:

"Error connecting: A connection attempt failed because the connected party did not properly respond after a period of time, or established connecti\xb9\xadCg"

This has happened in 2.20 as well as 2.24, however I've only tested it with the connect_to_host function and its asynchronous counterpart. It happens consistently and without any apparent interference from other things.

I've attached a sample program to show how this error is triggered, using google.com, which lets the connections time out on the non-standard ports. Compile it with:

gcc `pkg-config gio-2.0 --cflags` -o connecterr network.c `pkg-config gio-2.0 --libs`
Comment 1 Tor Lillqvist 2010-04-12 07:03:18 UTC
Hmm, this is on Windows, so I might want to have a look eventually. On the other hand, I didn't write the code in question, so I don't want this to fall off the radar of those who feel responsible for the code in question by setting component to "win32". I wonder what would be the best way to keep it both on my radar (I currently use a search that looks for bugs assigned to gtk-win32-maint when looking for "my" bugs) *and* on the "GIO radar".
Comment 2 Dan Winship 2010-04-12 14:24:29 UTC
Created attachment 158489 [details] [review]
GSocket: fix garbled error messages on windows

not sure about the general problem of marking bugs both win32 and gio...
maybe we could cc: gtk-win32-maint?

anyway, this one is pretty easy; the code was trying to make
g_win32_error_message() behave more like strerror(), and failing.

Patch is untested; I tested that making the unix version work the same
way did the right thing there, so it's probably right, but...
Comment 3 morshed.nader 2010-04-12 15:31:23 UTC
Comment on attachment 158462 [details]
Sample program to trigger invalid error message

Fixed the MIME Type of the attachment
Comment 4 Tor Lillqvist 2010-04-27 06:56:13 UTC
I don't think you are going to get much testing by just waiting. Just commit and push, I'd say...
Comment 5 Dan Winship 2010-04-27 13:04:52 UTC
ok. (i tried testing it this weekend, but non-blocking connects weren't
working right in wine; the test program was failing-to-fail because wine
was claiming that the connect() succeeded.)

Attachment 158489 [details] pushed as 5046dfc - GSocket: fix garbled error messages on windows