Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 561418 - sys-kernel/linux-headers-3.14 removed?
Summary: sys-kernel/linux-headers-3.14 removed?
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-24 23:25 UTC by Joakim Tjernlund
Modified: 2015-11-12 19:25 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2015-09-24 23:25:52 UTC
sys-kernel/linux-headers-3.14 is no longer in tree while there is
still sys-kernel/gentoo-sources-3.14.X in tree.

One really need matching headers to make glibc happy.
Otherwise glibc thinks kernel supports some fancy new feature which isn't
there and apps starts to malfunction.

Please restore above headers.
Comment 1 SpanKY gentoo-dev 2015-09-25 18:56:00 UTC
err, no, glibc doesn't do that at all.  kernel headers are used to *optionally* test & use a feature, but if it's not available, glibc will *transparently* fall back to the features that are available based on the min kernel version.  you can see that value easily:
$ file -L /lib/libc.so.6 
/lib/libc.so.6: ELF 32-bit LSB shared object, Intel 80386, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, stripped

that glibc is guaranteed to work on linux-2.6.32 and newer even though it was built against a much newer kernel headers version (4.2 in my case).

if you know of an actual bug where glibc misbehaves on an older kernel, please file a bug upstream for glibc (and feel free to cc me):
  http://sourceware.org/bugzilla/
Comment 2 Joakim Tjernlund 2015-09-26 11:18:01 UTC
I remember 2 incidents from our server park, one was samba using a
newer syscall than was available. Then other one was related to NFS I think.

Even if this wasn't glibc's fault, using newer kernel headers is just
asking for trouble for no gain.

Please, just leave matching headers in tree until the corresponding
kernel is gone.
Comment 3 SpanKY gentoo-dev 2015-09-26 14:50:24 UTC
(In reply to Joakim Tjernlund from comment #2)

sorry, but no.  if you have bugs, we'll look.
Comment 4 Joakim Tjernlund 2015-09-26 16:18:45 UTC
(In reply to SpanKY from comment #3)
> (In reply to Joakim Tjernlund from comment #2)
> 
> sorry, but no.  if you have bugs, we'll look.

Not ATM. The 2 problems I mentioned are history and I learnt to
never use newer headers than the kernel.
There is nothing to be gained using newer headers, just headache.

I can see that a distribution wants this freedom but why take this risk
when you don't have to?
Comment 5 SpanKY gentoo-dev 2015-09-28 15:11:39 UTC
(In reply to Joakim Tjernlund from comment #4)

we actively support newer headers on older kernels (as do a lot of distros), and i haven't generally run into a problem.  i don't think it's nearly as dangerous as you make out.

if you hit a bug, report it.  we don't generally operate on anecdotes.
Comment 6 Joakim Tjernlund 2015-09-28 15:50:40 UTC
(In reply to SpanKY from comment #5)
> (In reply to Joakim Tjernlund from comment #4)
> 
> we actively support newer headers on older kernels (as do a lot of distros),
> and i haven't generally run into a problem.  i don't think it's nearly as
> dangerous as you make out.

Sure, it probably works well for most. We had the misfortune to hit
bugs twice on our servers and since then we just decided to use matching
headers whenever possible.

> 
> if you hit a bug, report it.  we don't generally operate on anecdotes.

I will but that is not likely to happen due to:

1) We will do our best to keep them in sync.
2) If an busy server misbehaves due we generally don't have
   time to investigate that much, just fix it fast as possible.

I just didn't think it would be a problem to hang on to older headers for as long
there are corresponding sources in tree. Anyhow, now I know and will stop here.
Comment 7 Tomáš Mózes 2015-11-12 08:35:41 UTC
- install a fresh gentoo machine
- it has linux-headers 3.18
- run kernel 3.14 (LTS)
- build net-misc/openntpd-5.7_p4-r2 and get an error, because glibc (built with 3.18 headers) generated (https://bugs.gentoo.org/show_bug.cgi?id=565570):

# grep -ri getrandom /usr/include/
/usr/include/bits/syscall.h:#define SYS_getrandom __NR_getrandom
/usr/include/bits/syscall.h:#define SYS_getrandom __NR_getrandom
/usr/include/bits/syscall.h:#define SYS_getrandom __NR_getrandom

and so openntpd thinks it has SYS_getrandom:

#ifdef SYS_getrandom
...

Solution is to install linux-headers-3.14, recompile glibc, then we bits/syscall.h does not define SYS_getrandom as it was introduced in kernel 3.17.
Comment 8 Joakim Tjernlund 2015-11-12 12:00:04 UTC
(In reply to Tomas Mozes from comment #7)
> - install a fresh gentoo machine
> - it has linux-headers 3.18
> - run kernel 3.14 (LTS)
> - build net-misc/openntpd-5.7_p4-r2 and get an error, because glibc (built
> with 3.18 headers) generated
> (https://bugs.gentoo.org/show_bug.cgi?id=565570):
> 
> # grep -ri getrandom /usr/include/
> /usr/include/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> /usr/include/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> /usr/include/bits/syscall.h:#define SYS_getrandom __NR_getrandom
> 
> and so openntpd thinks it has SYS_getrandom:
> 
> #ifdef SYS_getrandom
> ...
> 
> Solution is to install linux-headers-3.14, recompile glibc, then we
> bits/syscall.h does not define SYS_getrandom as it was introduced in kernel
> 3.17.

Right, we had a similar problem with Samba some years ago.
While glibc might do the right thing, apps do not.

There is no easy fix for this type of errors other than
to keep linux-headers in sync with your kernel.

There should be matching headers to every stable kernel in the repo.
Comment 9 SpanKY gentoo-dev 2015-11-12 19:25:27 UTC
(In reply to Tomas Mozes from comment #7)

that's a bug in openntpd.  file one against it.