Bug 1392208 - [aarch64] rpm fails to install unzip if hardlink creation fails
Summary: [aarch64] rpm fails to install unzip if hardlink creation fails
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: unzip
Version: 25
Hardware: aarch64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Petr Stodulka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1392210 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-06 08:02 UTC by Tommy He
Modified: 2016-11-11 00:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-11 00:26:22 UTC
Type: Bug


Attachments (Terms of Use)
dnf error output (1.74 KB, text/plain)
2016-11-06 08:02 UTC, Tommy He
no flags Details
rpm error (9.00 KB, text/plain)
2016-11-06 08:05 UTC, Tommy He
no flags Details
strace rpm (432.22 KB, text/plain)
2016-11-10 02:57 UTC, Tommy He
no flags Details

Description Tommy He 2016-11-06 08:02:48 UTC
Created attachment 1217701 [details]
dnf error output

Description of problem:

Unable to install unzip-6.0.30.fc25.aarch64.rpm on aarch64 device

Version-Release number of selected component (if applicable):

6.0.30.fc25

How reproducible:

100%

Steps to Reproduce:
1. Run "dnf install unzip" on a device with aarch64 arcitechture
2.
3.

Actual results:

Error like:

Error unpacking rpm package unzip-6.0-30.fc25.aarch64
Error unpacking rpm package unzip-6.0-30.fc25.aarch64
error: unpacking of archive failed on file /usr/bin/zipinfo;581a917e: cpio: link

Expected results:

It was installed properly

Additional info:

See error message

Comment 1 Tommy He 2016-11-06 08:05:10 UTC
Created attachment 1217702 [details]
rpm error

Error output if install the rpm package manually

Comment 2 Petr Stodulka 2016-11-07 12:21:10 UTC
Hi Tommy, it seems similar to your another bug #1392210. Could you try install this package? https://kojipkgs.fedoraproject.org//packages/unzip/6.0/30.fc25/aarch64/unzip-debuginfo-6.0-30.fc25.aarch64.rpm

Comment 3 Kamil Dudka 2016-11-07 12:43:53 UTC
Comment on attachment 1217702 [details]
rpm error

Could you please attach the output of strace for this?

Comment 4 Kamil Dudka 2016-11-07 12:45:54 UTC
... and also the output of 'sha1sum unzip-6.0-30.fc25.aarch64.rpm'?

Comment 5 Tommy He 2016-11-09 04:50:19 UTC
Tried above command, the error is the same.

Also, sha1sum of unzip:

efd4bef54b749d589983431dbb1be52696d2b37a

I got strace installed but might need a little more guidence on how to generate the one you need. Hint?

Comment 6 Petr Stodulka 2016-11-09 08:35:53 UTC
(In reply to Tommy He from comment #5)
> Tried above command, the error is the same.
> 
> Also, sha1sum of unzip:
> 
> efd4bef54b749d589983431dbb1be52696d2b37a
> 

Ok. You have downloaded correct package.

> I got strace installed but might need a little more guidence on how to 
> generate the one you need. Hint?

# strace -o straceout dnf install unzip

Attach file straceout.

Comment 7 Kamil Dudka 2016-11-09 09:32:56 UTC
*** Bug 1392210 has been marked as a duplicate of this bug. ***

Comment 8 Kamil Dudka 2016-11-09 09:35:43 UTC
(In reply to pstodulk from comment #6)
> # strace -o straceout dnf install unzip
> 
> Attach file straceout.

Better to strace the rpm command directly to eliminate the noise produced by dnf, python, etc.

Comment 9 Tommy He 2016-11-10 02:57:31 UTC
Created attachment 1219135 [details]
strace rpm

Attach strace result

Comment 10 Kamil Dudka 2016-11-10 08:08:34 UTC
Comment on attachment 1219135 [details]
strace rpm

So the cause seems to be the following syscall:

> linkat(AT_FDCWD, "/usr/bin/unzip", AT_FDCWD, "/usr/bin/zipinfo;5823e075", 0) = -1 EACCES (Permission denied)

Have you tried it with SELinux in permissive mode?

Can you see anything related in the output of dmesg or journalctl?

Comment 11 Tommy He 2016-11-10 08:49:57 UTC
(In reply to Kamil Dudka from comment #10)
> Comment on attachment 1219135 [details]
> strace rpm
> 
> So the cause seems to be the following syscall:
> 
> > linkat(AT_FDCWD, "/usr/bin/unzip", AT_FDCWD, "/usr/bin/zipinfo;5823e075", 0) = -1 EACCES (Permission denied)

What's specail about this syscall, may I know?
 
> Have you tried it with SELinux in permissive mode?

SELinux is disabled.

> Can you see anything related in the output of dmesg or journalctl?

Nothing shows in dmesg or journalctl.

Like I said in now closed duplicated one, I was using Fedora on a proot Android device. Most of rpm can be installed(strace, libreoffice) but some failed like this.

Comment 12 Kamil Dudka 2016-11-10 09:45:02 UTC
(In reply to Tommy He from comment #11)
> What's specail about this syscall, may I know?

It seems to be cause of the error.  rpm is unable to create a hardlink "/usr/bin/zipinfo;5823e075" from "/usr/bin/unzip".  The hardlink creation fails with EACCES (Permission denied).  Are you able to create the link manually?

# ln -v "/usr/bin/unzip" "/usr/bin/zipinfo;5823e075"

What is the underlying file system?

# df -T /usr/bin/unzip

Comment 13 Kamil Dudka 2016-11-10 09:51:53 UTC
(In reply to Tommy He from comment #11)
> Most of rpm can be installed(strace, libreoffice) but some failed like this.

Most probably because the other RPMs do not install any hard-linked files like unzip does:

$ stat --printf '%d/%i\n' /usr/bin/{unzip,zipinfo}
64514/16792640
64514/16792640

Comment 14 Tommy He 2016-11-11 00:26:22 UTC
(In reply to Kamil Dudka from comment #13)
> (In reply to Tommy He from comment #11)
> > Most of rpm can be installed(strace, libreoffice) but some failed like this.
> 
> Most probably because the other RPMs do not install any hard-linked files
> like unzip does:
> 
> $ stat --printf '%d/%i\n' /usr/bin/{unzip,zipinfo}
> 64514/16792640
> 64514/16792640

Based on your information, I found this entry: http://stackoverflow.com/questions/32365690/is-android-m-not-allowing-hard-links

As I was using proot on a Android 6.0 device, the hard link creation is prohibited by SELinux enforced by Android system. Tested manual linking, same error.

I also found another similar device but with Android 5.0. Tried the similar method to get Fedora loaded and tested unzip installing. No issues 

Besides unzip and coreutils-common, I also tested some other packages that involving hard link creation like gcc and dmraid. All failed.

Hence I'm quite convinced that this is the cause.

Thank you for the effort and closing.
I'm closing this bug as there is nothing Fedora can do.


Note You need to log in before you can comment on or make changes to this bug.