[tor-bugs] #16424 [metrics-lib]: Support parsing of .xz compressed tarballs

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Jul 18 15:59:22 UTC 2015


#16424: Support parsing of .xz compressed tarballs
-----------------------------+--------------------------
     Reporter:  karsten      |      Owner:  karsten
         Type:  enhancement  |     Status:  needs_review
     Priority:  normal       |  Milestone:
    Component:  metrics-lib  |    Version:
   Resolution:               |   Keywords:
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+--------------------------
Changes (by karsten):

 * status:  needs_revision => needs_review


Comment:

 Replying to [comment:18 leeroy]:
 > The first change is optional, it just makes the dependency on
 libcommons-compress with libxz explicit. The code will compile without it.

 Ah, okay.  I'd say we can leave it in.

 > The second change is required to use xz tarballs. Onionoo already does
 codec and compress, so at a minimum libxz must be added to the build file
 or no xz tarball support will work. Not even if you have it installed.

 Well, the xz.tarball certainly needs to be added to ''Onionoo's'' build
 file if we want Onionoo to support parsing xz tarballs with metrics-lib's
 help, but it doesn't need to be included in the jar file produced by
 ''metrics-lib's'' build file.  I just tried it out, and that works just
 fine.

 Please review my [https://gitweb.torproject.org/user/karsten/metrics-
 lib.git/log/?h=task-16424 updated branch task-16424] and tell me if you're
 okay with squashing all those commits into yours and merging.

 By the way, things don't break in too interesting ways if the `xz.jar` is
 not provided.  Here's the exception you'd get:

 {{{
 Bug: uncaught exception or error while reading descriptors:
 java.lang.NoClassDefFoundError: org/tukaani/xz/XZInputStream
         at
 org.torproject.descriptor.impl.DescriptorReaderImpl$DescriptorReaderRunnable.getArchiveInputStreamForFile(DescriptorReaderImpl.java:351)
         at
 org.torproject.descriptor.impl.DescriptorReaderImpl$DescriptorReaderRunnable.readTarballs(DescriptorReaderImpl.java:287)
         at
 org.torproject.descriptor.impl.DescriptorReaderImpl$DescriptorReaderRunnable.run(DescriptorReaderImpl.java:158)
         at java.lang.Thread.run(Thread.java:744)
 Caused by: java.lang.ClassNotFoundException: org.tukaani.xz.XZInputStream
         at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
         ... 4 more
 }}}

 That's not pretty, but at least it explains what went wrong.

 Once we have resolved this we should upgrade the metrics-lib in Onionoo
 and include `xz.jar` in its build file.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/16424#comment:19>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list