Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subfile in certain RAR cannot be read #373

Closed
kwrobot opened this issue Apr 11, 2015 · 18 comments
Closed

Subfile in certain RAR cannot be read #373

kwrobot opened this issue Apr 11, 2015 · 18 comments

Comments

@kwrobot
Copy link

kwrobot commented Apr 11, 2015

Original issue 262 created by Google Code user simon.bailey@prismit.com.au on 2012-05-14T07:52:30.000Z:

<b>What steps will reproduce the problem?</b>
First call to archive_read_data_block fails on subfile &quot;PowerPointSlides1.ppt&quot;.  Returns ARCHIVE_FAILED.

<b>What is the expected output? What do you see instead?</b>
Should be able to extract this file.  Works in other RAR reader.

<b>What version are you using?</b>
3.0.4

<b>On what operating system?</b>
Ubuntu 

<b>How did you build?  (cmake, configure, or pre-packaged binary)</b>
Custom build solution, based on configure.

<b>What compiler or development environment (please include version)?</b>
GCC 4.4.5

<b>Please provide any additional information below.</b>
Compiled for 32 bits.
Listing the file in the archive works.  It fails on extract.

See attachment: PowerPointSlides1.rar

@kwrobot
Copy link
Author

kwrobot commented Apr 11, 2015

Comment #1 originally posted by Google Code user pascal.weisenburger on 2013-09-02T15:54:41.000Z:

I can confirm this issue with the latest libarchive release. The error that libarchive reports when trying to extract the file is "Parsing filters is unsupported".

I have several rar files that cannot be read by libarchive because of this (e.g. the official, but non-free "unrar" and the "theunarchiver" programs can read this kind of files); everything else works perfectly and I would like to completely switch to libarchive. 

Would it be possible to support "filters parsing" (I'm no expert in this field, so I don't know what this actually means) or is this something that is unlikely to be implemented in the near future?

@kwrobot
Copy link
Author

kwrobot commented Apr 11, 2015

Comment #2 originally posted by Google Code user zohar.meridor on 2013-11-13T15:06:49.000Z:

I am having the same issue.
Any new regarding this "Parsing filters is unsupported" issue on rar files?

@kwrobot
Copy link
Author

kwrobot commented Apr 11, 2015

Comment #4 originally posted by Google Code user panpingzhu@yahoo.com on 2014-06-30T23:54:58.000Z:

I did some debugging, and the reason was with the following code segment:

    else if(symbol==257)
    {
      archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
                        "Parsing filters is unsupported.");
      return (ARCHIVE_FAILED);
    }

@kwrobot
Copy link
Author

kwrobot commented Apr 11, 2015

Comment #7 originally posted by Google Code user juanjomarin96 on 2014-08-16T18:37:29.000Z:

I'm having the same issue "Parsing filters is unsupported" decompressing some rar files.

My system is a Fedora 20 x86_64 and I'm using the provided packages (libarchive-3.1.2-7.fc20.x86_64 and libarchive-devel-3.1.2-7.fc20.x86_64).

I'm using libarchive to decompress cbr files. Certain images in some rar files are not decompressed by libarchive. This is something related with the content of the files, because the problem is reproducible when I isolate the file in a rar file.

Apart from my program, even bsdtar -xf shows the same error. I attach a rar file with the problem.

$ bsdtar -xf sample.rar 
013.jpg: Parsing filters is unsupported.
bsdtar: Error exit delayed from previous errors.

See attachment: sample.rar

@kwrobot
Copy link
Author

kwrobot commented Apr 11, 2015

Comment #8 originally posted by kientzle on 2014-08-16T20:31:14.000Z:

Issue 338 has been merged into this issue.

@kwrobot
Copy link
Author

kwrobot commented Apr 11, 2015

Comment #9 originally posted by Google Code user cmihail@chromium.org on 2014-08-29T02:21:25.000Z:

We're planning to use librarchive in Chromium but we've stumbled on the same issue: "Parsing filters is unsupported".

I looked into the base code used by libarchive at https://code.google.com/p/theunarchiver/. For details see
https://code.google.com/p/libarchive/issues/detail?id=40&colspec=ID%20Type%20Status%20Priority%20Milestone%20OpSys%20Owner%20Summary

It seems the problem is related with the fact that the RAR Virtual Machine is not implemented in libarchive. So that code must be also ported to libarchive.

Since it's very important to our project, I'd like to work on it and merge the patch to libarchive.

Are you fine with porting the filters support from thelibunarchiver to libarchive?

Thanks,
Mihail

@kwrobot
Copy link
Author

kwrobot commented Apr 11, 2015

Comment #10 originally posted by Google Code user zeniko on 2014-09-04T09:48:59.000Z:

FYI: I have a working port of TheUnarchiver's RARVM to portable C at https://code.google.com/p/sumatrapdf/source/browse/trunk/ext/unarr/ . It currently supports RAR v2.0 and v3.0 archives, including parsing filters and solid compressions (which libarchive doesn't support, either). It's however LGPL licensed same as TheUnarchiver.

