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 110485 - gtkcurve seg-fault on gtk_curve_set_curve_type
gtkcurve seg-fault on gtk_curve_set_curve_type
Status: RESOLVED DUPLICATE of bug 57012
Product: gtk+
Classification: Platform
Component: Widget: Other
2.2.x
Other All
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-04-10 18:46 UTC by R. McFarland
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that at least avoids the seg-fault. don't know how valid the state is though (763 bytes, patch)
2003-04-10 18:47 UTC, R. McFarland
none Details | Review

Description R. McFarland 2003-04-10 18:46:18 UTC
when calling gtk_curve_set_curve_type( GTK_CURVE(curve),
GTK_CURVE_TYPE_XXX) on a widget that hasn't been realized yet a seg-fault
occurs. this is known to happen in 2.0 on an out of the box RH8.0 install
and on a locally build 2.2.1. the problem doesn't seem to be corrected in
the cvs HEAD. (should occur on any system)

example code to exercsize bug:

GtkWidget * curve;
curve = gtk_curve_new();
gtk_curve_set_curve_type( GTK_CURVE(curve), GTK_CURVE_TYPE_LINEAR);

in the process of changing c->curve_type several operations are completed
on the GtkCurve object that seem to assume that it has been realized.
namely a g_malloc is called on the width of the widget (which is -5 at the
time) which causes a failure to allocate memory. the correction is rather
simple and will be attached (as a patch) to this bug.
Comment 1 R. McFarland 2003-04-10 18:47:29 UTC
Created attachment 15620 [details] [review]
patch that at least avoids the seg-fault. don't know how valid the state is though
Comment 2 Owen Taylor 2003-04-10 21:16:59 UTC
Trying to fix doing-stuff-to-GtkCurve-before-realization
would require a thorough examination of the code base
and a lot of testing.

GtkCurve is probably not something you want to use anyways. :-)


*** This bug has been marked as a duplicate of 57012 ***