Bug 1242397

Summary: gvfsd-archive eating 100% CPU in endless loop, nothing happen if encrypted ZIP is opened
Product: [Fedora] Fedora Reporter: Jaroslav Škarvada <jskarvad>
Component: gvfsAssignee: Ondrej Holy <oholy>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: alexl, bnocera, oholy
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-14 10:48:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Škarvada 2015-07-13 09:29:19 UTC
Description of problem:
Opened encrypted ZIP file from firefox (in xfce), nothing happened, CPU utilized to 100%

Version-Release number of selected component (if applicable):
gvfs-1.24.1-2.fc22.x86_64
libarchive-3.1.2-12.fc22.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Open encrypted ZIP file from firefox in xfce

Actual results:
Nothing, happened, CPU utilized to 100% in endless loop

Expected results:
Archive opened with password prompt

Additional info:
It seems it's cycling in the "pool" thread in userspace somewhere around:

#0  0x00007f8278f3b711 in archive_string_append (as=as@entry=0x7f826001c640, p=p@entry=0x7f826e880bec "t\177", s=s@entry=1)
    at libarchive/archive_string.c:209
#1  0x00007f8278f3e768 in archive_strappend_char (as=as@entry=0x7f826001c640, c=116 't') at libarchive/archive_string.c:387
#2  0x00007f8278f3f55f in archive_string_vsprintf (as=as@entry=0x7f826001c640, fmt=fmt@entry=0x7f8278f6e36e "Encrypted file is unsupported", ap=ap@entry=0x7f826e880c40) at libarchive/archive_string_sprintf.c:112
#3  0x00007f8278f3fc9d in archive_set_error (a=0x7f826001c600, error_number=error_number@entry=84, fmt=fmt@entry=0x7f8278f6e36e "Encrypted file is unsupported") at libarchive/archive_util.c:164
#4  0x00007f8278f38cdb in archive_read_format_zip_read_data (a=0x7f826001c600, buff=<optimized out>, size=0x7f826e880d90, offset=<optimized out>) at libarchive/archive_read_support_format_zip.c:1194
#5  0x0000000000404b24 in do_mount (entry=<optimized out>, archive=<optimized out>) at gvfsbackendarchive.c:392
#6  0x0000000000404b24 in do_mount (file=0x7f8260011d00, file=0x7f8260011d00, entry_index=0, entry=0x7f826001ce70, archive=0x7f826001b5c0) at gvfsbackendarchive.c:481
#7  0x0000000000404b24 in do_mount (job=<optimized out>, ba=0x10d5880 [GVfsBackendArchive]) at gvfsbackendarchive.c:579
#8  0x0000000000404b24 in do_mount (backend=<optimized out>, job=<optimized out>, mount_spec=<optimized out>, mount_source=<optimized out>, is_automount=<optimized out>) at gvfsbackendarchive.c:686
#9  0x00007f827a37d40a in g_vfs_job_run (job=0x10c04b0 [GVfsJobMount]) at gvfsjob.c:197
#10 0x00007f8279200a3e in g_thread_pool_thread_proxy (data=<optimized out>) at gthreadpool.c:307
#11 0x00007f82792000a5 in g_thread_proxy (data=0x10ce630) at gthread.c:764
#12 0x00007f8278ad2555 in start_thread (arg=0x7f826e881700) at pthread_create.c:333
#13 0x00007f827880cf3d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

So from the backtrace it seems it's trying to say that "Encrypted file is unsupported", but no dialog appeared, it's just cycling in endless loop. Encrypted archives worked in F21, so it's very probably regression.

Comment 2 Ondrej Holy 2015-07-14 10:48:42 UTC
Thanks for your bug report. GVfs archive backend doesn't support encrypted archives. There is missing encryption support in libarchive as far as I know (as per the error message in the backtrace). Unfortunately ARCHIVE_FAILED error code isn't handled properly and it should be fixed.

File Roller can be used for the encrypted archives instead of Archive Mounter. It should be set as a default mime type handler for archives in Fedora, shouldn't be?

Comment 3 Jaroslav Škarvada 2015-07-14 11:32:00 UTC
(In reply to Ondrej Holy from comment #2)
> File Roller can be used for the encrypted archives instead of Archive
> Mounter. It should be set as a default mime type handler for archives in
> Fedora, shouldn't be?

Not sure, I didn't change it, I immediately encountered it after upgrade to F22. I will recheck the MIME settings.

Comment 4 Jaroslav Škarvada 2015-07-14 16:12:04 UTC
(In reply to Jaroslav Škarvada from comment #3)
> (In reply to Ondrej Holy from comment #2)
> > File Roller can be used for the encrypted archives instead of Archive
> > Mounter. It should be set as a default mime type handler for archives in
> > Fedora, shouldn't be?
> 
> Not sure, I didn't change it, I immediately encountered it after upgrade to
> F22. I will recheck the MIME settings.

Traced down to bug 1243049.