Re: [gentoo-user] glibc-2.33-r1 crashes out at the start before building.

2021-07-13 Thread Alan Mackenzie
Hello, Sergei and Gentoo.

On Thu, Jul 08, 2021 at 09:00:59 +0100, Sergei Trofimovich wrote:
> On Wed, 7 Jul 2021 18:16:44 +
> Alan Mackenzie  wrote:

> > Hello, Gentoo.

> > Would somebody help me here, please.

> > When I try to emerge glibc-2.33-r1, the very first phase of the build
> > crashes out with:

> >  x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native   -Wl,-O1 -Wl,--as-needed  
> > glibc-test.c   -o glibc-test
> >  * Checking that IA32 emulation is enabled in the running kernel ...
> > /usr/portage/sys-libs/glibc/glibc-2.33-r1.ebuild: line 608:   199 
> > Segmentation fault  "${T}/check-ia32-emulation.elf32"
> > [ !! ]
> >  * ERROR: sys-libs/glibc-2.33-r1::gentoo failed (pretend phase):
> >  *   CONFIG_IA32_EMULATION must be enabled in the kernel to compile a 
> > multilib glibc.
> >  *
> >  * Call stack:
> >  *  ebuild.sh, line 127:  Called pkg_pretend
> >  *   glibc-2.33-r1.ebuild, line 721:  Called sanity_prechecks
> >  *   glibc-2.33-r1.ebuild, line 670:  Called die
> >  * The specific snippet of code:
> >  *  [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION 
> > must be enabled in the kernel to compile a multilib glibc."
> >  *
> >  * If you need support, post the output of `emerge --info 
> > '=sys-libs/glibc-2.33-r1::gentoo'`,
> >  * the complete build log and the output of `emerge -pqv 
> > '=sys-libs/glibc-2.33-r1::gentoo'`.
> >  * The complete build log is located at 
> > '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'.
> >  * The ebuild environment file is located at 
> > '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/die.env'.
> >  * Working directory: '/var/tmp/portage/sys-libs/glibc-2.33-r1/empty'
> >  * S: '/var/tmp/portage/sys-libs/glibc-2.33-r1/work/glibc-2.33'

> > >>> Failed to emerge sys-libs/glibc-2.33-r1, Log file:  

> > >>>  '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'  

> > What is clearly happening is that the C Compiler is crashing out with a
> > segfault.  I actually have CONFIG_IA32_EMULATION in my kernel config.

> > I've tried this with both GCC-10.3.0 and GCC-9.3.0 with the same results
> > on both.

> > What is going wrong? (Horrible thought - maybe my RAM is failing.)

> If it happens consistently it's more likely a software problem and
> not a hardware problem.

> Try getting a backtrace and instructing dump out of SIGSEGVing glibc-test.

> The typical session would look like:
> $ gdb ./glibc-test
> (gdb) run
> (gdb) bt
> (gdb) disassemble

In the end, I submitted bug #802036 to the Gentoo bugzilla.  Ben Kohler
noticed straight away I was still using a very old binutils (hence the
benefit of supplying complete documentation with a bug), and remarked
that problems had been seen with glibc and old binutils.  Sergei then
helped with practical suggestions.

I didn't even know you had manually to configure binutils versions, but I
did this, and glibc continued to crash out.  Then I tried editing the
ebuild file, removing the check that was causing the crash.  This gave me
ebuild validation errors.  So, after looking up the man page, I gave the
argument --digest to emerge, and it built.  Phew!

So, after catching up on my emerging, I've just got one package which
isn't building, libdrm, but that can wait till another day.

> -- 

>   Sergei

-- 
Alan Mackenzie (Nuremberg, Germany).



Re: [gentoo-user] glibc-2.33-r1 crashes out at the start before building.

2021-07-08 Thread Sergei Trofimovich
On Wed, 7 Jul 2021 18:16:44 +
Alan Mackenzie  wrote:

> Hello, Gentoo.
> 
> Would somebody help me here, please.
> 
> When I try to emerge glibc-2.33-r1, the very first phase of the build
> crashes out with:
> 
>  x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native   -Wl,-O1 -Wl,--as-needed  
> glibc-test.c   -o glibc-test
>  * Checking that IA32 emulation is enabled in the running kernel ...
> /usr/portage/sys-libs/glibc/glibc-2.33-r1.ebuild: line 608:   199 
> Segmentation fault  "${T}/check-ia32-emulation.elf32"
> [ !! ]
>  * ERROR: sys-libs/glibc-2.33-r1::gentoo failed (pretend phase):
>  *   CONFIG_IA32_EMULATION must be enabled in the kernel to compile a 
> multilib glibc.
>  *
>  * Call stack:
>  *  ebuild.sh, line 127:  Called pkg_pretend
>  *   glibc-2.33-r1.ebuild, line 721:  Called sanity_prechecks
>  *   glibc-2.33-r1.ebuild, line 670:  Called die
>  * The specific snippet of code:
>  *  [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must 
> be enabled in the kernel to compile a multilib glibc."
>  *
>  * If you need support, post the output of `emerge --info 
> '=sys-libs/glibc-2.33-r1::gentoo'`,
>  * the complete build log and the output of `emerge -pqv 
> '=sys-libs/glibc-2.33-r1::gentoo'`.
>  * The complete build log is located at 
> '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'.
>  * The ebuild environment file is located at 
> '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/die.env'.
>  * Working directory: '/var/tmp/portage/sys-libs/glibc-2.33-r1/empty'
>  * S: '/var/tmp/portage/sys-libs/glibc-2.33-r1/work/glibc-2.33'
> 
> >>> Failed to emerge sys-libs/glibc-2.33-r1, Log file:  
> 
> >>>  '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'  
> 
> What is clearly happening is that the C Compiler is crashing out with a
> segfault.  I actually have CONFIG_IA32_EMULATION in my kernel config.
> 
> I've tried this with both GCC-10.3.0 and GCC-9.3.0 with the same results
> on both.
> 
> What is going wrong? (Horrible thought - maybe my RAM is failing.)

If it happens consistently it's more likely a software problem and
not a hardware problem.

Try getting a backtrace and instructing dump out of SIGSEGVing glibc-test.

The typical session would look like:
$ gdb ./glibc-test
(gdb) run
(gdb) bt
(gdb) disassemble

-- 

  Sergei



Re: [gentoo-user] glibc-2.33-r1 crashes out at the start before building.

2021-07-07 Thread Alan Mackenzie
Hello, Dan.

On Wed, Jul 07, 2021 at 12:28:35 -0700, Daniel Frey wrote:
> On 7/7/21 11:16 AM, Alan Mackenzie wrote:
> > Hello, Gentoo.

> > Would somebody help me here, please.

> > When I try to emerge glibc-2.33-r1, the very first phase of the build
> > crashes out with:

> >   x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native   -Wl,-O1 -Wl,--as-needed 
> >  glibc-test.c   -o glibc-test
> >   * Checking that IA32 emulation is enabled in the running kernel ...
> > /usr/portage/sys-libs/glibc/glibc-2.33-r1.ebuild: line 608:   199 
> > Segmentation fault  "${T}/check-ia32-emulation.elf32"
> > [ !! ]
> >   * ERROR: sys-libs/glibc-2.33-r1::gentoo failed (pretend phase):
> >   *   CONFIG_IA32_EMULATION must be enabled in the kernel to compile a 
> > multilib glibc.
> >   *
> >   * Call stack:
> >   *  ebuild.sh, line 127:  Called pkg_pretend
> >   *   glibc-2.33-r1.ebuild, line 721:  Called sanity_prechecks
> >   *   glibc-2.33-r1.ebuild, line 670:  Called die
> >   * The specific snippet of code:
> >   *  [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION 
> > must be enabled in the kernel to compile a multilib glibc."
> >   *
> >   * If you need support, post the output of `emerge --info 
> > '=sys-libs/glibc-2.33-r1::gentoo'`,
> >   * the complete build log and the output of `emerge -pqv 
> > '=sys-libs/glibc-2.33-r1::gentoo'`.
> >   * The complete build log is located at 
> > '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'.
> >   * The ebuild environment file is located at 
> > '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/die.env'.
> >   * Working directory: '/var/tmp/portage/sys-libs/glibc-2.33-r1/empty'
> >   * S: '/var/tmp/portage/sys-libs/glibc-2.33-r1/work/glibc-2.33'

>  Failed to emerge sys-libs/glibc-2.33-r1, Log file:

>    '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'

> > What is clearly happening is that the C Compiler is crashing out with a
> > segfault.  I actually have CONFIG_IA32_EMULATION in my kernel config.

> > I've tried this with both GCC-10.3.0 and GCC-9.3.0 with the same results
> > on both.

> > What is going wrong? (Horrible thought - maybe my RAM is failing.)


> It looks to me that it ran a test to see if you have a kernel option 
> enabled.

That's what the test is trying to discern, yes.

> It didn't, looks like it crashed. And then the build warns you 
> that you have to enable CONFIG_IA32_EMULATION in your kernel?

I do have CONFIG_IA32_EMULATION enable in my kernel, and have had for a
long time.  Something segfaulted (?the compiler), which looks like a bug
in wherever.

The emerge script doesn't return the position of the segfault (line 608
is just the beginning of the section).  It hides the return code STAT
(which wouldn't have been set anyway).  And it gives a wrong diagnostic
about a kernel setting.  How is one supposed to debug such a scenario?

> Dan

-- 
Alan Mackenzie (Nuremberg, Germany).



Re: [gentoo-user] glibc-2.33-r1 crashes out at the start before building.

2021-07-07 Thread Daniel Frey

On 7/7/21 11:16 AM, Alan Mackenzie wrote:

Hello, Gentoo.

Would somebody help me here, please.

When I try to emerge glibc-2.33-r1, the very first phase of the build
crashes out with:

  x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native   -Wl,-O1 -Wl,--as-needed  
glibc-test.c   -o glibc-test
  * Checking that IA32 emulation is enabled in the running kernel ...
/usr/portage/sys-libs/glibc/glibc-2.33-r1.ebuild: line 608:   199 Segmentation fault  
"${T}/check-ia32-emulation.elf32"
[ !! ]
  * ERROR: sys-libs/glibc-2.33-r1::gentoo failed (pretend phase):
  *   CONFIG_IA32_EMULATION must be enabled in the kernel to compile a multilib 
glibc.
  *
  * Call stack:
  *  ebuild.sh, line 127:  Called pkg_pretend
  *   glibc-2.33-r1.ebuild, line 721:  Called sanity_prechecks
  *   glibc-2.33-r1.ebuild, line 670:  Called die
  * The specific snippet of code:
  *  [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must be 
enabled in the kernel to compile a multilib glibc."
  *
  * If you need support, post the output of `emerge --info 
'=sys-libs/glibc-2.33-r1::gentoo'`,
  * the complete build log and the output of `emerge -pqv 
'=sys-libs/glibc-2.33-r1::gentoo'`.
  * The complete build log is located at 
'/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'.
  * The ebuild environment file is located at 
'/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/die.env'.
  * Working directory: '/var/tmp/portage/sys-libs/glibc-2.33-r1/empty'
  * S: '/var/tmp/portage/sys-libs/glibc-2.33-r1/work/glibc-2.33'


Failed to emerge sys-libs/glibc-2.33-r1, Log file:



  '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'


What is clearly happening is that the C Compiler is crashing out with a
segfault.  I actually have CONFIG_IA32_EMULATION in my kernel config.

I've tried this with both GCC-10.3.0 and GCC-9.3.0 with the same results
on both.

What is going wrong? (Horrible thought - maybe my RAM is failing.)



It looks to me that it ran a test to see if you have a kernel option 
enabled. It didn't, looks like it crashed. And then the build warns you 
that you have to enable CONFIG_IA32_EMULATION in your kernel?


Dan




Re: [gentoo-user] glibc-2.33-r1 crashes out at the start before building.

2021-07-07 Thread Alan Mackenzie
Hi, Dale.

On Wed, Jul 07, 2021 at 13:23:21 -0500, Dale wrote:
> Alan Mackenzie wrote:
> > Hello, Gentoo.

> > Would somebody help me here, please.

> > When I try to emerge glibc-2.33-r1, the very first phase of the build
> > crashes out with:

> >  x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native   -Wl,-O1 -Wl,--as-needed  
> > glibc-test.c   -o glibc-test
> >  * Checking that IA32 emulation is enabled in the running kernel ...
> > /usr/portage/sys-libs/glibc/glibc-2.33-r1.ebuild: line 608:   199 
> > Segmentation fault  "${T}/check-ia32-emulation.elf32"
> > [ !! ]
> >  * ERROR: sys-libs/glibc-2.33-r1::gentoo failed (pretend phase):
> >  *   CONFIG_IA32_EMULATION must be enabled in the kernel to compile a 
> > multilib glibc.
> >  *
> >  * Call stack:
> >  *  ebuild.sh, line 127:  Called pkg_pretend
> >  *   glibc-2.33-r1.ebuild, line 721:  Called sanity_prechecks
> >  *   glibc-2.33-r1.ebuild, line 670:  Called die
> >  * The specific snippet of code:
> >  *  [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION 
> > must be enabled in the kernel to compile a multilib glibc."
> >  *
> >  * If you need support, post the output of `emerge --info 
> > '=sys-libs/glibc-2.33-r1::gentoo'`,
> >  * the complete build log and the output of `emerge -pqv 
> > '=sys-libs/glibc-2.33-r1::gentoo'`.
> >  * The complete build log is located at 
> > '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'.
> >  * The ebuild environment file is located at 
> > '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/die.env'.
> >  * Working directory: '/var/tmp/portage/sys-libs/glibc-2.33-r1/empty'
> >  * S: '/var/tmp/portage/sys-libs/glibc-2.33-r1/work/glibc-2.33'

>  Failed to emerge sys-libs/glibc-2.33-r1, Log file:
>   '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'
> > What is clearly happening is that the C Compiler is crashing out with a
> > segfault.  I actually have CONFIG_IA32_EMULATION in my kernel config.

> > I've tried this with both GCC-10.3.0 and GCC-9.3.0 with the same results
> > on both.

> > What is going wrong? (Horrible thought - maybe my RAM is failing.)

Well, 20 minutes of memtest86+ doesn't show any errors, thankfully.

> Could it be that the /usr/src/linux link is pointing to the wrong kernel
> directory?  It could be pointing to a old config that doesn't have that
> option enabled.  I know I've done that before when rebuilding modules. 
> It's amazing how it doesn't work when that link is pointing to the wrong
> kernel. 

Thanks, I've just checked that.  The link is indeed pointing to the
correct kernel.  The only thing odd about it is the kernel has 777
permissions rather than 755, dating from April when I was messing with
the kernel's soft scrolling.  But that couldn't cause gcc to segfault,
surely?

> If it isn't that, maybe someone else will have a better idea. 

> Dale

> :-)  :-) 

-- 
Alan Mackenzie (Nuremberg, Germany).



Re: [gentoo-user] glibc-2.33-r1 crashes out at the start before building.

2021-07-07 Thread Dale
Alan Mackenzie wrote:
> Hello, Gentoo.
>
> Would somebody help me here, please.
>
> When I try to emerge glibc-2.33-r1, the very first phase of the build
> crashes out with:
>
>  x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native   -Wl,-O1 -Wl,--as-needed  
> glibc-test.c   -o glibc-test
>  * Checking that IA32 emulation is enabled in the running kernel ...
> /usr/portage/sys-libs/glibc/glibc-2.33-r1.ebuild: line 608:   199 
> Segmentation fault  "${T}/check-ia32-emulation.elf32"
> [ !! ]
>  * ERROR: sys-libs/glibc-2.33-r1::gentoo failed (pretend phase):
>  *   CONFIG_IA32_EMULATION must be enabled in the kernel to compile a 
> multilib glibc.
>  *
>  * Call stack:
>  *  ebuild.sh, line 127:  Called pkg_pretend
>  *   glibc-2.33-r1.ebuild, line 721:  Called sanity_prechecks
>  *   glibc-2.33-r1.ebuild, line 670:  Called die
>  * The specific snippet of code:
>  *  [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must 
> be enabled in the kernel to compile a multilib glibc."
>  *
>  * If you need support, post the output of `emerge --info 
> '=sys-libs/glibc-2.33-r1::gentoo'`,
>  * the complete build log and the output of `emerge -pqv 
> '=sys-libs/glibc-2.33-r1::gentoo'`.
>  * The complete build log is located at 
> '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'.
>  * The ebuild environment file is located at 
> '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/die.env'.
>  * Working directory: '/var/tmp/portage/sys-libs/glibc-2.33-r1/empty'
>  * S: '/var/tmp/portage/sys-libs/glibc-2.33-r1/work/glibc-2.33'
>
 Failed to emerge sys-libs/glibc-2.33-r1, Log file:
  '/var/tmp/portage/sys-libs/glibc-2.33-r1/temp/build.log'
> What is clearly happening is that the C Compiler is crashing out with a
> segfault.  I actually have CONFIG_IA32_EMULATION in my kernel config.
>
> I've tried this with both GCC-10.3.0 and GCC-9.3.0 with the same results
> on both.
>
> What is going wrong? (Horrible thought - maybe my RAM is failing.)
>


Could it be that the /usr/src/linux link is pointing to the wrong kernel
directory?  It could be pointing to a old config that doesn't have that
option enabled.  I know I've done that before when rebuilding modules. 
It's amazing how it doesn't work when that link is pointing to the wrong
kernel. 

If it isn't that, maybe someone else will have a better idea. 

Dale

:-)  :-)