Date: 29 Jan 2002 06:00:47 +0200 From: Maxim Sobolev <sobomax@FreeBSD.org> To: Joe Clarke <marcus@marcuscom.com> Cc: Anders Andersson <anders@hack.org>, gnome@FreeBSD.org Subject: Re: deskutils/mrproject Message-ID: <1012276850.45588.30.camel@notebook> In-Reply-To: <1012263062.93813.4.camel@shumai.marcuscom.com> References: <1012183959.78541.11.camel@shumai.marcuscom.com> <20020128143829.T78981-101000@shumai.marcuscom.com> <20020128222637.GB297@sushi.sanyusan.se> <1012263062.93813.4.camel@shumai.marcuscom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-2QChbpVYv67hDmMAyBzw Content-Type: multipart/mixed; boundary="=-D0cehtK9/z6rVL17xC2u" --=-D0cehtK9/z6rVL17xC2u Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Just FYI. I did some digging to identify the real source of the problem with shared modules. It seems that some fundamental assumptions are broken. Particularly the software assumes that all shared modules when loaded share the same namespace, while in fact it isn't always true. For example, all shared objects share gtk+ namespace, because they are all linked with it dynamically, but they don't share namespace of mrproject's utility libraries linked statically. This leads to various crash patterns, some of them I have fixed, but gave up because there are many more. The typical crash scenario looks like the following: 1. The application loads foo.so shared module. The module registers its custom types with the gtk+ using some utility function linked statically into each module. This function keeps a state to prevent registering the same type twice, which is prohibited by gtk+. 2. The application loads bar.so shared module. It also tries to register itself with gtk+ using its own copies of those utility functions. However, since bar's copy of utility functions aren't shared, bar.so knows nothing about the fact that some of its types already registered with gtk+ (gtk+ is shared between foo.so and bar.so), thus leading to a crash. This is one of the most obvious problems. Perhaps there are some more subtle ones, because even after fixing those ones the software is still non-functional. I think that the problem should be reported to developers, because it isn't trivial to fix properly. Attached please find some patches to fix some early startup crashes described above - they should give idea what I'm talking about. -Maxim --=-D0cehtK9/z6rVL17xC2u Content-Disposition: attachment; filename="patch-client::widgets::goto-popup.c" Content-Type: text/x-c; charset=KOI8-R Content-Transfer-Encoding: quoted-printable $FreeBSD$ --- client/widgets/goto-popup.c 2002/01/29 03:07:27 1.1 +++ client/widgets/goto-popup.c 2002/01/29 03:13:19 @@ -155,7 +155,8 @@ (GtkClassInitFunc) NULL, }; =20 - goto_type =3D gtk_type_unique (gtk_combo_box_get_type (), = &goto_info); + if ((goto_type =3D gtk_type_from_name(goto_info.type_name)= ) =3D=3D GTK_TYPE_INVALID) + goto_type =3D gtk_type_unique (gtk_combo_box_get_type (), &goto_info); } =20 return goto_type; --=-D0cehtK9/z6rVL17xC2u Content-Disposition: attachment; filename="patch-util::type-utils.h" Content-Type: text/x-c-header; charset=KOI8-R Content-Transfer-Encoding: quoted-printable $FreeBSD$ --- util/type-utils.h 2002/01/29 01:49:26 1.1 +++ util/type-utils.h 2002/01/29 01:54:18 @@ -50,7 +50,8 @@ (GtkClassInitFunc) NULL \ }; \ type_of_parent =3D parent_type_as_function ## _get_type (); \ - object_type =3D gtk_type_unique (type_of_parent, &object_info); \ + if ((object_type =3D gtk_type_from_name(#type)) =3D=3D GTK_TYPE_INVALID)= \ + object_type =3D gtk_type_unique (type_of_parent, &object_info); \ parent_class =3D gtk_type_class (type_of_parent); \ } \ return object_type; \ --=-D0cehtK9/z6rVL17xC2u-- --=-2QChbpVYv67hDmMAyBzw Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQA8Vh5voNu5t4iCBa8RAmjVAJ9cOw8itpiq+fOgK8flCzCcJW4nMgCeI/dH l47eYv4K+OsVVpcCa+5E+1c= =9yrd -----END PGP SIGNATURE----- --=-2QChbpVYv67hDmMAyBzw-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-gnome" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1012276850.45588.30.camel>