Menu

#47 No "MulticastDNSMulticastOnlyQuerier" file causes NullpointerException in finalize() in Master.java

None
closed-fixed
nobody
None
5
2014-10-15
2014-05-15
No

If file "MulticastDNSMulticastOnlyQuerier" is not present in path, then there is an exception in Master.java constructor:

Master(File file, Name origin, long initialTTL) throws IOException {
    if (origin != null && !origin.isAbsolute()) {
        throw new RelativeNameException(origin);
    }
    this.file = file;
    st = new Tokenizer(file); //Exception here => st = null!
    this.origin = origin;
    defaultTTL = initialTTL;
}

This causes st to be null, causing NullpointerException in:

finalize() {
    st.close();
}

Stacktrace:
05-15 14:07:43.844 4143-4152/se.pilotfish.android.gpsprovider E/System﹕ Uncaught exception thrown by finalizer
05-15 14:07:43.844 4143-4152/se.pilotfish.android.gpsprovider E/System﹕ java.lang.NullPointerException
at org.xbill.DNS.Master.finalize(Master.java:424)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:186)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:169)
at java.lang.Thread.run(Thread.java:856)

Adding an empty file "MulticastDNSMulticastOnlyQuerier" to the path, prevents the behaviour, but the behaviour seems broken.

Discussion

  • Brian Wellington

    I have no idea what MulticastDNSMulticastOnlyQuerier is, or what it has to do with this. It definitely looks like a bug, although it's not crashing for me, even when I force the finalizer to be called. I just committed a fix.

     
  • Brian Wellington

    • status: open --> closed-fixed
    • Group: -->
     
MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.