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 143106 - Crashes when accessing preferences dialog
Crashes when accessing preferences dialog
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
unspecified
Other Linux
: High major
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2004-05-25 06:13 UTC by Alan Hamilton
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
correct data type (302 bytes, patch)
2004-05-25 17:57 UTC, Travis Snoozy
none Details | Review

Description Alan Hamilton 2004-05-25 06:13:41 UTC
Description of Problem:
When selecting Settings->Preferences, the
"Application quit unexpectedly" dialog appears.

Steps to reproduce the problem:
1. Start Blackjack
2. Select Settings->Preferences
3. Crash

Actual Results:
Application crashes

Expected Results:
Settings dialog appears

How often does this happen? 
Each time

Additional Information:
This appears to happen only on 64-bit platforms. 
I'm running Linux x86_64.  The bug is in
card_style_file_parse in card-style-file.c. 
"length" is declared as gint, but
g_file_get_contents takes a gsize *.  This isn't a
problem on 32 bit platforms, but on x86_64, gint
is 4 bytes and gsize is 8 bytes.  Changing "gint
length" to "gsize length" fixes the problems.

Although it works okay, there are other cases of
casting between gints and gpointers using (gint)
and (gpointer) which cause compiler warnings about
incompatible types.  These should be changed to
GPOINTER_TO_INT(data) and GINT_TO_POINTER(data).
Comment 1 Travis Snoozy 2004-05-25 17:57:16 UTC
Created attachment 28007 [details] [review]
correct data type

There was no patch attached, but I assume that this is what you are talking
about. I don't have a 64-bit machine to test this on, so if you could verify,
that would be great.

There does appear to be a more systemic problem with wonton casting between
pointers and ints... certainly a Bad Thing(tm) if I ever saw one.
Comment 2 William Jon McCann 2004-05-25 18:06:09 UTC
This is a bug in the gdk-card-image component.
Comment 3 Callum McKenzie 2004-05-25 22:25:47 UTC
We can get rid of gdk-card-image now can't we ? I mean aside from fixes for 2.6
neither aisleriot or blackjack use it right ?

As for the rest of the 64-bit stuff, I do have a 64-bit machine but my hacking
time has been taken up with finding 64-bit bugs in every module but my own one :).

I'll be going over it soon, but not for a day or so. Work and all that.
Comment 4 Alan Hamilton 2004-05-26 08:38:54 UTC
Yes, that patch resolved the problem.  The other pointer cases are mostly where 
an int is cast to a pointer and back, rather than trying to store a pointer in 
an int.  int to pointer to int works, but causes compiler warnings.  The 
conversion macros are really the way to go.

I'm sure the new 64 bit machines are going to shake out a lot of pointers or 
sizes being treated as ints.
Comment 5 Callum McKenzie 2004-05-26 11:06:58 UTC
I've just gone through and fixed all the compiler warnings generated
on my ppc64 system. Obviously this should work for x86_64 as well
even with the endianess difference. I have also applied the gsize
fix to the 2.6 branch. Back-porting the other changes can wait.