Bug 716447
Summary: | glib2 problem: hash table collisions | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Jose Pedro Oliveira <jose.p.oliveira.oss> |
Component: | glib2 | Assignee: | Colin Walters <walters> |
Status: | CLOSED WONTFIX | QA Contact: | desktop-bugs <desktop-bugs> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 5.6 | CC: | jose.p.oliveira.oss, rfranknj |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-06-02 13:05:57 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jose Pedro Oliveira
2011-06-24 13:42:54 UTC
This ticket can be closed (not a RHEL5 glib2 problem). The above example, showing similar behavior as the problematic syslog-ng test, is buggy: the keys/values inserted aren't being kept during the hash lifetime (missing at leat one g_strdup() before the hash_insert). ---------- - g_hash_table_insert(name_map, (gpointer)name, (gpointer)name); + gchar *dupname = g_strdup(name); + g_hash_table_insert(name_map, (gpointer)dupname, (gpointer)dupname); ---------- From the glib2 documentation: ... Note that neither keys nor values are copied when inserted into the GHashTable, so they must exist for the lifetime of the GHashTable. This means that the use of static strings is OK, but temporary strings (i.e. those created in buffers and those returned by GTK+ widgets) should be copied with g_strdup() before being inserted. If keys or values are dynamically allocated, you must be careful to ensure that they are freed when they are removed from the GHashTable, and also when they are overwritten by new insertions into the GHashTable. It is also not advisable to mix static strings and dynamically-allocated strings in a GHashTable, because it then becomes difficult to determine whether the string should be freed. ... This bug/component is not included in scope for RHEL-5.11.0 which is the last RHEL5 minor release. This Bugzilla will soon be CLOSED as WONTFIX (at the end of RHEL5.11 development phase (Apr 22, 2014)). Please contact your account manager or support representative in case you need to escalate this bug. Thank you for submitting this request for inclusion in Red Hat Enterprise Linux 5. We've carefully evaluated the request, but are unable to include it in RHEL5 stream. If the issue is critical for your business, please provide additional business justification through the appropriate support channels (https://access.redhat.com/site/support). The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days |