On Friday 04 August 2006 10:53, Mario Torre wrote:
> Il giorno ven, 04/08/2006 alle 10.13 +1000, Raif S. Naffah ha scritto:
> > On Friday 04 August 2006 09:49, Raif S. Naffah wrote:
> > > On Friday 04 August 2006 09:32, Mario Torre wrote:
> > > > Il giorno ven, 04/08/2006 alle 09.12 +1000, Raif S. Naffah ha scritto:
> > > > > i'm getting a segmentation fault caused by /usr/lib/libgconf-2.so.4
> > > > > (FC5) when trying to run jamvm with Classpath (both CVS Head)...
> > > > > anybody else is seeing this?
> > > >
> > > > Do you have a test case for that?
> > >
> > > here is how i can trigger it:
> > >
> > > import java.util.prefs.Preferences;
> > >
> > > public class Hello {
> > >   public static final void main(String[] args) {
> > >     Preferences prefs = Preferences.systemNodeForPackage(Hello.class);
> > >     int lastSerialNumber = prefs.getInt("LAST_SERIAL_NUMBER", 0) + 1;
> > >     prefs.putInt("LAST_SERIAL_NUMBER", lastSerialNumber);
> > >   }
> > > }
>
> I can't reproduce.
>
> Moreover, you get a warning if you put this into the default package (it
> does not cause harm), but other than that, it is fine (the warning is
> normal).
>
> Anyway, Can you try the attached patch and see if it works?

i'll do that soon.


> > in addition to the above, when i configure Classpath with
> > --disable-default-preferences-peer, and try to run the same code (as
> > above) i get:
>
> Well, sorry this is my fault, I hope to fix this tomorrow, as I'm not an
> autoconf expert, so I have to look at it in more details (and now I
> really need some sleep).
>
> There should not be any --disable-default-preferences-peer.
>
> The preference flags are intended to use this way:
>
> --disable-gconf-peer: disable the gconf backend
> --enable-default-preferences-peer=gnu.java.util.prefs.FileBasedFactory:
> use another backend, not the default (everything that this default is,
> may also not be gconf).

i'm attaching a patch that fixes this configuration issue.


> This means that you can build the preference backend but with another
> default, or you can totally disable the preference backend.
>
> I guess that --disable-default-preferences-peer should not create any
> key in the META-INF directory.
>
> The correct name for this flag should really be
> --with-default-preferences-peer...
>
> The exceptions are normal, it should revert to a sane default if
> everything else fails. This should be the FileBasedPreferences, can you
> please confirm this? What happened after the error?

as i mentioned earlier a seg fault; i.e. the VM exists.


> Sorry for the confusion, and thanks for pointing me out to this

no worries!  thanks for looking into it.


cheers;
rsn
Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.176
diff -u -r1.176 configure.ac
--- configure.ac	2 Aug 2006 23:28:12 -0000	1.176
+++ configure.ac	4 Aug 2006 01:00:03 -0000
@@ -85,13 +85,15 @@
 dnl -----------------------------------------------------------
 dnl Default Preference Backend
 dnl -----------------------------------------------------------
-AC_ARG_ENABLE(default-preferences-peer,
-  AS_HELP_STRING([--enable-default-preferences-peer],
-                 [fully qualified class name of default Preferences API Backend]))
-DEFAULT_PREFS_PEER=$enable_default_preferences_peer
-if test "$DEFAULT_PREFS_PEER" = ""; then
-   DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory
-fi
+AC_ARG_ENABLE([default-preferences-peer],
+              [AS_HELP_STRING([--enable-default-preferences-peer],
+                              [fully qualified class name of default Preferences API Backend [default=gnu.java.util.prefs.GConfBasedFactory])])],
+              [case "${enableval}" in
+                yes) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory  ;;
+                no) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory  ;;
+                *) DEFAULT_PREFS_PEER=${enableval} ;;
+              esac],
+              [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
 dnl AC_SUBST(DEFAULT_PREFS_PEER)

 dnl -----------------------------------------------------------

Reply via email to