Bug 11295 - core File unter /var/cache/bind
core File unter /var/cache/bind
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: DNS
UCS 2.0
All Linux
: P2 normal (vote)
: UCS 3.1
Assigned To: Stefan Gohmann
Philipp Hahn
: interim-2
: 18964 (view as bug list)
Depends on:
Blocks: 10356
  Show dependency treegraph
 
Reported: 2008-06-02 14:13 CEST by Sönke Schwardt-Krummrich
Modified: 2012-12-12 21:07 CET (History)
5 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
gdb backtrace (1.61 KB, text/plain)
2012-09-04 15:10 CEST, Arvid Requate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2008-06-02 14:13:58 CEST
Sobald ein "/etc/init.d/univention-bind (re)start" ausgeführt wird, liegt unter /var/cache/bind ein core-File vom Bind-Prozess.
Der Dienst scheint dadurch nicht beeinträchtigt zu sein.
Comment 1 Murat Odabas univentionstaff 2008-07-17 16:40:18 CEST
Beim Löschen einer Reverse-Zone wird auch ein core-file unter /var/cache/bind
erzeugt. Dieses Verhalten wurde bei einem Kunden festgestellt und von mir reproduziert.

Ticket Nr.: 2008071710000155
Comment 2 Tobias Scherer univentionstaff 2009-09-14 11:25:31 CEST
auch berichtet an Ticket#: 2009091410000404
Comment 3 Kevin Dominik Korte univentionstaff 2011-10-05 14:58:19 CEST
*** Bug 18964 has been marked as a duplicate of this bug. ***
Comment 4 Kevin Dominik Korte univentionstaff 2011-10-05 15:19:44 CEST
Das Problem liegt im directory listener. Es tritt auf wenn der univention-bind-proxy synchronisiert wird.
e.g. univention-directory-listener-ctrl resync bind
Es ist insoweit problematisch, als das zonen für die es einen Falschen eintrag gibt nicht mehr synchronisiert werden.

Das löschen von /var/cache/bind/* und der neustart beheben das problem, bis zur nächsten DNS Aktualisierung.
Comment 5 Kevin Dominik Korte univentionstaff 2011-10-05 15:48:03 CEST
Das Problem bleibt in UCS 3 MS 2 bestehen.

Die Effekte lassen sich mit folgendem befehl beheben:
rndc -p 953 retransfer <zone>
Comment 6 Stefan Gohmann univentionstaff 2012-07-17 17:09:33 CEST
UCS 3.1 will be the next release.
Comment 7 Arvid Requate univentionstaff 2012-09-04 15:10:00 CEST
Created attachment 4638 [details]
gdb backtrace

root@10:~/src# ucr search dns/backend
dns/backend: ldap
root@10:~/src# /etc/init.d/bind9 start
Starting bind9 daemon:.
done.
root@10:~/src# ls -l /var/cache/bind/corels: Zugriff auf /var/cache/bind/core nicht möglich: Datei oder Verzeichnis nicht gefunden
root@10:~/src# /etc/init.d/bind9 stop
Stopping bind9 daemon: .
done.
root@10:~/src# ls -l /var/cache/bind/core
-rw------- 1 bind bind 31641600 31. Aug 12:36 /var/cache/bind/core
Comment 8 Philipp Hahn univentionstaff 2012-09-04 16:08:07 CEST
gdb ./bin/named/.libs/named
(gdb) set args -p 7777 -u bind -f
(gdb) run
^C
(gdb) signal SIGTERM
Continuing with signal SIGTERM.
[Thread 0xb75d8b70 (LWP 10229) exited]
[Thread 0xb6dd7b70 (LWP 10230) exited]
*** glibc detected *** /root/bind9-9.8.0.P4/bin/named/.libs/named: munmap_chunk(): invalid pointer: 0xb75dd170 ***
...
(gdb) up 6
#6  0x080bfc4a in ldapdb_getconn (data=0x0) at ldapdb.c:137
137                                     free(conndata->index);
(gdb) print conndata
$1 = (struct ldapdb_entry *) 0x80f68d8
(gdb) print *conndata
$2 = {index = 0xb75dd170, size = 14, data = 0x80f76a0, next = 0x0}

bin/named/ldapdb.c:529
        data->hostport = isc_mem_strdup(ns_g_mctx, argv[0] + strlen("ldap://"));
bin/named/ldapdb.c:188
                conndata->index = data->hostport;
bin/named/ldapdb.c:133
                        free(threaddata->index);


--- bin/named/ldapdb.c.orig  2012-09-04 16:06:53.508436187 +0200
+++ bin/named/ldapdb.c     2012-09-04 16:06:45.260486007 +0200
@@ -133,7 +133,7 @@ ldapdb_getconn(struct ldapdb_data *data)
                        free(threaddata->index);
                        while (threaddata->data != NULL) {
                                conndata = threaddata->data;
-                               free(conndata->index);
+                               isc_mem_free(ns_g_mctx, conndata->index);
                                if (conndata->data != NULL)
                                        ldap_unbind_ext((LDAP *)conndata->data, NULL, NULL);
                                        //ldap_unbind((LDAP *)conndata->data);
@@ -179,7 +179,7 @@ ldapdb_getconn(struct ldapdb_data *data)
                conndata = malloc(sizeof(*conndata));
                if (conndata == NULL)
                        return (NULL);
-               conndata->index = data->hostport;
+               conndata->index = isc_mem_strdup(ns_g_mctx, data->hostport);
                conndata->size = strlen(data->hostport);
                conndata->data = NULL;
                ldapdb_insert((struct ldapdb_entry **)&threaddata->data,
Comment 9 Philipp Hahn univentionstaff 2012-09-05 15:47:10 CEST
(In reply to comment #8)
...
> -                               free(conndata->index);
> +                               isc_mem_free(ns_g_mctx, conndata->index);
...
> -               conndata->index = data->hostport;
> +               conndata->index = isc_mem_strdup(ns_g_mctx, data->hostport);
...

<http://bind9-ldap.bayour.com/>
2011-09-22
Fix for multithreaded ('Double Free') environments. Thanx for Yoann Courbet for reporting this bug to me and showing me where a patch for it could be found.

<https://github.com/FransUrbo/bind9-ldap/blob/master/ldapdb.c#L195>
Comment 10 Stefan Gohmann univentionstaff 2012-10-10 08:37:47 CEST
Patch aus http://www.pynix.org/webcvs/index.cgi/AppKit/common/net/bind/patches/003-fix-sdb-ldap-double-free.patch?revision=1.1&view=markup&pathrev=ak37 wurde übernommen.

Damit konnte der Absturz nicht mehr reproduziert werden.
Comment 11 Philipp Hahn univentionstaff 2012-10-17 11:50:27 CEST
OK: ChangeLog
OK: svn10954 ist identisch mit dem Upstream-Commit <https://github.com/FransUrbo/bind9-ldap/commit/1182567281f34a60f4c390d5c7f9c1042019e02a>
OK: /etc/init.d/bind9 restart
OK: bind9_1:9.8.0.P4-1.97.201207021548
Comment 12 Stefan Gohmann univentionstaff 2012-12-12 21:07:46 CET
UCS 3.1-0 has been released: 
 http://forum.univention.de/viewtopic.php?f=54&t=2125

If this error occurs again, please use "Clone This Bug".