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

Open
kwrobot opened this Issue Apr 11, 2015 · 10 comments

Comments

Projects
None yet
3 participants
@kwrobot

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

This comment has been minimized.

Show comment
Hide comment
@kwrobot

kwrobot 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 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

This comment has been minimized.

Show comment
Hide comment
@kwrobot

kwrobot 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 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

This comment has been minimized.

Show comment
Hide comment
@kwrobot

kwrobot 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 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

This comment has been minimized.

Show comment
Hide comment
@kwrobot

kwrobot 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 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

This comment has been minimized.

Show comment
Hide comment
@kwrobot

kwrobot 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 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

This comment has been minimized.

Show comment
Hide comment
@kwrobot

kwrobot 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 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

This comment has been minimized.

Show comment
Hide comment
@kwrobot

kwrobot 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.

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

libarchive: don't do rar if there's unar
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

Log more data when failing to decompress RAR files
(may happen on standard files because of libarchive's incomplete support of filters libarchive/libarchive#373)
@leinir

This comment has been minimized.

Show comment
Hide comment
@leinir

leinir 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

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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 21, 2016

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

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

This comment has been minimized.

Show comment
Hide comment
@almereyda

almereyda Dec 31, 2016

Same here on Fedora 24.

Same here on Fedora 24.

@soarqin soarqin referenced this issue Jan 13, 2017

Merged

Add unrar #4

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

Revert "Remove nautilus extension"
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

mime-types: drop rar support
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

comics: Port to using libarchive for unarchiving
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment