| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc complains about this while building with Hadrian,
```
rts/RetainerProfile.c: In function ‘computeRetainerSet’:
rts/RetainerProfile.c:1758:18: error:
error: variable ‘rtl’ set but not used
[-Werror=unused-but-set-variable]
RetainerSet *rtl;
^~~
|
1758 | RetainerSet *rtl;
| ^
```
Reviewers: austin, erikd, simonmar, Phyx
Reviewed By: Phyx
Subscribers: Phyx, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3801
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These ignore commandline arguments for ignore and commandline as well as
GHCRTS arguments for ignoreAll. Passing RTS flags given on the command
line along to the program by simply skipping processing of these flags
by the RTS.
This fixes #12870.
Test Plan: ./validate
Reviewers: austin, hvr, bgamari, erikd, simonmar
Reviewed By: simonmar
Subscribers: Phyx, rwbarton, thomie
GHC Trac Issues: #12870
Differential Revision: https://phabricator.haskell.org/D3740
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Get utf8 encoded arguments before we call hs_init and use them
instead of ignoring hs_init arguments. This reduces differing
behaviour of the RTS between windows and linux and simplifies
the code involved.
A few testcases were changed to expect the same result on windows
as on linux after the changes.
This fixes #13940.
Test Plan: ./validate
Reviewers: austin, hvr, bgamari, erikd, simonmar, Phyx
Subscribers: Phyx, rwbarton, thomie
GHC Trac Issues: #13940
Differential Revision: https://phabricator.haskell.org/D3739
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the fix to #13615 we introduced some logic to atomically blackhole
AP_STACKs closures upon entry. However, this logic was placed *after* a
stack pointer adjustment. This meant that if someone else beat us to
blackholing the AP_STACK we would suspend the thread with uninitialized
content on the stack. This would then later blow up when threadPaused
attempted to walk the stack, hence #13970.
Silly bug but still cost lots of head-scratching to find.
Thanks to albertov for the great repro.
Fixes #13970. Bug originally introduced by the fix to #13615.
Reviewers: austin, erikd, simonmar
Reviewed By: erikd, simonmar
Subscribers: rwbarton, thomie
GHC Trac Issues: #13970, #13615
Differential Revision: https://phabricator.haskell.org/D3760
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is another step in fixing #13825 (based on D38 by Simon Marlow).
This commit adds a few macros for accessing and modifying `Sp`
(interpreter stack) and will be useful to allow sub-word
indexing/pushing. (but that will be a separate change, this commit
should introduce no changes in behavior)
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
Test Plan: ./validate
Reviewers: bgamari, simonmar, austin, erikd
Reviewed By: bgamari, erikd
Subscribers: rwbarton, thomie
GHC Trac Issues: #13825
Differential Revision: https://phabricator.haskell.org/D3744
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When we use nursery chunks with +RTS -n<size>, when the current nursery
runs out we have to check whether there's another chunk available with
getNewNursery(). There was one place we weren't doing this: the ad-hoc
heap check in scheduleProcessInbox().
The impact of the bug was that we would GC too early when using nursery
chunks, especially in programs that used messages (throwTo between
capabilities could do this, also hs_try_putmvar()).
Test Plan: validate, also local testing in our application
Reviewers: bgamari, niteria, austin, erikd
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3749
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: angerman, austin, bgamari, erikd, simonmar
Reviewed By: angerman
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3727
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An additional stat is tracked per gc: par_balanced_copied This is the
the number of bytes copied by each gc thread under the balanced lmit,
which is simply (copied_bytes / num_gc_threads). The stat is added to
all the appropriate GC structures, so is visible in the eventlog and in
GHC.Stats.
A note is added explaining how work balance is computed.
Remove some end of line whitespace
Test Plan:
./validate
experiment with the program attached to the ticket
examine code changes carefully
Reviewers: simonmar, austin, hvr, bgamari, erikd
Reviewed By: simonmar
Subscribers: Phyx, rwbarton, thomie
GHC Trac Issues: #13830
Differential Revision: https://phabricator.haskell.org/D3658
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The normal object file on Windows has a limit of `2^16`
sections that can be in an object-file.
The `big-obj` format raises this to `2^32` sections.
The implementation is made difficult because we now need to support
two header formats and two section formats that differ only by a single
element size within each. The element that's different is in the middle
of the structs and since the structs are used to map regions of memory
directly, it means we need to know which struct it is when we do the
mapping or pointer arithmetics.
This is the final Object-Code format which Windows compilers can generate
which we do not support yet in GHCI. All other major compilers on the platforms
can produce it and all linkers consume it (bfd and lld).
See http://tinyurl.com/bigobj
This patch abstracts away retrieving the fields to functions which all take
an struct which describes which object format is currently being parsed.
These functions are always in-lined as they're small but would looks messy
being copy-pasted everywhere.
Test Plan:
./validate and new test `big-obj`
```
Tamar@Rage MINGW64 /r
$ gcc -c -Wa,-mbig-obj foo.c -o foo.o
Tamar@Rage MINGW64 /r
$ objdump -h foo.o
foo.o: file format pe-bigobj-x86-64
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000010 0000000000000000 0000000000000000 00000128 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000000 0000000000000000 0000000000000000 00000000 2**4
ALLOC, LOAD, DATA
2 .bss 00000000 0000000000000000 0000000000000000 00000000 2**4
ALLOC
3 .xdata 00000008 0000000000000000 0000000000000000 00000138 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .pdata 0000000c 0000000000000000 0000000000000000 00000140 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
5 .rdata$zzz 00000030 0000000000000000 0000000000000000 0000014c 2**4
CONTENTS, ALLOC, LOAD, READONLY, DATA
Tamar@Rage MINGW64 /r
$ echo main | ~/ghc/inplace/bin/ghc-stage2.exe --interactive bar.hs foo.o
GHCi, version 8.3.20170430: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( bar.hs, interpreted )
Ok, modules loaded: Main.
*Main> 17
*Main> Leaving GHCi.
```
Reviewers: austin, bgamari, erikd, simonmar
Subscribers: awson, rwbarton, thomie, #ghc_windows_task_force
GHC Trac Issues: #13815
Differential Revision: https://phabricator.haskell.org/D3523
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang defines '__clear_cache' slightly differently from gcc:
rts/sm/Storage.c:1349:13: error:
error: conflicting types for '__clear_cache'
|
1349 | extern void __clear_cache(char * begin, char * end);
| ^
extern void __clear_cache(char * begin, char * end);
^
note: '__clear_cache' is a builtin with type 'void (void *, void *)'
Reported by Moritz Angermann.
While at it used '__builtin___clear_cache' if advertised by clang.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
|
|
| |
This reverts commit 9492703a5862ee8623455209e50344cf8c4de077.
Incomplete patch (missing begin, end assignments).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang defines '__clear_cache' slightly differently from gcc:
rts/sm/Storage.c:1349:13: error:
error: conflicting types for '__clear_cache'
|
1349 | extern void __clear_cache(char * begin, char * end);
| ^
extern void __clear_cache(char * begin, char * end);
^
note: '__clear_cache' is a builtin with type 'void (void *, void *)'
Reported by Moritz Angermann.
While at it used '__builtin___clear_cache' if advertised by clang.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes #13615. See the rather lengthy Note [AP_STACKs must be
eagerly blackholed] for details.
Reviewers: simonmar, austin, erikd, dfeuer
Subscribers: duog, dfeuer, hsyl20, rwbarton, thomie
GHC Trac Issues: #13615
Differential Revision: https://phabricator.haskell.org/D3695
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It should respond with True to both BF_PINNED and BF_LARGE byte arrays.
However, previously it would only check the BF_PINNED flag.
Test Plan: Validate
Reviewers: simonmar, austin, erikd
Subscribers: winterland1989, rwbarton, thomie
GHC Trac Issues: #13894
Differential Revision: https://phabricator.haskell.org/D3685
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Strangely gcc 5.4 compiling on amd64 (nixos) complained about these.
Both warnings look correct, so I'm not sure why we haven't been seeing
these up until now.
Test Plan: Validate
Reviewers: simonmar, austin, erikd
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3693
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pointers to FUNs are not guaranteed to be tagged in general, because
the compiler doesn't always know the arity of a FUN when it needs to
reference it, e.g. with -O0 when the function is in another module.
However, there's one case where we can put the correct tag on a FUN:
when it is referenced by a PAP, because when building the PAP we know
the arity and we can tag the pointer correctly. The AutoApply code
does this, and the sanity checker checks it, but the interpreter did
not respect this invariant. This patch fixes it.
Test Plan:
```
(cd ghc && make 2 GhcDebugged=YES)
./inplace/bin/ghc-stage2 --interpreter +RTS -DS
```
Reviewers: niteria, bgamari, austin, erikd
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13767
Differential Revision: https://phabricator.haskell.org/D3680
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These were found while using Hadrian, which apparently uses slightly
stricter warning flags than the make-based build system.
Test Plan: Validate
Reviewers: austin, erikd, simonmar
Reviewed By: erikd
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3679
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we would look at the indirectee field of a WHITEHOLE object.
However, WHITEHOLE isn't a sort of indirection and therefore has no
indirectee field.
I encountered this while investigating #13615, although it doesn't fix
that bug.
Test Plan: Validate
Reviewers: simonmar, austin, erikd
Subscribers: rwbarton, thomie
GHC Trac Issues: #13615
Differential Revision: https://phabricator.haskell.org/D3674
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: austin, hvr, erikd, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, thomie
GHC Trac Issues: #8281, #13730.
Differential Revision: https://phabricator.haskell.org/D3619
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems that 12ad4d417b89462ba8e19a3c7772a931b3a93f0e enabled
collection by default as its needs stats.allocated_bytes to determine
whether the program has exceeded its grace limit.
However, enabling stats also enables some potentially expensive times
checks. In general GC statistics should be cheap to compute (relative
to the GC itself), so now we always compute them. This allows us to once
again disable giveStats by default.
Fixes #13864.
Reviewers: simonmar, austin, erikd
Reviewed By: simonmar
Subscribers: rwbarton, thomie
GHC Trac Issues: #13864
Differential Revision: https://phabricator.haskell.org/D3669
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Noticed when was building UNREG ghc with -optc{-Wall,-Werror}:
rts/sm/Storage.c:1359:3: error:
error: implicit declaration of function '__clear_cache'
[-Werror=implicit-function-declaration]
__clear_cache((void*)begin, (void*)end);
^~~~~~~~~~~~~
|
1359 | __clear_cache((void*)begin, (void*)end);
| ^
Left direct '__clear_cache' usage gcc toolchain before 4.4.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
| |
This reverts commit d1d3e98443cf263ef09253e2478e3e638e174e0d.
|
| |
|
|
|
|
|
|
|
|
|
| |
This reverts commit 6dd1257fdd4d18e84d32e89bf0ec664b3c8f7b93.
Change fails vaildation:
rts/sm/Storage.c:1351:20: error:
error: ‘gcc_clear_cache’ defined but not used [-Werror=unused-function]
STATIC_INLINE void gcc_clear_cache(void * begin, void * end)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Noticed when was building UNREG ghc with -optc{-Wall,-Werror}:
rts/sm/Storage.c:1359:3: error:
error: implicit declaration of function '__clear_cache'
[-Werror=implicit-function-declaration]
__clear_cache((void*)begin, (void*)end);
^~~~~~~~~~~~~
|
1359 | __clear_cache((void*)begin, (void*)end);
| ^
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: austin, bgamari, erikd, simonmar
Reviewed By: bgamari, simonmar
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3648
|
| |
|
|
|
|
|
| |
The Haskell wrapper already checks this but we should also check it in the RTS
to catch non-Haskell callers. See #13832.
|
| |
|
|
|
|
| |
This broke on 32-bit platforms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds Global Offset Table logic, as well as PLT like logic for armv7
and aarch64; which replaces the preexisting symbolExtras logic, by
placing the PLT tables next to the separtely loaded sections. This is
needed to ensure that the symbol stubs are in range.
Reviewers: bgamari, austin, erikd, simonmar
Reviewed By: bgamari
Subscribers: Ericson2314, ryantrinkle, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3448
|
|
|
|
| |
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The problem occurred when
* Threads A & B evaluate the same thunk
* Thread A context-switches, so the thunk gets blackholed
* Thread C enters the blackhole, creates a BLOCKING_QUEUE attached to
the blackhole and thread A's `tso->bq` queue
* Thread B updates the blackhole with a value, overwriting the BLOCKING_QUEUE
* We GC, replacing A's update frame with stg_enter_checkbh
* Throw an exception in A, which ignores the stg_enter_checkbh frame
Now we have C blocked on A's tso->bq queue, but we forgot to check the
queue because the stg_enter_checkbh frame has been thrown away by the
exception.
The solution and alternative designs are discussed in Note [upd-black-hole].
This also exposed a bug in the interpreter, whereby we were sometimes
context-switching without calling `threadPaused()`. I've fixed this
and added some Notes.
Test Plan:
* `cd testsuite/tests/concurrent && make slow`
* validate
Reviewers: niteria, bgamari, austin, erikd
Reviewed By: erikd
Subscribers: rwbarton, thomie
GHC Trac Issues: #13751
Differential Revision: https://phabricator.haskell.org/D3630
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The import library support added for 7.10.3 was only a partial one.
This support was predicated on using file extensions to determine
whether or not a library was an import library. It also couldn't handle
libraries with multiple dll pointers.
This is a rewrite of that patch and fully integrating it into the normal
archive parsing and loading routines. This solves a host of issues,
among others allowing us to finally use `-lgcc_s`.
This also fixes a problem with our previous implementation, where we
just loaded the DLL and moved on. Doing this had the potential of using
the wrong symbol at resolve time. Say a DLL already loaded (A.dll) has
symbol a exported (dependency of another dll perhaps).
We find an import library `B.lib` explicitly defining an export of `a`.
we load `B.dll` but this gets put after `A.dll`, at resolve time we
would use the value from `A` instead of `B` which is what we wanted.
Test Plan: ./valide and make test TEST=13606
Reviewers: austin, bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, RyanGlScott, thomie, #ghc_windows_task_force
GHC Trac Issues: #13606, #12499, #12498
Differential Revision: https://phabricator.haskell.org/D3513
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
got an error when using asan:
```
==1866689==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x10640568 in malloc ??:?
#1 0x154d867e in numa_bitmask_alloc .../numactl-2.0.8/libnuma_nosymve r.c:204
#2 0x154d867e in numa_allocate_nodemask .../numactl-2.0.8/libnuma_nosymve r.c:724
#3 0x154d867e in numa_get_mems_allowed .../numactl-2.0.8/libnuma_nosymve r.c:1141
#4 0x10b54a45 in osNumaMask ...ghc-8.0.2/rts/posix/OSMem.c:59 8
```
Test Plan: compile, validate
Reviewers: simonmar, niteria, austin, bgamari, erikd
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3537
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHC build fails for powerpc-unknown-linux-gnu
and hppa-unknown-linux-gnu targets as:
rts_dist_HC rts/dist/build/RtsStartup.o
rts/linker/ElfTypes.h:23:4: error:
error: #error "Unsupported arch!"
Before the change code tried to whitelist architectures
and classify them into ELF32/ELF64. It does not work
for UNREG arches like 'hppa', 'sparc64', 'm68k', 'mips'.
It is nuanced for things like mips64 and x86_64:
'mips64-unknown-linux-gnu-gcc -mabi=64' is ELFCLASS64
'mips64-unknown-linux-gnu-gcc' is ELFCLASS32
'x86_64-pc-linux-gnu-gcc' is ELFCLASS64
'x86_64-pc-linux-gnu-gcc -mx32' is ELFCLASS32
Here it's not enough to know HOST_ARCH. We really need to
know ABI.
The change uses '__LP64__' as a proxy for ELFCLASS64.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Reviewers: angerman, simonmar, austin, bgamari, erikd
Reviewed By: angerman, bgamari, erikd
Subscribers: rwbarton, thomie
GHC Trac Issues: #13696
Differential Revision: https://phabricator.haskell.org/D3583
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes gcc-7.1.0 warnings of form:
rts/sm/Scav.c:559:9: error:
error: this statement may fall through [-Werror=implicit-fallthrough=]
scavenge_fun_srt(info);
^~~~~~~~~~~~~~~~~~~~~~
Many of places are indeed unobvious and some are
already annotated by comments.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Found by gcc-7.1 which reported build error as:
rts/ProfilerReportJson.c:23:16: error:
error: comparison between pointer and zero
character constant [-Werror=pointer-compare]
for (; str != '\0' && len > 0; str++) {
^~
|
23 | for (; str != '\0' && len > 0; str++) {
| ^
Unfixed code in context:
```c
static void escapeString(char const* str, char *out, int len)
{
len--; // reserve character in output for terminating NUL
for (; str != '\0' && len > 0; str++) {
char c = *str;
```
The intent here is to process 'len' (if positive) or '\0'-terminator
in 'str' but dereference was missing.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
StgCRunAsm.S provides StgCRun on powerpc64le platforms when
registerised. However, in the unregisterised setting we use the
mini-interpreter and consequently shouldn't build StgCRunAsm.S lest we
get duplicate symbols.
Test Plan: Build unregisterised compiler on AIX.
Reviewers: hvr, trommler, austin, simonmar
Reviewed By: trommler, simonmar
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3560
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The introduction of the aarch64 linker for
iOS forgot that the ios simulator was still using
the x86_64/mach-o linker, which requires the use of
symbol extras. Until this is overhauled (see #13678),
we should revert to the symbol extras logic for
x86_64-apple-ios
Reviewers: austin, bgamari, erikd, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3556
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compiler/ghc.mk
@echo "#define $(HostArch_CPP)_HOST_ARCH 1" >> $@
@echo "#define $(TargetArch_CPP)_HOST_ARCH 1" >> $@
this leads to warnigns like:
> warning: 'x86_64_HOST_ARCH' is not defined, evaluates to 0 [-Wundef]
Reviewers: austin, bgamari, erikd, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3555
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The single-threaded RTS shouldn't actually need to use CAS to
implement `casMutVar#`; there are no other threads to coordinate
with.
Reviewers: austin, bgamari, erikd, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3544
|
| |
|