Bug 1431296 - conflicts between kernel-core subpackages on upgrade
Summary: conflicts between kernel-core subpackages on upgrade
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1433169 1433565 1433567 1433922 (view as bug list)
Depends On: 1432372
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-10 22:54 UTC by Kevin Fenzi
Modified: 2019-01-09 12:54 UTC (History)
23 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-14 17:41:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Kevin Fenzi 2017-03-10 22:54:27 UTC
Dependencies resolved.
========================================================================================================================
 Package                                   Arch           Version                           Repository             Size
========================================================================================================================
Installing:
 kernel                                    x86_64         4.11.0-0.rc1.git3.1.fc27          koji                   51 k
 kernel-core                               x86_64         4.11.0-0.rc1.git3.1.fc27          koji                   22 M
 kernel-modules                            x86_64         4.11.0-0.rc1.git3.1.fc27          koji                   23 M
 kernel-modules-extra                      x86_64         4.11.0-0.rc1.git3.1.fc27          koji                  2.2 M
Upgrading:
...snip...
Removing:
 kernel                                    x86_64         4.11.0-0.rc0.git9.1.fc27          @@commandline           0  
 kernel-core                               x86_64         4.11.0-0.rc0.git9.1.fc27          @@commandline          56 M
 kernel-modules                            x86_64         4.11.0-0.rc0.git9.1.fc27          @@commandline          23 M
 kernel-modules-extra                      x86_64         4.11.0-0.rc0.git9.1.fc27          @@commandline         2.1 M
...snip...
Error: Transaction check error:
  file /usr/lib/.build-id/88/5a3f6ce5d13058b49e4345d6eded6f4f3bc72a from install of kernel-core-4.11.0-0.rc1.git3.1.fc27.x86_64 conflicts with file from package kernel-core-4.11.0-0.rc1.git1.1.fc27.x86_64
  file /usr/lib/.build-id/cb/9cd07c38bfff366a983b88c080d1837586c864 from install of kernel-core-4.11.0-0.rc1.git3.1.fc27.x86_64 conflicts with file from package kernel-core-4.11.0-0.rc1.git1.1.fc27.x86_64

Error Summary
-------------

Comment 1 Laura Abbott 2017-03-10 22:57:36 UTC
Is this more fallout from https://bugzilla.redhat.com/show_bug.cgi?id=1430587

Comment 2 Stephen John Smoogen 2017-03-14 00:36:01 UTC
*** Bug 1431896 has been marked as a duplicate of this bug. ***

Comment 3 Laura Abbott 2017-03-16 15:49:23 UTC
I'm pretty sure this is not kernel specific but a general RPM issue.

Comment 4 Igor Gnatenko 2017-03-16 16:49:46 UTC
This is basically same as https://bugzilla.redhat.com/show_bug.cgi?id=1432372, so kernel needs to be rebuilt...

But thinking about upgrade path.. not sure how to properly handle that. Probably simple:

# find /usr/lib/.build-id -type d -exec chmod 755 {} ';'

Laura, if you will find more such cases and solution from above works, probably we should announce it on devel@.

Comment 5 Adam Williamson 2017-03-17 00:26:01 UTC
*** Bug 1433169 has been marked as a duplicate of this bug. ***

Comment 6 Adam Williamson 2017-03-17 00:27:01 UTC
Igor: remember, kernel packages are a special case. We do not *upgrade* kernels. We parallel install them. So kernel packages cannot contain files with the same name but different contents. If rpm is causing this to happen, that's a problem and needs to be fixed.

Comment 7 Igor Gnatenko 2017-03-17 06:40:58 UTC
(In reply to Adam Williamson from comment #6)
> Igor: remember, kernel packages are a special case. We do not *upgrade*
> kernels. We parallel install them. So kernel packages cannot contain files
> with the same name but different contents. If rpm is causing this to happen,
> that's a problem and needs to be fixed.
Yes, I know. But problem is that broken RPM produced wrong packages. And we can't do anything about it now. We can't disable check or fix user systems automatically.

Comment 8 Yanko Kaneti 2017-03-17 08:54:59 UTC
Erm..., the issue here is not about file attribute differences produced by a broken rpm. Its about certain elf objects in the kernel tree having the same exact build-id between two different kernel packages leading to /usr/lib/.build-id/...<symlink> conflicts between the two.
These symlinks are actually different and not just having different attributes.


In my case it was the vdso/vdso{32,64}.so -s from 
kernel-core-4.11.0-0.rc2.git0.1.fc27.x86_64 and kernel-core-4.11.0-0.rc2.git1.2.fc27.x86_64

I checked the .so-s separately from rpm and their build-id's were the same. So I can't fault rpm for having the conflicting symlink

How is rpm supposed to deal with that? and why these .so-s had the same build-id in the first place ?

Comment 9 Mark Wielaard 2017-03-17 08:58:21 UTC
(In reply to Adam Williamson from comment #6)
> Igor: remember, kernel packages are a special case. We do not *upgrade*
> kernels. We parallel install them. So kernel packages cannot contain files
> with the same name but different contents. If rpm is causing this to happen,
> that's a problem and needs to be fixed.

Thanks for the analysis. That is exactly what is happening and what rpm should be preventing. Different builds should generate generate different build-ids. Which is what rpm tries to guarantee.

But the kernel package defeats rpm by calling debugedit directly and then overriding __debug_install_post and how find-debuginfo.sh is called.

The correct fix is for the kernel to call find-debuginfo.sh and debugedit like how rpm would. That means adding --ver-rel "%{VERSION}-%{RELEASE}" to the debuginfo_args and changing the debugedit call to include --build-id-seed=--ver-rel "%{VERSION}-%{RELEASE}". This is all a little involved because the kernel spec makes various assumptions about the precise workings of debugedit and find-debuginfo.sh and calls them (multiple times!) in different order.

So the easiest fix is reverting to the old setting for build-id links for the kernel by setting as follows:

diff --git a/kernel.spec b/kernel.spec
index 9a5fe0b..9d7f7ba 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -183,6 +183,9 @@ Summary: The Linux kernel
 %define _enable_debug_packages 0
 %endif
 %define debuginfodir /usr/lib/debug
+# Needed because we override almost everything involving build-ids
+# and debuginfo generation. Currently we rely on the old alldebug setting.
+%global _build_id_links alldebug
 
 # kernel PAE is only built on i686 and ARMv7.
 %ifnarch i686 armv7hl

But if you do please don't close this bug yet. We should come up with a better way for the kernel package to do this that doesn't require so many hacks overriding rpm macros to generate correct buildids and debuginfo. It also prevents the kernel to take advantage of some pending upstream improvements to rpm for parallel debuginfo generation for example.

Comment 10 Bowen Wang 2017-03-18 22:02:15 UTC
(In reply to Mark Wielaard from comment #9)
> (In reply to Adam Williamson from comment #6)
> > Igor: remember, kernel packages are a special case. We do not *upgrade*
> > kernels. We parallel install them. So kernel packages cannot contain files
> > with the same name but different contents. If rpm is causing this to happen,
> > that's a problem and needs to be fixed.
> 
> Thanks for the analysis. That is exactly what is happening and what rpm
> should be preventing. Different builds should generate generate different
> build-ids. Which is what rpm tries to guarantee.
> 
> But the kernel package defeats rpm by calling debugedit directly and then
> overriding __debug_install_post and how find-debuginfo.sh is called.
> 
> The correct fix is for the kernel to call find-debuginfo.sh and debugedit
> like how rpm would. That means adding --ver-rel "%{VERSION}-%{RELEASE}" to
> the debuginfo_args and changing the debugedit call to include
> --build-id-seed=--ver-rel "%{VERSION}-%{RELEASE}". This is all a little
> involved because the kernel spec makes various assumptions about the precise
> workings of debugedit and find-debuginfo.sh and calls them (multiple times!)
> in different order.
> 
> So the easiest fix is reverting to the old setting for build-id links for
> the kernel by setting as follows:
> 
> diff --git a/kernel.spec b/kernel.spec
> index 9a5fe0b..9d7f7ba 100644
> --- a/kernel.spec
> +++ b/kernel.spec
> @@ -183,6 +183,9 @@ Summary: The Linux kernel
>  %define _enable_debug_packages 0
>  %endif
>  %define debuginfodir /usr/lib/debug
> +# Needed because we override almost everything involving build-ids
> +# and debuginfo generation. Currently we rely on the old alldebug setting.
> +%global _build_id_links alldebug
>  
>  # kernel PAE is only built on i686 and ARMv7.
>  %ifnarch i686 armv7hl
> 
> But if you do please don't close this bug yet. We should come up with a
> better way for the kernel package to do this that doesn't require so many
> hacks overriding rpm macros to generate correct buildids and debuginfo. It
> also prevents the kernel to take advantage of some pending upstream
> improvements to rpm for parallel debuginfo generation for example.

I don't really understand those command here. As an user, what should I do to get the rawhide updated?

Comment 11 Mark Wielaard 2017-03-19 00:23:26 UTC
(In reply to Bowen Wang from comment #10)
> (In reply to Mark Wielaard from comment #9)
> > So the easiest fix is reverting to the old setting for build-id links for
> > the kernel by setting as follows:
> > 
> > diff --git a/kernel.spec b/kernel.spec
> > index 9a5fe0b..9d7f7ba 100644
> > --- a/kernel.spec
> > +++ b/kernel.spec
> > @@ -183,6 +183,9 @@ Summary: The Linux kernel
> >  %define _enable_debug_packages 0
> >  %endif
> >  %define debuginfodir /usr/lib/debug
> > +# Needed because we override almost everything involving build-ids
> > +# and debuginfo generation. Currently we rely on the old alldebug setting.
> > +%global _build_id_links alldebug
> >  
> >  # kernel PAE is only built on i686 and ARMv7.
> >  %ifnarch i686 armv7hl
> > 
> > But if you do please don't close this bug yet. We should come up with a
> > better way for the kernel package to do this that doesn't require so many
> > hacks overriding rpm macros to generate correct buildids and debuginfo. It
> > also prevents the kernel to take advantage of some pending upstream
> > improvements to rpm for parallel debuginfo generation for example.
> 
> I don't really understand those command here. As an user, what should I do
> to get the rawhide updated?

You can either build your own kernel package with the above patch applied or wait till a kernel package maintainer has time to look at the report and apply the workaround if they think that is the best way forward. Then you'll get an updated kernel package without any of the build-id files that cause conflicts.

Comment 12 Bowen Wang 2017-03-19 08:38:39 UTC
(In reply to Mark Wielaard from comment #11)
> (In reply to Bowen Wang from comment #10)
> > (In reply to Mark Wielaard from comment #9)
> > > So the easiest fix is reverting to the old setting for build-id links for
> > > the kernel by setting as follows:
> > > 
> > > diff --git a/kernel.spec b/kernel.spec
> > > index 9a5fe0b..9d7f7ba 100644
> > > --- a/kernel.spec
> > > +++ b/kernel.spec
> > > @@ -183,6 +183,9 @@ Summary: The Linux kernel
> > >  %define _enable_debug_packages 0
> > >  %endif
> > >  %define debuginfodir /usr/lib/debug
> > > +# Needed because we override almost everything involving build-ids
> > > +# and debuginfo generation. Currently we rely on the old alldebug setting.
> > > +%global _build_id_links alldebug
> > >  
> > >  # kernel PAE is only built on i686 and ARMv7.
> > >  %ifnarch i686 armv7hl
> > > 
> > > But if you do please don't close this bug yet. We should come up with a
> > > better way for the kernel package to do this that doesn't require so many
> > > hacks overriding rpm macros to generate correct buildids and debuginfo. It
> > > also prevents the kernel to take advantage of some pending upstream
> > > improvements to rpm for parallel debuginfo generation for example.
> > 
> > I don't really understand those command here. As an user, what should I do
> > to get the rawhide updated?
> 
> You can either build your own kernel package with the above patch applied or
> wait till a kernel package maintainer has time to look at the report and
> apply the workaround if they think that is the best way forward. Then you'll
> get an updated kernel package without any of the build-id files that cause
> conflicts.

Ok, thanks.

Comment 13 Jason Taylor 2017-03-20 11:54:05 UTC
*** Bug 1433922 has been marked as a duplicate of this bug. ***

Comment 14 Laura Abbott 2017-03-20 14:57:36 UTC
*** Bug 1433565 has been marked as a duplicate of this bug. ***

Comment 15 Laura Abbott 2017-03-20 14:58:02 UTC
*** Bug 1433567 has been marked as a duplicate of this bug. ***

Comment 16 Laura Abbott 2017-03-20 20:12:16 UTC
As mentioned on the mailing list, I applied the workaround to today's rawhide. Looking at debuginfo is on my TODO list this week.


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