| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
In the concurrent nonmoving collector we will need the ability to call
`traverseWeakPtrList` concurrently with minor generation collections.
This global state stands in the way of this. However, refactoring it
away is straightforward since this list only persists the length of a
single GC.
|
| |
|
|
|
|
|
| |
These include printLargeAndPinnedObjects, printWeakLists, and
printStaticObjects. These are generally useful things to have.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the work stealing queue a load-load-barrier is required to ensure
that a read of queue data cannot be reordered before a read of the
bottom pointer into the queue.
The added load-load-barrier ensures that the ordering of writes enforced
at the end of `pushWSDeque` is also respected in the order of reads in
`stealWSDeque_`. In other words, when reading `q->bottom` we want to make
sure that we see the updates to `q->elements`.
Fixes #13633
|
|
|
|
|
|
| |
Some code is broken, there are no CI targets (so not obvious how to
test), and no one seems to have built GHC for any of the above
platforms in years.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes two bug fixes in profiling version of stg_ap_0_fast:
- PAPs allocated by stg_ap_0_fast are now correctly tagged. This
invariant is checked in Sanity.c:checkPAP.
(This was originally implemented in 2693eb11f5, later reverted with
ab55b4ddb7 because it revealed the bug below, but it wasn't clear at
the time whether the bug was the one below or something in the commit)
- The local variable `untaggedfun` is now marked as a pointer so it
survives GC.
With this we finally fix all known bugs caught in #15508. `concprog001`
now works reliably with prof+threaded and prof runtimes (with and
without -debug).
|
|
|
|
| |
Fixes #16303
|
|
|
|
| |
This was warning on i386.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When `+RTS -xp` is passed, when don't need the X86_64_ELF_NONPIC_HACK,
becasue the relocation offset should only be out of range if
* the object file was not compiled with `-fPIC -fexternal-dynamic-refs`;
* ghc generates non-pic code while it should (e.g. #15723)
In either case, we should print an error message rather that silently
attempt to use a hacky workaround that may not work.
This could have made debugging #15723 and #15729 much easier.
Test Plan:
Run this in a case where ghci used to crash becasue of T15723. Now we
see helpful message like:
```
ghc-iserv-prof: R_X86_64_PC32 relocation out of range:
stmzm2zi4zi4zi1zmJQn4hNPyYjP5m9AcbI88Ve_ControlziConcurrentziSTMziTMVar_readTMVar_C61n_cc
= 9b95ffac
```
Reviewers: simonmar, bgamari, erikd
Reviewed By: simonmar, bgamari
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5233
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This re-applies {D5195} and {D5235}, they were reverted as part of diff
stack to unbreak i386. The proper fix is done in {D5289}.
Allocate bss section within proper range of other sections:
* when `+RTS -xp` is passed, allocate it contiguously as we did for
jump islands
* when we mmap the code to lower 2Gb, we should allocate bss section
there too
Test Plan:
1. `./validate`
2.
with
```
DYNAMIC_GHC_PROGRAMS = NO
DYNAMIC_BY_DEFAULT = NO
```
`TEST="T15729" make test` passed in both linux (both i386 and x86_64) and macos.
3.
Also test in a use case where we used to encouter error like:
```
ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) =
b90282ba
```
and now, everything works fine.
Reviewers: simonmar, bgamari, angerman, erikd
Reviewed By: simonmar
Subscribers: rwbarton, carter
GHC Trac Issues: #15729
Differential Revision: https://phabricator.haskell.org/D5290
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This re-applies {D5195} with fixes for i386:
* Fix unused label warnings, see {D5230} or {D5273}
* Fix a silly bug introduced by moving `#if`
{P190}
Add a RTS option -xp to load PIC object anywhere in address space. We do
this by relaxing the requirement of <0x80000000 result of
`mmapForLinker` and implying USE_CONTIGUOUS_MMAP.
We also need to change calls to `ocInit` and `ocGetNames` to avoid
dangling pointers when the address of `oc->image` is changed by
`ocAllocateSymbolExtra`.
Test Plan:
See {D5195}, also test under i386:
```
$ uname -a
Linux watashi-arch32 4.18.5-arch1-1.0-ARCH #1 SMP PREEMPT Tue Aug 28
20:45:30 CEST 2018 i686 GNU/Linux
$ cd testsuite/tests/th/ && make test
...
```
will run `./validate` on stacked diff.
Reviewers: simonmar, bgamari, alpmestan, trommler, hvr, erikd
Reviewed By: simonmar
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5289
|
|
|
|
| |
This reverts commit 76c8fd674435a652c75a96c85abbf26f1f221876.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHC has code to handle unsuffixed .so files that are linker scripts
pointing to the real shared library. The detection is done by parsing
the result of `dlerror()` after calling `dlopen()` and looking for
certain error strings. On musl libc, the error message is "Exec format
error", which happens to be `strerror(ENOEXEC)`:
```
$ cat tmp.c
#include <dlfcn.h>
#include <stdio.h>
int main(void) {
dlopen("libz.so", RTLD_NOW | RTLD_GLOBAL);
puts(dlerror());
return 0;
}
$ gcc -o tmp tmp.c
$ ./tmp
Error loading shared library libz.so: Exec format error
$
```
This change fixes the workaround to also work on musl libc.
Link: https://phabricator.haskell.org/D5474
|
| |
|
| |
|
|
|
|
|
|
| |
Complete b7b6617a90824303daf555c817f538cd9c792671 (see ticket #15086) to
actually enable profiling by closure type in the profiling rts. I.e.
+RTS -p -hT is now accepted.
|
|
|
|
|
|
| |
Previously we ACQUIRE_LOCK and RELEASE_LOCK but these compile to a noop in the
non-threaded RTS, as noted in #16150. Use OS_ACQUIRE_LOCK and OS_RELEASE_LOCK
instead.
|
|
|
|
|
|
|
|
|
|
|
| |
When we are shutting down the pthread ticker we signal the start_cond condition
variable to ensure that the ticker thread wakes up and exits in a reasonable
amount of time. Previously, when the ticker thread would shut down it was
responsible for freeing the start_cond condition variable. However, this would
lead to a race wherein the ticker would free start_cond, then the main thread
would try to signal it in an effort to wake the ticker (#16150).
Avoid this by moving the mutex destruction to the main thread.
|
|
|
|
| |
(See comments)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because garbage collector calls `retainerProfile()` and `heapCensus()`,
GC times normally include some of PROF times too. To fix this we have
these lines:
// heapCensus() is called by the GC, so RP and HC time are
// included in the GC stats. We therefore subtract them to
// obtain the actual GC cpu time.
stats.gc_cpu_ns -= prof_cpu;
stats.gc_elapsed_ns -= prof_elapsed;
These variables are later used for calculating GC time excluding the
final GC (which should be attributed to EXIT).
exit_gc_elapsed = stats.gc_elapsed_ns - start_exit_gc_elapsed;
The problem is if we subtract PROF times from `gc_elapsed_ns` and then
subtract `start_exit_gc_elapsed` from the result, we end up subtracting
PROF times twice, because `start_exit_gc_elapsed` also includes PROF
times.
We now subtract PROF times from GC after the calculations for EXIT and
MUT times. The existing assertion that checks
INIT + MUT + GC + EXIT = TOTAL
now holds. When we subtract PROF numbers from GC, and a new assertion
INIT + MUT + GC + PROF + EXIT = TOTAL
also holds.
Fixes #15897. New assertions added in this commit also revealed #16102,
which is also fixed by this commit.
|
|
|
|
|
|
|
| |
UNDERFLOW_FRAMEs don't have profiling headers so we have to use the
AP_STACK's function's CCS as the new frame's CCS.
Fixes one of the many bugs caught by concprog001 (#15508).
|
|
|
|
|
|
|
|
|
| |
- Remove REGISTER_CC and REGISTER_CCS macros, add functions registerCC
and registerCCS to Profiling.c.
- Reduce scope of symbols: CC_LIST, CCS_LIST, CC_ID, CCS_ID
- Document CC_LIST and CCS_LIST
|
|
|
|
|
| |
This helped me debug one of the bugs in #15508. I'm not sure if this is
a good idea, but it worked for me, so wanted to submit this as a MR.
|
| |
|
|
|
|
|
|
|
| |
Support for Mac OS X on PowerPC has been dropped by Apple years ago. We
follow suit and remove PowerPC support for Darwin.
Fixes #16106.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Build failure on OpenBSD-6.4 the the following:
```
rts/RtsSymbols.c:994:1: error:
error: redefinition of '_DYNAMIC' as different kind of symbol
|
994 | RTS_OPENBSD_ONLY_SYMBOLS
| ^
RTS_OPENBSD_ONLY_SYMBOLS
^
```
On OpenBSD `_DYNAMIC` was always defined in `<elf.h>` headers
but used not to be included.
The change explicitly includes `<elf.h>` as a source of symbol definition.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: build-tested on OpenBSD-6.4
Reviewers: bgamari, erikd, simonmar
Subscribers: rwbarton, carter
GHC Trac Issues: #15945
Differential Revision: https://phabricator.haskell.org/D5461
|
|
|
|
|
|
|
|
| |
As reported in #15382 the `ASSERT(ctr != NULL)` is currently getting routinely
hit during testsuite runs. While this is certainly a bug I would far prefer
getting a proper error message than a segmentation fault. Consequently I'm
turning the `ASSERT` into a proper `if` so we get a proper error in non-debug
builds.
|
| |
|
|
|
|
| |
See #15207.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I consider myself lucky that in my circle of friends, `http` urls (as
opposed to `https` urls) are frowned upon in that we generally
apologize in the rase cases that we share an `http` url.
This pull request changes `http` links into their `https` analogues in
the following places:
* In the GHCI startup message (and parts of the User's Guide, where
there are verbatim transcripts of GHCi sessions).
* In a couple of error messages, asking the user to report a bug.
(I also took the liberty to change a single space before the reportabug
url into two spaces, harmonizing this occurence with the others.)
I'm not trying to start a war. I just had a moment to spare and felt
like preparing this diff. Merge or don't merge as you wish!
Reviewers: bgamari, erikd, simonmar
Subscribers: goldfire, rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5450
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add default value
- Update the help line as multiple short lines instead of one long line,
for consistency with other lines.
Reviewers: simonmar, bgamari, erikd
Reviewed By: bgamari
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5445
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Debug code have not been updated for a long time,
now it's changed to it compiles with recent RTS.
Reviewers: bgamari, erikd, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5369
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reapply D5346 with fix incompatible shell quoting in tests. It seems
like `$'string'` is not recognized under all test environments, so let's
avoid it in tests.
Test Plan:
```
hp2ps: "T15904".hp, line 2: integer must follow identifier
```
use new ghc and hp2ps to profile a simple program.
Reviewers: simonmar, bgamari, erikd, tdammers
Reviewed By: bgamari
Subscribers: tdammers, carter, rwbarton
GHC Trac Issues: #15904
Differential Revision: https://phabricator.haskell.org/D5388
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: `./inplace/bin/ghc-stage2 +RTS --help"
Reviewers: bgamari, sgraf, erikd
Reviewed By: sgraf
Subscribers: adamse, rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5428
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: erikd, simonmar
Reviewed By: simonmar
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5325
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan:
Validated locally, but skipped perf tests as there's a
framework-related error
there.
Reviewers: simonmar, bgamari, erikd
Reviewed By: simonmar
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5421
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Retainer profiling contained a recursion that under
certain circumstances could lead to the stack overflow
in C code.
The idea of the improvement is to keep an explicit stack for the
object, more precise to reuse existing stack, but allow new type of
objects to be stored there.
There is no reliable reproducer that is not a big program
but in some cases foldr (+) 0 [1..10000000] can work.
Reviewers: bgamari, simonmar, erikd, osa1
Reviewed By: bgamari, osa1
Subscribers: osa1, rwbarton, carter
GHC Trac Issues: #14758
Differential Revision: https://phabricator.haskell.org/D5351
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This fixes a corner case in which we have seen the symbol multiple times in
different static libraries, but due to a depencency we end up loading the
symbol from a library other than the first one.
Previously the runtime linker would only track symbols from the first
library and did not store the full link map. In this case it was unable
to find the address for the symbols in the second library during delay
loading.
This change stores the address of all symbols seen so a full link map
is generated, such that when we make a different decision later than what
was expected we're able to still correctly load the library.
Test Plan: ./validate, new testcase T15894
Reviewers: angerman, bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, carter
GHC Trac Issues: #15894
Differential Revision: https://phabricator.haskell.org/D5353
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is the latest in the 'findPtr' saga. See
* 900c47f88784b91517c00be3e1087322e62f698e
* 561748cb507505bd5b7bd76bdc57796d896b62a2
for the previous attempts. The problem with re-using the 'debug'
cabal flag for the purpose of forcing inclusion of 'findPtr' occurs
when 'debug' is one of the RTS ways, but RTS is not being compiled
with '-DDEBUG':
* the 'debug' flag gets passed to cabal, signalling to build
'rts' with the debug flavour, but also forcing inclusion of
the 'findPtr'/'_findPtr' symbol
* since '-DDEBUG' isn't enabled, that symbol doesn't show up in
the libraries, so executable that depend on 'rts' (everything)
will end up always requiring 'findPtr'/'_findPtr' but 'rts' won'y
provide it!
The fix is simple: create a a new 'find-ptr' cabal-flag whose only
purpose is forcing '-Wl,-u,findPtr'/'-Wl,-u,_findPtr'. Then, enable that
flag when the RTS is being compiled with '-DDEBUG'
Test Plan: ./hadrian/build.sh -c # on mac
Reviewers: alpmestan, snowleopard, bgamari, erikd, simonmar, Phyx
Reviewed By: alpmestan, snowleopard, Phyx
Subscribers: Phyx, rwbarton, carter
GHC Trac Issues: #15956
Differential Revision: https://phabricator.haskell.org/D5404
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, Hadrian was building all the appropriate dynamic ways for
libHSrts
but they were not picked up and installed in the package database when
we register the rts library. Since we use Cabal for registering
packages and
the .cabal files of packages as sources of truth for configuring and
installing,
we ended up patching Cabal to add a new field,
'extra-dynamic-library-flavours',
to specify those extra flavours to install in .cabal files:
https://github.com/haskell/cabal/pull/5606
We now make use of this in rts.cabal.in to expose dynamic flavours
behind a
Cabal flag, which Hadrian will use whenever we are building a GHC
flavour that
requires dynamic libraries.
This is all part of a larger plan to build a dynamic stage 2 GHC by
default,
like with make, which in turn will fix a lot of test failures. See
Test Plan:
hadrian/build.sh _build/stage1/lib/package.conf.d/rts-1.0.conf
_build/stage1/lib/x86_64-.../ should contain many libHSrts-*.so
Reviewers: snowleopard, DavidEichmann, bgamari, erikd, simonmar
Reviewed By: snowleopard, DavidEichmann
Subscribers: rwbarton, carter
GHC Trac Issues: #15837
Differential Revision: https://phabricator.haskell.org/D5385
|
| |
|
|
|
|
| |
This reverts commit 390df8b51b917fb6409cbde8e73fe838d61d8832.
|
|
|
|
| |
Fixes #15105
|
|
|
|
| |
Eliminates a bit of repetition.
|