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 553024 - switching notebook pages while removing them fails ungracefully
switching notebook pages while removing them fails ungracefully
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.4.x
Other Linux
: Normal minor
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2008-09-20 16:28 UTC by Sakari Bergen
Modified: 2009-07-23 05:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase for the bug (2.46 KB, text/plain)
2008-09-20 16:30 UTC, Sakari Bergen
Details

Description Sakari Bergen 2008-09-20 16:28:20 UTC
When removing pages from a notebook, using set_current_page() with an invalid page number sometimes causes it to fail ungracefully.

I'll attach a test case which shows this behavior. The page switch signal triggers a function that prevents the user from selecting the last page (I'm using this in http://beatwaves.net/files/images/software/summercode/all/sshot.png ). For some reason this causes a crash when removing pages from a notebook with only two pages. With a notebook with three pages it doesn't crash, hence the "add third page" button in the test application.

The crash can be avoided by manually testing that the requested page is valid, but nevertheless, the behavior is buggy IMO.
Comment 1 Sakari Bergen 2008-09-20 16:30:09 UTC
Created attachment 119042 [details]
Testcase for the bug

compile with:
g++ `pkg-config --libs --cflags gtkmm-2.4` -o crash crash.cc
Comment 2 Johannes Schmid 2009-04-22 07:20:54 UTC
I tried with your test application but cannot reproduce the crash with lastest gtkmm. Everything seems to work fine. Can you be more specific what and how I have to click in the crash application to get the crash?

Thanks!
Comment 3 Sakari Bergen 2009-04-22 08:47:44 UTC
In the test application, clicking "Remove all but last page" _without_ doing anything before that causes me a segfault with gtkmm 2.12.5 (on Ubuntu 8.04).
If I click "Add third page" _before_ "Remove all but last page" all is fine.

If this behavior is not present in newer gtkmm the bug can be closed...
Comment 4 Johannes Schmid 2009-04-23 10:07:52 UTC
I guess it is best you check yourself once you update to a more recent version. At least I cannot reproduce it here.
Comment 5 Murray Cumming 2009-07-20 11:30:11 UTC
Sakari, could you please check this?
Comment 6 Sakari Bergen 2009-07-23 05:10:09 UTC
Sorry this took so long, confirmed to be fixed in 2.16.0.