gnomesysadmins pushed a commit to GNOME/file-roller that referenced this issue Aug 11, 2015
The Unarchiver, unlike libarchive, supports RAR5.

Libarchive ticket:
libarchive/libarchive#373
Taiki-San added a commit to Taiki-San/Rakshata that referenced this issue Feb 7, 2016
(may happen on standard files because of libarchive's incomplete support of filters libarchive/libarchive#373)
@leinir
Copy link

leinir commented Feb 19, 2016

Because this has just hit me as well, i went looking and found this bug, untouched since a practical eternity and found myself wondering if there is in fact life - going by other places, it seems that way, but this bug's a bit on the low side... The RARVM code linked above has (on account of the google code hosting shutdown) been relocated to here on github: https://github.com/sumatrapdfreader/sumatrapdf/tree/master/ext/unarr

@ghost
Copy link

ghost commented Jul 21, 2016

I am running Ubuntu GNOME 16.04 with GNOME 3.20 and I am also affected by this bug.

@almereyda
Copy link

Same here on Fedora 24.

gnomesysadmins pushed a commit to GNOME/file-roller that referenced this issue Mar 2, 2017
This reverts commit da09ee4.

Some of the main compressed archive formats are not still supported by
libarchive, for example, RAR5.

This is a major issue for the Nautilus builtin compression handling, so
for now, and until libarchive adds support for RAR5, let's enable the
nautilus extension of file-roller for the "Extract here" menu item.

See libarchive/libarchive#373 for libarchive
support of RAR5.

https://bugzilla.gnome.org/show_bug.cgi?id=772765
gnomesysadmins pushed a commit to GNOME/gnome-autoar that referenced this issue Mar 3, 2017
Unfortunately rar is not well supported by libarchive, so for now let's
drop its support so we don't expect users of autoar to extract files
that are corrupted.

The upstream documentation of what rar parts are supported or not are
not clear, so far I found:
libarchive/libarchive#373
vitasdk/packages#4 (comment)
https://github.com/libarchive/libarchive/wiki/LibarchiveFormats it says
read only for rar, but that is should work for any rar. However seems
rar5 is not supported.

This patch drops support for rar, and in case of some clients like
Nautilus will use file-roller for rar until libarchive fixes.

https://bugzilla.gnome.org/show_bug.cgi?id=779437
gnomesysadmins pushed a commit to GNOME/evince that referenced this issue Mar 25, 2017
v8:
- Fix double-free in error path when decompressing images

v7:
- Bump buffer size in ev-archive, good performance increase for
  local files

v6:
- Fix 2 pretty big memory leaks
- Remove unneeded archive_read_data_skip() calls
- Optimise the "no rotation" case (could also be done for gnome-3-24)
- Use render_pixbuf_size_prepared_cb()
- Add debug to "next header" archive calls

v5:
- Remove unused members of ComicsDocument struct
- Split archive handling into an EvArchive object
- Fix copy/paste error in configure.ac

v4:
- Fix crash caused by a bug in comics_document_list()
  (the array was not NULL terminated)
- Remove duplicate "!cb_files" check
- Use "size-prepared" instead of "area-prepared" to get the doc size
- Fix link to libarchive bug in code, not working yet :/

v3:
- Rebase against latest evince, making sure to bring back:
  - Use Unicode in translatable strings
  - Sort pages in natural order
  - Fix mime-type comparisons
- libarchive/libarchive#373 looks
  like it's fixed!

v2:
- Rebase against latest evince
- Update libarchive bug URL

https://bugzilla.gnome.org/show_bug.cgi?id=720742
@mmatuska
Copy link
Member

mmatuska commented Mar 4, 2019

@antekone what do you think about this? Is it worth implementing without impact on the license?

@antekone
Copy link
Contributor

antekone commented Mar 6, 2019

I'd need some time to research this. I'll do some reading and I'll report back.

@cvanlabe
Copy link

Hello team, checking in if there's been any findings with regards to impact on licensing to integrate this?

@mmatuska
Copy link
Member

@antekone the licensing problem can be solved easily. The LGPL code must be compiled as a separate library we optionally link against. That won't happen e.g. in base FreeBSD but should be no problem on Linux distros and FreeBSD ports. We also might bundle the source code in contrib/ if absolutely necessary.

Otherwise we need a reimplementation from scratch.

@todd-richmond
Copy link
Contributor

I just got bit by this issue when trying again to enable libarchive RAR support using 3.4.2 which now supports "solid" archives. Getting closer, but still not useable as a rarlabs replacement

Would love to get this working because rarlabs code requires writing to disk and so is slow

@hadess
Copy link

hadess commented Feb 26, 2022

#1503 got merged, should this be closed?

@axet
Copy link

axet commented Jun 27, 2023

bsdtar: RAR solid archive support unavailable.
bsdtar: Error exit delayed from previous errors

libarchive-tools 3.6.2-1

file MO2/downloads/XXXX.rar 
MO2/downloads/XXXX.rar: RAR archive data, v4, os: Win32, flags: Solid

rarv5 solid works! but rarv4 solid isn't!

@bgermann
Copy link

Both sample files can be extracted successfully with v3.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests