Re: Build failed in Jenkins: osv-build #1253

2017-07-17 Thread Avi Kivity



On 07/17/2017 03:34 PM, Nadav Har'El wrote:


On Mon, Jul 17, 2017 at 3:29 PM, Avi Kivity > wrote:




On 07/17/2017 10:10 AM, Nadav Har'El wrote:

Oops, this is bad, and unfortunately I committed too many patches
yesterday to understand which one brought this bug...



On Sun, Jul 16, 2017 at 7:57 PM, mailto:jenk...@scylladb.com>> wrote:

  TEST tst-elf-permissions.so OSv v0.24-399-ge6fadac
eth0: 192.168.122.15
Assertion failed: (phdr.p_flags & (PF_R | PF_W | PF_X)) ==
PF_R (core/elf.cc: fix_permissions: 475)


We've seen Jenkins doing two runs and both of them failed at
exactly the same place. Moreover, on my Fedora 25 installation, I
ran this test 1000 times, and it didn't fail once

Note how the failure is while *loading* the test object, not even
when running it, where we discover that the GNU_RELRO section is
not marked read-only. This can either be memory corruption (oops)
or a linker bug (this particular test does funky monkey-business
on the linker).

It turns out to be the latter: The test fails if the "gold"
linker is used to build it. If I add "-fuse-ld=gold" in COMMON in
modules/tests/Makefile, running this test fails with the exact
same assertion, and it's clear why:

$ readelf -a build/release/tests/tst-elf-permissions.so
Program Headers:
  Type   Offset VirtAddr   PhysAddr
 FileSiz MemSiz  Flags  Align
...
  GNU_RELRO  0x1da0 0x2da0
0x2da0
 0x0260 0x0260  RW 8

Note how GNU_RELRO is marked read-write, but it should have been
read-only.

I am guessing that recently, our Jenkins machine was modified to
change the default BFD linker to the GOLD one. Is this possible?


It is, and I did that to speed up Scylla links.


Ok, thanks.

If scylla is known to work well with gold, would it not make sense to 
just add "-fuse-ld=bfd" in its compilation line instead of assume that 
everyone compiling it remembers to switch the default?




It does make sense.

Clang doesn't have -fuse-ld, so we have to detect it at configure time.

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build failed in Jenkins: osv-build #1253

2017-07-17 Thread Nadav Har'El
On Mon, Jul 17, 2017 at 3:29 PM, Avi Kivity  wrote:

>
>
> On 07/17/2017 10:10 AM, Nadav Har'El wrote:
>
> Oops, this is bad, and unfortunately I committed too many patches
> yesterday to understand which one brought this bug...
>
>
>
> On Sun, Jul 16, 2017 at 7:57 PM,  wrote:
>
>>   TEST tst-elf-permissions.so OSv v0.24-399-ge6fadac
>> eth0: 192.168.122.15
>> Assertion failed: (phdr.p_flags & (PF_R | PF_W | PF_X)) == PF_R
>> (core/elf.cc: fix_permissions: 475)
>>
>>
> We've seen Jenkins doing two runs and both of them failed at exactly the
> same place. Moreover, on my Fedora 25 installation, I ran this test 1000
> times, and it didn't fail once
>
> Note how the failure is while *loading* the test object, not even when
> running it, where we discover that the GNU_RELRO section is not marked
> read-only. This can either be memory corruption (oops) or a linker bug
> (this particular test does funky monkey-business on the linker).
>
> It turns out to be the latter: The test fails if the "gold" linker is used
> to build it. If I add "-fuse-ld=gold" in COMMON in modules/tests/Makefile,
> running this test fails with the exact same assertion, and it's clear why:
>
> $ readelf -a build/release/tests/tst-elf-permissions.so
> Program Headers:
>   Type   Offset VirtAddr   PhysAddr
>  FileSizMemSiz  Flags  Align
> ...
>   GNU_RELRO  0x1da0 0x2da0 0x2da0
>  0x0260 0x0260  RW 8
>
> Note how GNU_RELRO is marked read-write, but it should have been read-only.
>
> I am guessing that recently, our Jenkins machine was modified to change
> the default BFD linker to the GOLD one. Is this possible?
>
>
> It is, and I did that to speed up Scylla links.
>

