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 345099 - add a way make modules always resident
add a way make modules always resident
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gmodule
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Tim Janik
gtkdev
Depends on:
Blocks:
 
 
Reported: 2006-06-16 12:46 UTC by Christian Persch
Modified: 2011-02-18 15:55 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
proposed patch (1.37 KB, patch)
2006-06-16 12:47 UTC, Christian Persch
none Details | Review
updated patch (2.38 KB, patch)
2006-08-05 13:11 UTC, Christian Persch
none Details | Review
updated patch (4.56 KB, patch)
2006-09-11 12:33 UTC, Christian Persch
none Details | Review

Description Christian Persch 2006-06-16 12:46:56 UTC
For debugging purposes I've occasionally found it useful to make all gmodules resident. For example, when a module leaks memory and is later unloaded, the stack trace in valgrind is rather useless. (Of course this can also hide some bugs!)
Comment 1 Christian Persch 2006-06-16 12:47:16 UTC
Created attachment 67482 [details] [review]
proposed patch
Comment 2 Michael Natterer 2006-06-22 12:29:17 UTC
That patch looks really useful. While resident modules of course hide
some bugs, I see no other way of properly valgrinding their memleaks
(as you said).
Comment 3 Matthias Clasen 2006-06-22 13:00:52 UTC
I have no objections to it, please go ahead.

What it needs though is to find the place in the api docs where we mention
the other DEBUG env vars, and add a note about G_MODULE_DEBUG
Comment 4 Tim Janik 2006-06-22 13:50:02 UTC
i think instead of G_MODULE_DEBUG, we can simply use G_DEBUG=resident-modules.
other than that, the patch looks good and makes sense to me.
Comment 5 Christian Persch 2006-08-05 13:11:05 UTC
Created attachment 70257 [details] [review]
updated patch

Reuse G_DEBUG env variable, and add documentation.
Comment 6 Tim Janik 2006-09-11 11:33:00 UTC
the patch looks mostly ok, allthough, we don't prefix "_g_" internal static variables in glib.
and, while we're at it, a second flag should be supported as well, "non-lazy-modules" which overrides G_MODULE_BIND_LAZY to cause modules to be loaded with BIND_NOW behaviour always.
allthough "bind-now-modules" would be an alternative non-negative flag name, i'm not sure it's really better, i'm open for suggestions.
Comment 7 Christian Persch 2006-09-11 12:33:18 UTC
Created attachment 72547 [details] [review]
updated patch

Implement bind-now-modules flag, and remove _g_ prefix.

(In reply to comment #6)
> the patch looks mostly ok, allthough, we don't prefix "_g_" internal static
> variables in glib.

Actually you do, or at least the debug code in glib/gmessages.c that I oriented myself at for this code does :)

> and, while we're at it, a second flag should be supported as well,
> "non-lazy-modules" which overrides G_MODULE_BIND_LAZY to cause modules to be
> loaded with BIND_NOW behaviour always.
> allthough "bind-now-modules" would be an alternative non-negative flag name,
> i'm not sure it's really better, i'm open for suggestions.

I like the positive name better.
Comment 8 Michael Natterer 2006-09-11 12:54:48 UTC
I think bind-now-modules is better as it matches resident-modules, and
it also would cause less confusion if we decide we need lazy-modules
at some point.
Comment 9 Tim Janik 2006-09-11 13:11:51 UTC
thanks, applied.