Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] kernel 4.9.77 error segfault in compile.
Date: Tue, 23 Jan 2018 17:35:49
Message-Id: CAGfcS_=9OWgSFxqJ_62ivTa8uw6Ezbx3a42WzkCpmJSWQ-7Jhw@mail.gmail.com
In Reply to: Re: [gentoo-user] kernel 4.9.77 error segfault in compile. by Corbin Bird
1 On Tue, Jan 23, 2018 at 12:28 PM, Corbin Bird <corbinbird@×××××××.net> wrote:
2 >
3 >
4 > FYI :
5 > Just tried a different compile.
6 > Switched off expert and flipped the CPU to "Generic x86_64" ( no other
7 > changes ).
8 >
9 > It compiled. ??????
10 >
11 > So ... what you choose for CPU in the kernel determines if the
12 > ext2/ext3/ext4 fs driver will compile.
13 >
14 > Been using Gentoo / "sys-kernel/gentoo-sources" w/experimental for 3+
15 > years now.
16 > First time the CPU choice has caused a problem.
17 >
18 > Suspect that a mismatch of the "Spectre / Meltdown" patches that have
19 > somehow gotten into the ext4 fs driver and the code for specific CPUs.
20 >
21 > Wonderful ... just finished a complete reload of Gentoo. Now have to
22 > redo it again ...
23 > ... the mistake? I used ext2/ext3 for the fs.
24 >
25
26 Abandoning ext4 over retpolines/etc seems a bit drastic. My guess is
27 that there is a bug in the latest kernel that will get fixed, or maybe
28 a bug in gcc (which needs to be patched for spectre anyway).
29
30 These Spectre changes are being merged and it has been a real mess.
31 The vulnerability is relatively serious so there is a lot of pressure
32 to do something, but the changes aren't trivial so they could contain
33 bugs or expose compiler bugs.
34
35 FWIW upstream 4.9.77 builds just fine for me,
36
37 If you want to mess with building alternate kernels to debug this here
38 are some instructions I created for this:
39
40 As a test you might consider the following:
41
42 mkdir /someplace
43 cd /someplace
44 git clone -b linux-4.9.y
45 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
46 .
47 mkdir /var/tmp/linux
48 cp /path/to/config /var/tmp/linux/.config
49 make O=/var/tmp/linux oldconfig
50 make O=/var/tmp/linux -j#
51
52 That will build the latest stable upstream kernel.
53
54 Depending on what you find you can do:
55 git checkout v4.9.76
56 rm -r /var/tmp/linux
57 mkdir /var/tmp/linux
58 cp /path/to/config /var/tmp/linux/.config
59 make O=/var/tmp/linux oldconfig
60 make O=/var/tmp/linux -j#
61
62 That will see if 4.9.76 fails. You could also substitute any version
63 you want (including a 4.14 kernel, or an earlier 4.9 kernel). This
64 will give you a sense of whether your toolchain is just entirely
65 broken, or if there is an issue with the objtool changes.
66
67 Note that you can build away as much as you want without having to
68 install any of this - so it won't affect your system at all. In fact,
69 the instructions above will work just fine if you run them as
70 non-root, as long as you clone the git sources and put the temp
71 directory someplace your non-root user has access to.
72
73 --
74 Rich

Replies

Subject Author
Re: [gentoo-user] kernel 4.9.77 error segfault in compile. Wol's lists <antlists@××××××××××××.uk>
Re: [gentoo-user] kernel 4.9.77 error segfault in compile. Corbin Bird <corbinbird@×××××××.net>