OpenOffice.org-2.0.4rc1 compile problems on -CURRENT

Kostik Belousov kostikbel at gmail.com
Sat Sep 16 00:28:14 PDT 2006


On Fri, Sep 15, 2006 at 02:17:12PM -0400, Jung-uk Kim wrote:
> On Thursday 14 September 2006 10:19 pm, Nicolas Blais wrote:
> --- >8 --- SNIP!!! --- >8 ---
> > =============
> > Building project udkapi
> > =============
> > /usr/ports/editors/openoffice.org-2.0/work/OOD680_m3/udkapi/com/sun
> >/star/uno mkout -- version: 1.7
> > idlc @/tmp/mkmJ4vAL
> > idlc: compile 'Exception.idl' ...
> > idlc: could not load registry dll.
> > idlc: detected 1 errors
> > Sun Microsystems (R) idlc Version 1.1
> >
> > dmake:  Error code 1, while
> > making '../../../../unxfbsdi.pro/misc/urd_cssuno.don'
> > '---* tg_merge.mk *---'
> >
> > ERROR: Error 65280 occurred while
> > making
> > /usr/ports/editors/openoffice.org-2.0/work/OOD680_m3/udkapi/com/sun
> >/star/uno dmake:  Error code 1, while making
> > 'build_instsetoo_native' '---* *---'
> > *** Error code 255
> >
> > Stop in /usr/ports/editors/openoffice.org-2.0.
> >
> > The port tree is up to date and so is -CURRENT. Any suggestions?
> 
> src/libexec/rtld-elf/rtld.c 1.117 has serious regression:
> 
> http://docs.freebsd.org/cgi/mid.cgi?200609081459.k88ExtSR084500
> 
> You can revert to 1.116 and pass this but there is some other 
> issues. :-(
> 
> Jung-uk Kim

First,
sorry for breakage. I will be unable to test anything on CURRENT until monday.
The problem (at least the one uncovered by Jung-uk Kim test) is as follows:

if libdl1.so is dlopened(), and it depends on libdl2.so, then, after 1.117,
dlopen()ing libdl2.so and trying to find some symbols from libdl2.so fails.
I did not realized that dagmembers of Obj_Entry is built for root only (in
this case, libdl1.so).

SUSv3 specifies the following rules for symbol lookup:
The dlsym() function shall search for the named symbol in all objects loaded
automatically as a result of loading the object referenced by handle.
The symbol resolution algorithm used shall be dependency order as described
in dlopen().

Below is the corrected version of the patch for RELENG_6 (I ran the test
supplied by Jung-uk Kim, both tests passed).

Index: rtld.c
===================================================================
RCS file: /usr/local/arch/ncvs/src/libexec/rtld-elf/rtld.c,v
retrieving revision 1.106.2.3
diff -u -r1.106.2.3 rtld.c
--- rtld.c	2 Sep 2006 20:38:13 -0000	1.106.2.3
+++ rtld.c	16 Sep 2006 07:26:14 -0000
@@ -110,7 +110,7 @@
 static Objlist_Entry *objlist_find(Objlist *, const Obj_Entry *);
 static void objlist_init(Objlist *);
 static void objlist_push_head(Objlist *, Obj_Entry *);
-static void objlist_push_tail(Objlist *, Obj_Entry *);
+static Objlist_Entry *objlist_push_tail(Objlist *, Obj_Entry *);
 static void objlist_remove(Objlist *, Obj_Entry *);
 static void objlist_remove_unref(Objlist *);
 static void *path_enumerate(const char *, path_enum_proc, void *);
@@ -123,7 +123,7 @@
 static const Elf_Sym *symlook_default(const char *, unsigned long hash,
   const Obj_Entry *refobj, const Obj_Entry **defobj_out, bool in_plt);
 static const Elf_Sym *symlook_list(const char *, unsigned long,
-  Objlist *, const Obj_Entry **, bool in_plt, DoneList *);
+  const Objlist *, const Obj_Entry **, bool in_plt, DoneList *);
 static void trace_loaded_objects(Obj_Entry *obj);
 static void unlink_object(Obj_Entry *);
 static void unload_object(Obj_Entry *);
