[Bug libctf/25120] Portability issues in binutils 2.33 due to libctf

2020-05-14 Thread nick.alcock at oracle dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25120

--- Comment #18 from Nick Alcock  ---
I am not dead (and am in fact working on nothing but libctf).

Sorry, I fell behind while doing piles of linker dedup work: it was a pain,
with at least two designs that fell apart at the last minute, but it's more or
less working now, and I'll be getting the terrifying pile of patches that
resulted (and this lot, too) into shape after I've knocked the last niggles out
of it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/25992] New: Wrong Tag_CPU_arch_profile for armv8-r

2020-05-14 Thread alfedotov at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25992

Bug ID: 25992
   Summary: Wrong Tag_CPU_arch_profile for armv8-r
   Product: binutils
   Version: 2.35 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: alfedotov at gmail dot com
  Target Milestone: ---

Created attachment 12536
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12536&action=edit
asm file

Assembling files (see attached) with different FPU and then checking:

./arm-none-eabi-as armv8-r_neon.asm -o armv8-r_neon.o
./arm-none-eabi-readelf.exe -A armv8-r_neon.o | grep Tag_CPU_arch_profile

./arm-none-eabi-as armv8-r_fpsp.asm -o armv8-r_fpsp.o
./arm-none-eabi-readelf.exe -A armv8-r_fpsp.o | grep Tag_CPU_arch_profile

returns result

Tag_CPU_arch_profile: Application



Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "8-R"
  Tag_CPU_arch: v8-R
  Tag_CPU_arch_profile: Application

At the same time result for armv7-r gives the correct profile:

Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-R"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Realtime

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/25992] Wrong Tag_CPU_arch_profile for armv8-r

2020-05-14 Thread alfedotov at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25992

Alexander Fedotov  changed:

   What|Removed |Added

  Attachment #12536|asm file|armv8-r_neon.asm
description||

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/25992] Wrong Tag_CPU_arch_profile for armv8-r

2020-05-14 Thread alfedotov at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25992

--- Comment #1 from Alexander Fedotov  ---
Created attachment 12537
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12537&action=edit
armv8-r_fpsp

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/25992] Wrong Tag_CPU_arch_profile for armv8-r

2020-05-14 Thread alfedotov at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25992

Alexander Fedotov  changed:

   What|Removed |Added

 Target||arm-none-eabi

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/25993] New: Bug in bfd causes crashes with DXVK

2020-05-14 Thread wgpierce17 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25993

Bug ID: 25993
   Summary: Bug in bfd causes crashes with DXVK
   Product: binutils
   Version: 2.34
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: wgpierce17 at gmail dot com
  Target Milestone: ---

Created attachment 12539
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12539&action=edit
Logs from running valgrind on ld during DXVK compilation

I bisected a bug in DXVK to be created and fixed by two commits to bfd.

DXVK transforms DX9-11 into Vulkan calls and is compiled as a .dll to be
used with WINE. This is DXVK's homepage: https://github.com/doitsujin/dxvk

DXVK uses mingw-w64-binutils to compile into a .dll

The mingw-w64-binutils I tested with originates from here:
https://aur.archlinux.org/packages/mingw-w64-binutils
That gets built using a PKGBUILD script from the ArchLinux AUR:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mingw-w64-binutils

The build process from that boils down to

_targets="i686-w64-mingw32 x86_64-w64-mingw32"
  for _target in $_targets; do
msg "Building ${_target} cross binutils"
mkdir -p "$srcdir"/binutils-${_target} && cd
"${srcdir}/binutils-${_target}"
"$srcdir"/binutils-gdb/configure --prefix=/usr \
--target=${_target} \
--infodir=/usr/share/info/${_target} \
--enable-lto --enable-plugins \
--enable-deterministic-archives \
--disable-multilib --disable-nls \
--disable-werror
 make


I bisected the bug with binutils in the DXVK issue here:
https://github.com/doitsujin/dxvk/issues/1625
The bug manifests as WINE encountering a page fault at address 0x0, or
executing illegal instructions, or a few other manifestations with
different symptoms when DXVK is compiled with mingw-w64-binutils 2.34.
mingw-w64-binutils 2.33 does not have this bug.
We think the issue is that the linker makes DXVK jump to a bogus
address and start executing garbage.

I bisected the bug to be introduced by binutils commit
ea933f17c3c6b9fa1daf8d03baa34f7bec855d6c: "Release bfd_alloc memory in
bfd_check_format_matches" between the branch points for 2.33 and 2.34

I bisected the bug to be fixed in at least one case by binutils commit
b03202e32c8235997b3485b0b4655926ad97a1cc: "bfd_get_size cache"
between 2.34 branch point and master.
Note that also in this bisection between 2.34 and master, there was a
point where the reproduction hung with this in the WINE log instead of
crashing outright:
49801.150:00c0:00c4:warn:seh:setup_exception_record exception outside of stack
limits in thread 00c4 eip 00314be2 esp c79140f7 stack 0x222000-0x32
49801.150:00c0:00c4:err:seh:setup_exception_record nested exception on signal
stack in thread 00c4 eip 7bce9d9d esp 7ffdb930 stack 0x222000-0x32

While these commits do both touch bfd, they don't touch the same file.
Maybe the bug is only perturbed by the newer commit (or maybe my bisect
is slightly off). Also, the newer commit isn't trying to address the
bug caused by the original commit, so maybe the bug could be
reintroduced anytime.

I was asked to run valgrind on ld to see if there are any memory errors.
I did this on both commit ea933f17c3c6b9fa1daf8d03baa34f7bec855d6c that
introduced the problem and the commit right before it to see if there's
any difference. I ran it while compiling dxvk by replacing the ld binary
with a shell script that does this:

exec valgrind -s --log-file=/path/to/logs/ld-%p.log
/usr/bin/i686-w64-mingw32-ld.bfd.bak "$@"

where /usr/bin/i686-w64-mingw32-ld.bfd.bak is the real ld that would be used.
Both seem to report I believe the same number of use-after-free errors,
so I think the bug got perturbed in different ways by these two commits
to effectively introduce and get rid of the error.

I've attached these logs for the build for the two commits.
In particular, I observed the repro happen in the 32 bit d3d9.dll build,
but both valgrinds outputs are the same. In the attached logs, they are
logs-f24bdec48621f419fdc9dcd58f46891f062b7bc0/ld-102345.log
logs-ea933f17c3c6b9fa1daf8d03baa34f7bec855d6c/ld-183630.log

-- 
You are receiving this mail because:
You are on the CC list for the bug.