Version: 2.14 (using KDE 4.4.5) OS: Linux Creating an archive of any of the above listed formats results in an archive file roller (gnome) is not able to read. On the other hand, xz and bz archives made by file roller is read by ark and file roller itself. Reproducible: Always
Do you mean .xz/.bz2 files or .tar.{xz,bz2} files?
The tar ones. Apparently ark doesn't have an option to make xz or bz2 archives.
What distro are you using? Creating these tarballs with Ark should be essentially equal to creating them using bsdtar (it usually comes with libarchive), whereas file-roller directly calls GNU tar (the usual tar in GNU/Linux systems). If you manually create one of these files using bsdtar, can you read them in file-roller?
There appears to be some problem with the extension. If it's tar.xz (or in that case tar.bz2), then file roller is not able to open it. I tried the bsdtar utility.
So I guess this's a file roller bug.
If file-roller cannot open .tar.xz and .tar.bz2 files, what extension does it use to create these archive types?
The same extensions. This's still more weird. So finally I relied on the output of the file command to see what's wrong. It appears ark is a fault. I made 2 sets of archives, one using ark (with name ark.*), the other using file roller (with name fileroller.*) and ran file on them - file *tar* ark.tar: POSIX tar archive ark.tar.bz: gzip compressed data, from Unix ark.tar.gz: gzip compressed data, from Unix ark.tar.xz: gzip compressed data, from Unix fileroller.tar: POSIX tar archive (GNU) fileroller.tar.bz2: bzip2 compressed data, block size = 900k fileroller.tar.gz: gzip compressed data, from Unix fileroller.tar.xz: XZ compressed data So ark is effectively making just gzip archives. Changing subject.
This is looking like a duplicate of bug 267298. You seem to be running some old (or weirdly packaged) version of libarchive that does not support xz files (at least). On its side, Ark currently has this silly behaviour of falling back to gzip if other tarball compression types fail, which cause the issue. What system are you on, and do `grep archive_write_set_compression_xz /usr/lib/libarchive.so` and `grep archive_write_set_compression_bz /usr/lib/libarchive.so` return any match?
They give no output. $ bsdtar --options='xz:compression-level=9' -cf /mnt/shares/desktop.tar Desktop $ file /mnt/shares/desktop.tar /mnt/shares/desktop.tar: POSIX tar archive So there's some issue with bsdtar. Since I'm using a source based distro (Gentoo), the package is compiled with bzip2, lzma, zlib support but without xattr. version 2.8.4
Weird, if at least bzip2 support is there, grepping for archive_write_set_compression_bz should return a match. What set of archive_write_set_compression* functions is declared in /usr/include/archive.h?
__LA_DECL int archive_write_set_compression_bzip2(struct archive *); __LA_DECL int archive_write_set_compression_compress(struct archive *); __LA_DECL int archive_write_set_compression_gzip(struct archive *); __LA_DECL int archive_write_set_compression_lzma(struct archive *); __LA_DECL int archive_write_set_compression_none(struct archive *); __LA_DECL int archive_write_set_compression_program(struct archive *, __LA_DECL int archive_write_set_compression_xz(struct archive *);
OK, thanks. Does grepping for any of those in /usr/lib/libarchive.so return anything?
/usr/lib/libarchive.so - /* GNU ld script Since Gentoo has critical dynamic libraries in /lib, and the static versions in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we run into linking problems. This "fake" dynamic lib is a linker script that redirects the linker to the real lib. And yes, this works in the cross- compiling scenario as the sysroot-ed linker will prepend the real path. See bug http://bugs.gentoo.org/4411 for more info. */ OUTPUT_FORMAT ( elf64-x86-64 ) GROUP ( /lib64/libarchive.so ) cat /lib64/libarchive.so | grep --text archive_write_set_compression Ê`ö? é Ã`ö? ^ ¿`ö?3 pbö?jD `ö`ö? bö?k~ ú`ö? 0 +aö?jJ Ì`ö?Z{ bö?°Å Ibö?ÿ¢ pÃ`ö? Pêaö?¢¯▒ Xbö? ô ô`ö?$! pÊbö?â 0Æ`ö?$ °ä`ö?hf ÀÃbö?!Ü aö?R ` àÃ`ö?V `ä`ö?M( и`ö?xÑ àbö?jW ú`ö? %▒ ÀSbö? ¾`ö? / °bö?|` ö`ö?\¦ Kbö?© º`ö?¼ñÿ▒/ö?Ì Àº`ö?¼ »`ö? Ü °è`ö?Ð Ã`ö? y Î`ö?Ý °Ã`ö? ▒ pSbö? àº`ö?__gmon_start___init_fini__cxa_finalize_Jv_RegisterClassesstrlen__archive_check_magicabortmallocwmemcpy__archive_errx__archive_string_freewcslenmbstowcs__archive_string_utf8_wwcscpy__archive_strappend_w_utf8__archive_strappend_w_mbs__archive_string_append__archive_string_copyarchive_entry_clonearchive_entry_xattr_add_entryarchive_entry_newarchive_entry_atimearchive_entry_atime_nsecarchive_entry_atime_is_setarchive_entry_birthtimearchive_entry_birthtime_nsecarchive_entry_birthtime_is_setarchive_entry_ctimearchive_entry_ctime_is_setarchive_entry_ctime_nsecarchive_entry_devgnu_dev_makedevarchive_entry_devmajorgnu_dev_majorarchive_entry_devminorgnu_dev_minorarchive_entry_filetypearchive_entry_fflagsarchive_entry_fflags_textarchive_entry_gidarchive_entry_gnamearchive_entry_gname_warchive_entry_hardlinkarchive_entry_hardlink_warchive_entry_inoarchive_entry_ino64archive_entry_modearchive_entry_mtimearchive_entry_mtime_nsecarchive_entry_mtime_is_setarchive_entry_nlinkarchive_entry_pathnamearchive_entry_pathname_warchive_entry_rdevarchive_entry_rdevmajorarchive_entry_rdevminorarchive_entry_sizearchive_entry_size_is_setarchive_entry_sourcepatharchive_entry_symlinkarchive_entry_symlink_warchive_entry_uidarchive_entry_unamearchive_entry_uname_warchive_entry_set_filetypearchive_entry_set_fflagsarchive_entry_copy_fflags_textarchive_entry_copy_fflags_text_wwmemcmparchive_entry_set_gidarchive_entry_set_gnamearchive_entry_copy_gnamearchive_entry_copy_gname_warchive_entry_update_gname_utf8archive_entry_set_inoarchive_entry_set_ino64archive_entry_set_hardlinkarchive_entry_copy_hardlinkarchive_entry_copy_hardlink_warchive_entry_update_hardlink_utf8archive_entry_set_atimearchive_entry_unset_atimearchive_entry_set_birthtimearchive_entry_unset_birthtimearchive_entry_set_ctimearchive_entry_unset_ctimearchive_entry_set_devarchive_entry_set_devmajorarchive_entry_set_devminorarchive_entry_set_linkarchive_entry_copy_linkarchive_entry_copy_link_warchive_entry_update_link_utf8archive_entry_set_modearchive_entry_set_mtimearchive_entry_unset_mtimearchive_entry_set_nlinkarchive_entry_set_pathnamearchive_entry_copy_pathnamearchive_entry_copy_pathname_warchive_entry_update_pathname_utf8archive_entry_set_permarchive_entry_set_rdevarchive_entry_set_rdevmajorarchive_entry_set_rdevminorarchive_entry_set_sizearchive_entry_unset_sizearchive_entry_copy_sourcepatharchive_entry_set_symlinkarchive_entry_copy_symlinkarchive_entry_copy_symlink_warchive_entry_update_symlink_utf8archive_entry_set_uidarchive_entry_set_unamearchive_entry_copy_unamearchive_entry_copy_uname_warchive_entry_update_uname_utf8archive_entry_acl_cleararchive_entry_cleararchive_entry_xattr_cleararchive_entry_freearchive_entry_acl_add_entryarchive_entry_acl_add_entry_warchive_entry_acl_countarchive_entry_acl_resetarchive_entry_acl_nextarchive_entry_acl_text_w__archive_entry_acl_parse_warchive_entry_copy_statmemsetarchive_entry_linkresolver_newarchive_entry_linkresolver_set_strategyarchive_entry_linkresolver_freearchive_entry_linkifyarchive_entry_statarchive_entry_strmode__strduparchive_entry_xattr_countarchive_entry_xattr_resetarchive_entry_xattr_nextarchive_read_closearchive_clear_errorarchive_read_newarchive_read_extract_set_skip_filearchive_read_set_format_options__archive_parse_optionsarchive_set_errorarchive_read_set_filter_optionsarchive_read_set_optionsarchive_read_header_positionarchive_read_data_blockarchive_read_data_skiparchive_read_next_header2archive_read_next_headerarchive_read_dataarchive_read_data_into_buffer__archive_read_register_format__archive_read_get_bidder__archive_read_filter_aheadmemmove__archive_read_aheadarchive_read_open2callocarchive_read_open__archive_read_filter_consume__archive_read_consume__archive_read_filter_skip__archive_read_skip_lenient__archive_read_skiparchive_read_data_into_fdlseek__errno_locationarchive_read_disk_gnamearchive_read_disk_unamearchive_read_disk_set_gname_lookuparchive_read_disk_set_uname_lookuparchive_read_disk_newarchive_read_disk_set_symlink_logicalarchive_read_disk_set_symlink_physicalarchive_read_disk_set_symlink_hybridarchive_read_disk_entry_from_filereadlinkgetpwuid_rreallocgetgrgid_rarchive_read_disk_set_standard_lookuparchive_write_disk_newarchive_write_disk_set_standard_lookuparchive_write_finisharchive_read_extract2archive_write_disk_set_skip_filearchive_write_headerarchive_write_data_blockarchive_error_stringarchive_errnoarchive_write_finish_entryarchive_copy_errorarchive_read_extractarchive_write_disk_set_optionsarchive_read_extract_set_progress_callbackarchive_read_open_fdfseekofreadarchive_read_open_FILEfilenoarchive_read_open_filenamestrcpyarchive_read_open_filearchive_read_open_memory2archive_read_open_memoryarchive_read_support_compression_allarchive_read_support_compression_bzip2archive_read_support_compression_compressarchive_read_support_compression_gziparchive_read_support_compression_lzmaarchive_read_support_compression_xzarchive_read_support_compression_uuarchive_read_support_compression_rpmBZ2_bzDecompressEndBZ2_bzDecompressInitBZ2_bzDecompressinflateEndcrc32inflateInit2_inflatearchive_read_support_compression_nonewaitpidfcntl__archive_check_childarchive_read_support_compression_program_signaturearchive_read_support_compression_program__archive_read_programstrcat__archive_create_childlzma_alone_decoderlzma_stream_decoderlzma_endlzma_codearchive_read_support_format_allarchive_read_support_format_ararchive_read_support_format_cpioarchive_read_support_format_emptyarchive_read_support_format_iso9660archive_read_support_format_mtreearchive_read_support_format_tararchive_read_support_format_xararchive_read_support_format_zipstrncpystrchr__archive_strncat__archive_string_concattimegminflateInit_inflateResetstrcmpstrncmpmemchr__archive_string_ensurestrcspnstrspnarchive_read_support_format_raw__archive_strappend_chararchive_read_support_format_gnutarSHA1_InitMD5_InitSHA1_UpdateMD5_UpdateSHA1_FinalMD5_FinalxmlReaderForIOxmlTextReaderSetErrorHandlerxmlTextReaderReadxmlTextReaderNodeTypexmlTextReaderConstLocalNamexmlTextReaderIsEmptyElementxmlTextReaderMoveToFirstAttributexmlTextReaderConstValuexmlTextReaderMoveToNextAttributexmlFreeTextReaderxmlCleanupParsermktime__sprintf_chkwcrtomb__ctype_get_mb_cur_max__archive_string_vsprintf__archive_string_sprintfarchive_api_featurearchive_api_versionarchive_version_numberarchive_version_stamparchive_version_stringarchive_versionarchive_file_countarchive_formatarchive_format_namearchive_compressionarchive_compression_namearchive_position_compressedarchive_position_uncompressedarchive_write_closearchive_read_finisharchive_write_dataarchive_write_newarchive_write_set_compression_nonearchive_write_set_format_optionsarchive_write_set_compressor_optionsarchive_write_set_optionsarchive_write_set_bytes_per_blockarchive_write_get_bytes_per_blockarchive_write_set_bytes_in_last_blockarchive_write_get_bytes_in_last_blockarchive_write_set_skip_filearchive_write_openioctlmkfifomkdirftruncatefutimensfchownlchownfchmodutimensatlutimesstrrchrunlinkumaskrmdirfchdirarchive_write_disk_set_group_lookuparchive_write_disk_set_user_lookupgeteuidgetpwnam_rgetgrnam_rarchive_write_open_fdfwritearchive_write_open_FILEarchive_write_open_filenamearchive_write_open_filearchive_write_open_memoryBZ2_bzCompressInitBZ2_bzCompressBZ2_bzCompressEndarchive_write_set_compression_bzip2archive_write_set_compression_compressdeflateInit2_deflatedeflateEndarchive_write_set_compression_gziparchive_write_set_compression_programlzma_lzma_presetlzma_alone_encoderlzma_stream_encoderlzma_memusagearchive_write_set_compression_xzarchive_write_set_compression_lzmaarchive_write_set_formatarchive_write_set_format_cpioarchive_write_set_format_cpio_newcarchive_write_set_format_mtreearchive_write_set_format_shararchive_write_set_format_shar_dumparchive_write_set_format_pax_restrictedarchive_write_set_format_paxarchive_write_set_format_ustararchive_write_set_format_zip__memmove_chkstrstr__strncpy_chkarchive_write_set_format_ar_bsdarchive_write_set_format_ar_svr4archive_write_set_format_by_nameSHA512_FinalSHA384_FinalSHA256_FinalRIPEMD160_FinalSHA512_UpdateRIPEMD160_UpdateSHA256_UpdateSHA384_UpdateSHA512_InitRIPEMD160_InitSHA384_InitSHA256_Init__archive_write_format_header_ustarlocaltimepipevforkdup2execlp_exitpollliblzma.so.5libbz2.so.1libxml2.so.2libpthread.so.0libz.so.1libcrypto.so.1.0.0libc.so.6__xstat__fxstat__lxstat__xmknod_edata__bss_startlibarchive.so.2LIBXML2_2.5.0LIBXML2_2.5.2LIBXML2_2.4.30LIBXML2_2.6.0GLIBC_2.2.5GLIBC_2.3GLIBC_2.6GLIBC_2.3.3GLIBC_2.3.4 This is probably an internal programming error.archive_write_set_compression_bzip2Can't write Compress header as single blockarchive_write_set_compression_compress?ÿGZip compressor requires a minimum 10 byte block sizeGZip compression failed: deflate() call returned status %darchive_write_set_compression_gzipCan't allocate output bufferCan't allocate data for output bufferingarchive_write_set_compression_noneRead from filter failed unexpectedly.archive_write_set_compression_programFilter exited with failure.Can't write to filterlzma compression data errorInternal error initializing compression library: It's a bug in liblzmalzma compression error: %ju MiB would have been neededlzma compression failed: lzma_code() call returned status %darchive_write_set_compression_xzNo such formatCan't allocate strtab bufferInvalid filenameCan't find string tablestring table offset too largeFile name too longNumeric user ID too largeNumeric group ID too largeNumeric mode too largeFile size out of rangeEntry remaining bytes larger than 0Padding wrong size: %d should be 1 or 0Can't allocate filename bufferFile modification time too largeRegular file required for non-pseudo memberNo such format '%s'arbsdargnuarsvr4newcodcpaxposixsharshardumpNo memory for ino translation tableToo many files for this cpio formatPOSIX cpiolarge inode number truncatedSVR4 cpio nocrcFinished entry without being open first. nlink=%u gname= uname= flags= time=%jd.%jd mode=%o gid=%jd uid=%jd type=link link= type=socket type=char device=native,%d,%d type=block type=dir type=fifo type=file size=%jd cksum=%ju md5digest= rmd160digest= sha1digest= sha256digest= sha384digest= sha512digest= \
Hmm, it looks like all symbols are already present. Have you compiled Ark with debug symbols? If so, you could try the steps I described in comment 7 of bug 267298 and check if Ark is indeed falling back to gzip -- that should happen only to tar.xz and/or tar.lzma files, tar.bz2 files should work just fine 99% of the time.
Well, if I was told right, then if I don't have the -ggdb flag set during compile, the I wont be compiling using debugging symbols + I'm using fomit-frame-pointer. Anyway, I did compile with debugging symbols and here's the output - ark(5601) Kerfuffle::supportedWriteMimeTypes: Returning ("application/x-java-archive", "application/x-jar", "application/zip", "application/x-zip-compressed", "application/x-7z-compressed", "application/x-tar", "application/x-compressed-tar", "application/x-bzip-compressed-tar", "application/x-tarz", "application/x-deb", "application/x-xz-compressed-tar", "application/x-lzma-compressed-tar", "application/x-cd-image", "application/x-rar") ark(5601) Kerfuffle::AddToArchive::showAddDialog: Returned URL: KUrl("file:///home/de/testing.tar.xz") ark(5601) Kerfuffle::AddToArchive::showAddDialog: Returned mime: "application/x-xz-compressed-tar" ark(5601) main: Entering application loop ark(5601) Kerfuffle::AddToArchive::slotStartJob: ark(5601) Kerfuffle::factory: ark(5601) Kerfuffle::factory: Loading plugin "kerfuffle_libarchive" ark(5601) Kerfuffle::ReadOnlyArchiveInterface::ReadOnlyArchiveInterface: ark(5601) Kerfuffle::AddToArchive::slotStartJob: "Set filename to /home/de/testing.tar.xz" ark(5601) Kerfuffle::AddToArchive::slotStartJob: Setting GlobalWorkDir to "/home/de" ark(5601) Kerfuffle::AddJob::AddJob: ark(5601) KSharedUiServerProxy::KSharedUiServerProxy: kuiserver registered ark(5601) LibArchiveInterface::addFiles: GlobalWorkDir is set, changing dir to "/home/de" ark(5601) LibArchiveInterface::addFiles: Falling back to gzip ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/ ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/420.ods ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/attack.tlc ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/automake.out ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/client.conf ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/cupsd.conf ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/cupsd.conf.working ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/debug ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/gen.sh ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/listen ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/sfdisk ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/test.cpp ark(5601) LibArchiveInterface::writeFile: Writing new entry Desktop/testc.c ark(5601) Kerfuffle::Job::onFinished: true ark(5601) Kerfuffle::AddToArchive::slotFinished:
Excuse my ignorance as I'm not a Gentoo user. Have you used libarchive >= 2.8.0 for a long time? Was Ark built after you moved from libarchive 2.7? When you build Ark, do you get the following message during configuration: Your libarchive does not have support for lzma and/or xz archives. libarchive >= 2.7.0 is recommended. ?
Yes, I did rebuild to compile with debugging symbols (-gddb), after that again rebuild to compile without debugging symbols. The message does not appear during the compile phase, attaching build log.
Created attachment 59714 [details] THE log
Oh well, let's try the next step then. What's in the generated config.h in your build directory?
# cat ./work/ark-4.4.5_build/ark/config.h /* #undef HAVE_LIBARCHIVE_LZMA_SUPPORT */ /* #undef HAVE_LIBARCHIVE_XZ_SUPPORT */
Hmm, the functions are being found by CMake, but config.h is being set wrongly. Are HAVE_LIBARCHIVE_{XZ,LZMA}_SUPPORT properly defined in CMakeCache.txt in the build directory? What if you compile a newer version (4.6.2 or 4.6.3, for example)?
cat ./work/ark-4.4.5_build/CMakeCache.txt | grep HAVE_LIBARCHIVE_ //ADVANCED property for variable: HAVE_LIBARCHIVE_GZIP_SUPPORT HAVE_LIBARCHIVE_GZIP_SUPPORT-ADVANCED:INTERNAL=1 HAVE_LIBARCHIVE_GZIP_SUPPORT:INTERNAL=1 //ADVANCED property for variable: HAVE_LIBARCHIVE_LZMA_SUPPORT HAVE_LIBARCHIVE_LZMA_SUPPORT-ADVANCED:INTERNAL=1 HAVE_LIBARCHIVE_LZMA_SUPPORT:INTERNAL=1 HAVE_LIBARCHIVE_XZ_SUPPORT:INTERNAL=1 I cant move on to the latest ark, it pulls in ~50 dependencies from kde 4.6* which's marked unstable (and I'm using the stable branch).
I'll notify the Gentoo maintainers too about this.
I don't think Ark depends on anything that's 4.5 or 4.6-only, so you could try building it from SVN just to check if the generated config.h looks different. $ cd /tmp $ svn co -N svn://anonsvn.kde.org/home/kde/tags/KDE/4.6.3/kdeutils $ cd kdeutils && svn up cmake && svn up doc && svn up ark $ mkdir build && cd build $ cmake .. && make
I can confirm this issue with KDE-4.6.2 and libarchive-2.8.4 for tar.xz and tar.lzma formats, but not for tar.bz2. $ qlist -IUv ark libarchive xz-utils app-arch/libarchive-2.8.4-r1 (bzip2 kernel_linux lzma zlib) app-arch/xz-utils-5.0.2 (nls threads) kde-base/ark-4.6.2 (archive bzip2 handbook) $ file /home/atlantis/Documents/teste.tar.* /home/atlantis/Documents/teste.tar.bz2: bzip2 compressed data, block size = 900k /home/atlantis/Documents/teste.tar.gz: gzip compressed data, from Unix, last modified: Sun May 8 15:05:41 2011 /home/atlantis/Documents/teste.tar.lzma: gzip compressed data, from Unix, last modified: Sun May 8 15:02:18 2011 /home/atlantis/Documents/teste.tar.xz: gzip compressed data, from Unix, last modified: Sun May 8 15:01:58 2011
Created attachment 59776 [details] Proposed fix. OK, I understand what's going on now. Can you guys test this patch and check if it fixes the issue for you?
*** Bug 267298 has been marked as a duplicate of this bug. ***
The patch works here: $ file /home/atlantis/Documents/teste.tar.* /home/atlantis/Documents/teste.tar.bz2: bzip2 compressed data, block size = 900k /home/atlantis/Documents/teste.tar.gz: gzip compressed data, from Unix, last modified: Sun May 8 16:53:06 2011 /home/atlantis/Documents/teste.tar.lzma: LZMA compressed data, streamed /home/atlantis/Documents/teste.tar.xz: XZ compressed data Thanks Raphael. I'm going to update gentoo ebuilds to add the patch.
SVN commit 1230915 by rkcosta: Put the libarchive detection calls before configure_file(). The generated config.h was using some variables defined only after plugins/CMakeLists.txt called macro_optional_find_package(LibArchive), however the top-level CMakeLists.txt relied on these variables already being set, which was never the case. This should fix the case in which a proper libarchive version was present but Ark could not create tar.{xz,lzma} archives. BUG: 271553 FIXED-IN: 4.6.4 M +3 -0 CMakeLists.txt M +0 -4 plugins/CMakeLists.txt WebSVN link: http://websvn.kde.org/?view=rev&revision=1230915
SVN commit 1230916 by rkcosta: Put the libarchive detection calls before configure_file(). The generated config.h was using some variables defined only after plugins/CMakeLists.txt called macro_optional_find_package(LibArchive), however the top-level CMakeLists.txt relied on these variables already being set, which was never the case. Forward-port of r1230915. CCBUG: 271553 M +3 -0 CMakeLists.txt M +0 -4 plugins/CMakeLists.txt WebSVN link: http://websvn.kde.org/?view=rev&revision=1230916
Thanks, my ISP was down.