@@ -1020,13 +1020,16 @@
 init_dag1(Obj_Entry *root, Obj_Entry *obj, DoneList *dlp)
 {
     const Needed_Entry *needed;
+    Objlist_Entry *elm;
 
     if (donelist_check(dlp, obj))
 	return;
 
     obj->refcount++;
     objlist_push_tail(&obj->dldags, root);
-    objlist_push_tail(&root->dagmembers, obj);
+    elm = objlist_push_tail(&root->dagmembers, obj);
+    if (root != obj)
+        STAILQ_INSERT_TAIL(&obj->dagmembers, elm, link);
     for (needed = obj->needed;  needed != NULL;  needed = needed->next)
 	if (needed->obj != NULL)
 	    init_dag1(root, needed->obj, dlp);
@@ -1402,7 +1405,7 @@
     STAILQ_INSERT_HEAD(list, elm, link);
 }
 
-static void
+static Objlist_Entry *
 objlist_push_tail(Objlist *list, Obj_Entry *obj)
 {
     Objlist_Entry *elm;
@@ -1410,6 +1413,7 @@
     elm = NEW(Objlist_Entry);
     elm->obj = obj;
     STAILQ_INSERT_TAIL(list, elm, link);
+    return elm;
 }
 
 static void
@@ -1810,21 +1814,18 @@
 	    return NULL;
 	}
 
+	DoneList donelist;
+	const Objlist *search_list;
+	donelist_init(&donelist);
 	if (obj->mainprog) {
-	    DoneList donelist;
-
-	    /* Search main program and all libraries loaded by it. */
-	    donelist_init(&donelist);
-	    def = symlook_list(name, hash, &list_main, &defobj, true,
-	      &donelist);
+		/* Search main program and all libraries loaded by it. */
+		search_list = &list_main;
 	} else {
-	    /*
-	     * XXX - This isn't correct.  The search should include the whole
-	     * DAG rooted at the given object.
-	     */
-	    def = symlook_obj(name, hash, obj, true);
-	    defobj = obj;
+		/* Search the DAG rooted at the given object */
+		search_list = &obj->dagmembers;
 	}
+	def = symlook_list(name, hash, search_list, &defobj, true,
+			   &donelist);
     }
 
     if (def != NULL) {
@@ -2274,7 +2275,7 @@
 }
 
 static const Elf_Sym *
-symlook_list(const char *name, unsigned long hash, Objlist *objlist,
+symlook_list(const char *name, unsigned long hash, const Objlist *objlist,
   const Obj_Entry **defobj_out, bool in_plt, DoneList *dlp)
 {
     const Elf_Sym *symp;

UNTESTED version of patch against 1.117:

Index: rtld.c
===================================================================
RCS file: /usr/local/arch/ncvs/src/libexec/rtld-elf/rtld.c,v
retrieving revision 1.117
diff -u -r1.117 rtld.c
--- rtld.c	8 Sep 2006 14:59:54 -0000	1.117
+++ rtld.c	16 Sep 2006 07:27:08 -0000
@@ -111,7 +111,7 @@
 static Objlist_Entry *objlist_find(Objlist *, const Obj_Entry *);
 static void objlist_init(Objlist *);
 static void objlist_push_head(Objlist *, Obj_Entry *);
-static void objlist_push_tail(Objlist *, Obj_Entry *);
+static Objlist_Entry *objlist_push_tail(Objlist *, Obj_Entry *);
 static void objlist_remove(Objlist *, Obj_Entry *);
 static void objlist_remove_unref(Objlist *);
 static void *path_enumerate(const char *, path_enum_proc, void *);
@@ -1059,13 +1059,16 @@
 init_dag1(Obj_Entry *root, Obj_Entry *obj, DoneList *dlp)
 {
     const Needed_Entry *needed;
+    Objlist_Entry *elm;
 
     if (donelist_check(dlp, obj))
 	return;
 
     obj->refcount++;
     objlist_push_tail(&obj->dldags, root);
-    objlist_push_tail(&root->dagmembers, obj);
+    elm = objlist_push_tail(&root->dagmembers, obj);
+    if (root != obj)
+	STAILQ_INSERT_TAIL(&obj->dagmembers, elm, link);
     for (needed = obj->needed;  needed != NULL;  needed = needed->next)
 	if (needed->obj != NULL)
 	    init_dag1(root, needed->obj, dlp);
@@ -1445,7 +1448,7 @@
     STAILQ_INSERT_HEAD(list, elm, link);
 }
 
-static void
+static Objlist_Entry *
 objlist_push_tail(Objlist *list, Obj_Entry *obj)
 {
     Objlist_Entry *elm;
@@ -1453,6 +1456,7 @@
     elm = NEW(Objlist_Entry);
     elm->obj = obj;
     STAILQ_INSERT_TAIL(list, elm, link);
+    return elm;
 }
 
 static void
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-openoffice/attachments/20060916/d7a67f60/attachment.pgp


More information about the freebsd-openoffice mailing list