Ok, thanks.

If scylla is known to work well with gold, would it not make sense to just
add "-fuse-ld=bfd" in its compilation line instead of assume that everyone
compiling it remembers to switch the default?

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build failed in Jenkins: osv-build #1253

2017-07-17 Thread Avi Kivity



On 07/17/2017 10:10 AM, Nadav Har'El wrote:
Oops, this is bad, and unfortunately I committed too many patches 
yesterday to understand which one brought this bug...




On Sun, Jul 16, 2017 at 7:57 PM, > wrote:


  TEST tst-elf-permissions.so OSv v0.24-399-ge6fadac
eth0: 192.168.122.15
Assertion failed: (phdr.p_flags & (PF_R | PF_W | PF_X)) == PF_R
(core/elf.cc: fix_permissions: 475)


We've seen Jenkins doing two runs and both of them failed at exactly 
the same place. Moreover, on my Fedora 25 installation, I ran this 
test 1000 times, and it didn't fail once


Note how the failure is while *loading* the test object, not even when 
running it, where we discover that the GNU_RELRO section is not marked 
read-only. This can either be memory corruption (oops) or a linker bug 
(this particular test does funky monkey-business on the linker).


It turns out to be the latter: The test fails if the "gold" linker is 
used to build it. If I add "-fuse-ld=gold" in COMMON in 
modules/tests/Makefile, running this test fails with the exact same 
assertion, and it's clear why:


$ readelf -a build/release/tests/tst-elf-permissions.so
Program Headers:
  Type   Offset VirtAddr PhysAddr
 FileSizMemSiz Flags  Align
...
  GNU_RELRO  0x1da0 0x2da0 0x2da0
 0x0260 0x0260 RW 8

Note how GNU_RELRO is marked read-write, but it should have been 
read-only.


I am guessing that recently, our Jenkins machine was modified to 
change the default BFD linker to the GOLD one. Is this possible?


It is, and I did that to speed up Scylla links.



An easy fix would be to add -fuse-ld=bfd. I'm trying to think if 
that's the right fix, though.


--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build failed in Jenkins: osv-build #1253

2017-07-17 Thread Nadav Har'El
Oops, this is bad, and unfortunately I committed too many patches yesterday
to understand which one brought this bug...



On Sun, Jul 16, 2017 at 7:57 PM,  wrote:

>   TEST tst-elf-permissions.so OSv v0.24-399-ge6fadac
> eth0: 192.168.122.15
> Assertion failed: (phdr.p_flags & (PF_R | PF_W | PF_X)) == PF_R
> (core/elf.cc: fix_permissions: 475)
>
>
We've seen Jenkins doing two runs and both of them failed at exactly the
same place. Moreover, on my Fedora 25 installation, I ran this test 1000
times, and it didn't fail once

Note how the failure is while *loading* the test object, not even when
running it, where we discover that the GNU_RELRO section is not marked
read-only. This can either be memory corruption (oops) or a linker bug
(this particular test does funky monkey-business on the linker).

It turns out to be the latter: The test fails if the "gold" linker is used
to build it. If I add "-fuse-ld=gold" in COMMON in modules/tests/Makefile,
running this test fails with the exact same assertion, and it's clear why:

$ readelf -a build/release/tests/tst-elf-permissions.so
Program Headers:
  Type   Offset VirtAddr   PhysAddr
 FileSizMemSiz  Flags  Align
...
  GNU_RELRO  0x1da0 0x2da0 0x2da0
 0x0260 0x0260  RW 8

Note how GNU_RELRO is marked read-write, but it should have been read-only.

I am guessing that recently, our Jenkins machine was modified to change the
default BFD linker to the GOLD one. Is this possible?

An easy fix would be to add -fuse-ld=bfd. I'm trying to think if that's the
right fix, though.

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.