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 588989 - optional flag in Glib::OptionEntry cause crash is the arg is omitted
optional flag in Glib::OptionEntry cause crash is the arg is omitted
Status: RESOLVED NOTABUG
Product: glibmm
Classification: Bindings
Component: general
2.20.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
: 588990 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-07-19 00:14 UTC by Hubert Figuiere (:hub)
Modified: 2009-07-19 14:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (793 bytes, text/x-c++src)
2009-07-19 00:14 UTC, Hubert Figuiere (:hub)
Details

Description Hubert Figuiere (:hub) 2009-07-19 00:14:22 UTC
If I set   entry.set_flags(Glib::OptionEntry::FLAG_OPTIONAL_ARG); to a Glib::OptionEntry, the program crashes when I really omit the argument.

Attached is a sample code.

./optiontest --search
crash

./optiontest --search=text
works
Comment 1 Hubert Figuiere (:hub) 2009-07-19 00:14:50 UTC
Created attachment 138714 [details]
test case
Comment 2 Hubert Figuiere (:hub) 2009-07-19 03:07:31 UTC
Sorry, that's actually a glib crash. It seems that this flag only applies to  G_OPTION_ARG_CALLBACK arg types.

The fact that Glibmm does not seem to allow these is a different story. Not a Glibmm bug.
Comment 3 Hubert Figuiere (:hub) 2009-07-19 03:08:23 UTC
*** Bug 588990 has been marked as a duplicate of this bug. ***
Comment 4 Murray Cumming 2009-07-19 08:24:42 UTC
I guess that glib should at least show a critical warning before crashing. If it doesn't, please file a glib bug.

Should we prevent the use of the wrong flags with the wrong type of arguments in glibmm?
http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionFlags
Comment 5 Hubert Figuiere (:hub) 2009-07-19 14:02:06 UTC
It does an then crash. It is definitely not Glibmm.