[Git][ghc/ghc][wip/backports-9.8] 15 commits: Bump submodule deepseq to 1.5.1.0
Ben Gamari (@bgamari)
gitlab at gitlab.haskell.org
Fri Sep 27 21:03:10 UTC 2024
Ben Gamari pushed to branch wip/backports-9.8 at Glasgow Haskell Compiler / GHC
Commits:
a2a44e47 by Andrew Lelechenko at 2024-09-27T13:31:13-04:00
Bump submodule deepseq to 1.5.1.0
(cherry picked from commit 8e462f4d4bdf2a6c34c249e7be8084565600d300)
- - - - -
d747384b by Cheng Shao at 2024-09-27T13:31:13-04:00
rts: ensure gc_thread/gen_workspace is allocated with proper alignment
gc_thread/gen_workspace are required to be aligned by 64 bytes.
However, this property has not been properly enforced before, and
numerous alignment violations at runtime has been caught by
UndefinedBehaviorSanitizer that look like:
```
rts/sm/GC.c:1167:8: runtime error: member access within misaligned address 0x0000027a3390 for type 'gc_thread' (aka 'struct gc_thread_'), which requires 64 byte alignment
0x0000027a3390: note: pointer points here
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1167:8
rts/sm/GC.c:1184:13: runtime error: member access within misaligned address 0x0000027a3450 for type 'gen_workspace' (aka 'struct gen_workspace_'), which requires 64 byte alignment
0x0000027a3450: note: pointer points here
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/GC.c:1184:13
```
This patch fixes the gc_thread/gen_workspace misalignment issue by
explicitly allocating them with alignment constraint.
- - - - -
28dd05e8 by Cheng Shao at 2024-09-27T13:31:13-04:00
rts: fix an unaligned load in nonmoving gc
This patch fixes an unaligned load in nonmoving gc by ensuring the
closure address is properly untagged first before attempting to
prefetch its header. The unaligned load is reported by
UndefinedBehaviorSanitizer:
```
rts/sm/NonMovingMark.c:921:9: runtime error: member access within misaligned address 0x0042005f3a71 for type 'StgClosure' (aka 'struct StgClosure_'), which requires 8 byte alignment
0x0042005f3a71: note: pointer points here
00 00 00 98 43 13 8e 12 7f 00 00 50 3c 5f 00 42 00 00 00 58 17 b7 92 12 7f 00 00 89 cb 5e 00 42
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/sm/NonMovingMark.c:921:9
```
This issue had previously gone unnoticed since it didn't really harm
runtime correctness, the invalid header address directly loaded from a
tagged pointer is only used as prefetch address and will not cause
segfaults. However, it still should be corrected because the prefetch
would be rendered useless by this issue, and untagging only involves a
single bitwise operation without memory access so it's cheap enough to
add.
- - - - -
43950801 by Cheng Shao at 2024-09-27T13:31:13-04:00
rts: use __builtin_offsetof to implement STG_FIELD_OFFSET
This patch fixes the STG_FIELD_OFFSET macro definition by using
__builtin_offsetof, which is what gcc/clang uses to implement offsetof
in standard C. The previous definition that uses NULL pointer involves
subtle undefined behavior in C and thus reported by
UndefinedBehaviorSanitizer as well:
```
rts/Capability.h:243:58: runtime error: member access within null pointer of type 'Capability' (aka 'struct Capability_')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior rts/Capability.h:243:58
```
- - - - -
230a1fc0 by Cheng Shao at 2024-09-27T13:31:13-04:00
rts: fix checkClosure error message
This patch fixes an error message in checkClosure() when the closure
has already been evacuated. The previous logic was meant to print the
evacuated closure's type in the error message, but it was completely
wrong, given info was not really an info table, but a tagged pointer
that points to the closure's new address.
- - - - -
fefd77f6 by Andrew Lelechenko at 2024-09-27T14:57:23-04:00
Bump submodule array to 0.5.8.0
(cherry picked from commit 80769bc9f56541601796366485283a697c52a18b)
- - - - -
97cad96c by Matthew Pickering at 2024-09-27T15:46:45-04:00
ci: Fix variable inheritence for ghcup-metadata testing job
Downstream in ghcup-ci we use the CONFIGURE_ARGS variable to determine
how to setup all the different jobs.
On the downstream trigger this was being inherited from the default
setting in .gitlab.yml file.
Therefore this led to job failures as the necessary CONFIGURE_ARGS were
not being passed to the configure script when installing the bindist.
See docs:
* https://docs.gitlab.com/ee/ci/yaml/#inherit
* https://docs.gitlab.com/ee/ci/yaml/#triggerforward
1. inherit:variables:fals
- This stops the global variables being inherited into the job and
hence forwarded onto the downstream job.
2. trigger:forward:*
- yaml_variables: true (default) pass yaml variables to downstream,
this is important to pass the upstream pipeline id to downstream.
- pipeline_variables: false (default) but don't pass pipeline
variables (normal environment variables).
Fixes #25294
(cherry picked from commit 7cb7172eff9e18ed1c98f65a98018f76c4fcc9f6)
- - - - -
8f3d1a6a by Sylvain Henry at 2024-09-27T15:48:36-04:00
Fix interaction between fork and kqueue (#24672)
A kqueue file descriptor isn't inherited by a child created with fork.
As such we mustn't try to close this file descriptor as we would close a
random one, e.g. the one used by timerfd.
Fix #24672
(cherry picked from commit e7a26d7a6faf1ea534e036c5085a0a027dbb6f5f)
- - - - -
9f2e0f50 by Sylvain Henry at 2024-09-27T17:02:50-04:00
JS: support rubbish static literals (#25177)
Support for rubbish dynamic literals was added in #24664. This patch
does the same for static literals.
Fix #25177
(cherry picked from commit 5092dbff750ee5b6fd082b7eed8574922a2b0bf4)
- - - - -
2101a57a by Sylvain Henry at 2024-09-27T17:02:50-04:00
AARCH64 linker: skip NONE relocations
This patch is part of the patches upstreamed from haskell.nix.
See https://github.com/input-output-hk/haskell.nix/pull/1960 for the
original report/patch.
(cherry picked from commit c749bdfd3e21d712dc2b966482eb010165bdeebe)
- - - - -
08963d26 by Sylvain Henry at 2024-09-27T17:02:50-04:00
Cmm: don't perform unsound optimizations on 32-bit compiler hosts
- beef61351b240967b49169d27a9a19565cf3c4af enabled the use of
MO_Add/MO_Sub for 64-bit operations in the C and LLVM backends
- 6755d833af8c21bbad6585144b10e20ac4a0a1ab did the same for the x86 NCG
backend
However we store some literal values as `Int` in the compiler. As a
result, some Cmm optimizations transformed target 64-bit literals into
compiler `Int`. If the compiler is 32-bit, this leads to computing with
wrong literals (see #24893 and #24700).
This patch disables these Cmm optimizations for 32-bit compilers. This
is unsatisfying (optimizations shouldn't be compiler-word-size
dependent) but it fixes the bug and it makes the patch easy to backport.
A proper fix would be much more invasive but it shall be implemented in
the future.
Co-authored-by: amesgen <amesgen at amesgen.de>
(cherry picked from commit 7446a09a2d5b04b95cd43c03659b5647853124ce)
- - - - -
257e836d by sheaf at 2024-09-27T17:02:50-04:00
GHCi debugger: drop record name spaces for Ids
When binding new local variables at a breakpoint, we should create
Ids with variable namespace, and not record field namespace. Otherwise
the rest of the compiler falls over because the IdDetails are wrong.
Fixes #25109
(cherry picked from commit c29b2b5a77611b2bd6c3089765079bc43aec3e22)
- - - - -
b0947c95 by Sylvain Henry at 2024-09-27T17:02:50-04:00
Only lookup ghcversion.h file in the RTS include-dirs by default.
The code was introduced in 3549c952b535803270872adaf87262f2df0295a4.
It used `getPackageIncludePath` which name doesn't convey that it looks
into all include paths of the preload units too. So this behavior is
probably unintentional and it should be ok to change it.
Fix #25106
(cherry picked from commit f954f42823f6ca3588425a0d543d93ace86d89e4)
- - - - -
12460fb2 by Simon Peyton Jones at 2024-09-27T17:02:50-04:00
Address #25055, by disabling case-of-runRW# in Gentle phase
See Note [Case-of-case and full laziness]
in GHC.Driver.Config.Core.Opt.Simplify
(cherry picked from commit de5d9852dbdd367611bf9e45e69c723d26351992)
- - - - -
b2b87083 by doyougnu at 2024-09-27T17:02:50-04:00
Rts linker: add case for pc-rel 64 relocation
part of the upstream haskell.nix patches
(cherry picked from commit bfe4b3d3bbb98b39169fad063c6c32f06d167756)
- - - - -
30 changed files:
- .gitlab-ci.yml
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Driver/Config/Core/Opt/Simplify.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/StgToJS/Literal.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/Types/Id.hs
- compiler/GHC/Unit/Types.hs
- libraries/array
- libraries/base/GHC/Event/KQueue.hsc
- libraries/deepseq
- rts/include/Stg.h
- rts/linker/PEi386.c
- rts/linker/elf_reloc_aarch64.c
- rts/sm/GC.c
- rts/sm/NonMovingMark.c
- rts/sm/Sanity.c
- + testsuite/tests/codeGen/should_compile/T25177.hs
- + testsuite/tests/codeGen/should_compile/T25177.stderr
- testsuite/tests/codeGen/should_compile/all.T
- + testsuite/tests/codeGen/should_run/T24700.hs
- + testsuite/tests/codeGen/should_run/T24700.stdin
- + testsuite/tests/codeGen/should_run/T24700.stdout
- + testsuite/tests/codeGen/should_run/T24893.hs
- + testsuite/tests/codeGen/should_run/T24893.stdout
- testsuite/tests/codeGen/should_run/all.T
- testsuite/tests/driver/T20604/T20604.stdout
- + testsuite/tests/ghci.debugger/scripts/T25109.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2050caf9ebc81c4fcba05bd394315e739ac18d36...b2b8708398948276d96b1bbd07589431669aa51c
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2050caf9ebc81c4fcba05bd394315e739ac18d36...b2b8708398948276d96b1bbd07589431669aa51c
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240927/9f54a46b/attachment-0001.html>
More information about the ghc-commits
mailing list