summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent
Commit message (Collapse)AuthorAgeFilesLines
* Fix raiseAsync() UNDERFLOW_FRAME handling in profiling runtimeÖmer Sinan Ağacan2019-01-121-1/+2
| | | | | | | 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).
* testsuite: Ensure that unregisterised function is calledBen Gamari2018-12-112-2/+2
| | | | | Strangely the previous formulation works locally and under CircleCI but fails on another machine. Odd.
* testsuite: Mark tickets identified in #15467 as brokenBen Gamari2018-12-112-1/+2
|
* Simplify testsuite driver, part 2Krzysztof Gogolewski2018-08-121-1/+1
| | | | | | | | | | | | | | | | | | Summary: - Avoid import *; this helps tools such as pyflakes. The last occurrence in runtests.py is not easy to remove as it's used by .T files. - Use False/True instead of 0/1. Test Plan: validate Reviewers: bgamari, thomie, simonmar Reviewed By: thomie Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5062
* testsuite: Add Windows-specific output for T5611Ben Gamari2018-06-141-0/+1
| | | | | | | | | | | | | It's not entirely clear why this is necessary, but this currently fails on Windows and the difference seems rather minor. Test Plan: Validate on Windows Reviewers: Phyx Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4842
* Do not skip conc004 in GHCi wayÖmer Sinan Ağacan2018-06-141-4/+1
| | | | | | | | | | | | | | | | | According to the comments it used to allocate too much, but currently I get 205,987,176 bytes allocated in the heap 50,352,200 bytes copied during GC 14,244,968 bytes maximum residency (6 sample(s)) 172,952 bytes maximum slop 36 MB total memory in use (0 MB lost due to fragmentation) Reviewers: bgamari, tdammers, simonmar Subscribers: tdammers, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4831
* Do not omit T4030 in GHCi modeÖmer Sinan Ağacan2018-06-101-2/+1
| | | | | | | | | | | | (it currently works fine in GHCi) Reviewers: bgamari Reviewed By: bgamari Subscribers: simonmar, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4824
* testsuite: disable T13615 on non-smp targetsSergei Trofimovich2018-03-101-0/+1
| | | | | | | T13615 needs multicore support from RTS: T13615: unknown RTS option: -N15 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* testsuite: Add newline to test outputDouglas Wilson2018-02-181-2/+2
| | | | | | | | | | Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4389
* Windows: fix all failing tests.Tamar Christina2018-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | This makes the testsuite pass clean on Windows again. It also fixes the `libstdc++-6.dll` error harbormaster was showing. I'm marking some tests as isolated tests to reduce their flakiness (mostly concurrency tests) when the test system is under heavy load. Updates process submodule. Test Plan: ./validate Reviewers: hvr, bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4277
* A bunch of typofixesGabor Greif2017-09-261-1/+1
|
* testsuite: Add test for #13916Ben Gamari2017-08-173-0/+170
| | | | | | | | Reviewers: austin Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3764
* Revert "testsuite: Add test for #13916"Ben Gamari2017-07-203-169/+0
| | | | | This reverts commit b2d3ec370b97fe5f448e8f1d4e0b7374c63c60a8. Didn't mean to push this one.
* testsuite: Add test for #13916Ben Gamari2017-07-203-0/+169
|
* testsuite: Ensure that hs_try_putmvar003 terminatesBen Gamari2017-07-192-5/+9
| | | | | | | | | | | | | | Test Plan: Validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: simonmar, rwbarton, thomie GHC Trac Issues: #13434 Differential Revision: https://phabricator.haskell.org/D3724
* testsuite: Add testcase for #13615Ben Gamari2017-07-034-0/+192
| | | | | | | | | | Reviewers: austin Subscribers: dfeuer, rwbarton, thomie GHC Trac Issues: #13615 Differential Revision: https://phabricator.haskell.org/D3696
* Fix a lost-wakeup bug in BLACKHOLE handling (#13751)Simon Marlow2017-06-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* hs_add_root() RTS API removalSergei Trofimovich2017-04-171-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Before ghc-7.2 hs_add_root() had to be used to initialize haskell modules when haskell was called from FFI. commit a52ff7619e8b7d74a9d933d922eeea49f580bca8 ("Change the way module initialisation is done (#3252, #4417)") removed needs for hs_add_root() and made function a no-op. For backward compatibility '__stginit_<module>' symbol was not removed. This change removes no-op hs_add_root() function and unused '__stginit_<module>' symbol from each haskell module. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: ./validate Reviewers: simonmar, austin, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3460
* Make the test fail if compiled without -threadedSimon Marlow2017-03-281-0/+3
| | | | | | | | | | Test Plan: validate Reviewers: bgamari, austin, erikd Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3387
* Change catch# demand signatureDavid Feuer2017-03-013-0/+11
| | | | | | | | | | | | | | | | | | * Give `catch#` a lazy demand signature, to make it more honest. * Make `catchException` and `catchAny` force their arguments so they actually behave as advertised. * Use `catch` rather than `catchException` in `forkIO`, `forkOn`, and `forkOS` to avoid losing exceptions. Fixes #13330 Reviewers: rwbarton, simonpj, simonmar, bgamari, hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3244
* tests: remove extra_files.py (#12223)Reid Barton2017-02-263-3/+6
| | | | | | | | | | | | The script I used is included as testsuite/driver/kill_extra_files.py, though at this point it is for mostly historical interest. Some of the tests in libraries/hpc relied on extra_files.py, so this commit includes an update to that submodule. One test in libraries/process also relies on extra_files.py, but we cannot update that submodule so easily, so for now we special-case it in the test driver.
* Spelling fixesGabor Greif2017-02-022-2/+2
|
* Remove clean_cmd and extra_clean usage from .T filesThomas Miedema2017-01-224-58/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | The `clean_cmd` and `extra_clean` setup functions don't do anything. Remove them from .T files. Created using https://github.com/thomie/refactor-ghc-testsuite. This diff is a test for the .T-file parser/processor/pretty-printer in that repository. find . -name '*.T' -exec ~/refactor-ghc-testsuite/Main "{}" \; Tests containing inline comments or multiline strings are not modified. Preparation for #12223. Test Plan: Harbormaster Reviewers: austin, hvr, simonmar, mpickering, bgamari Reviewed By: mpickering Subscribers: mpickering Differential Revision: https://phabricator.haskell.org/D3000 GHC Trac Issues: #12223
* Typos in commentsGabor Greif2017-01-132-2/+2
|
* testsuite/conc059: Don't attempt to use stdcall where it isn't supportedBen Gamari2016-12-011-1/+9
| | | | | | | | | | | | Test Plan: Validate on 64-bit Windows Reviewers: geekosaur, austin, erikd, Phyx Reviewed By: Phyx Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2781
* A few typos in commentsGabor Greif2016-11-211-1/+1
|
* Fix hs_try_putmvar003 (#12800)Simon Marlow2016-11-071-1/+1
| | | | | | | | | | | | | | | | | | | Summary: There was a race condition on some shared data when creating the callback thread. I couldn't repro the issue without inserting a dummy usleep(100), but it's definitely a bug. Test Plan: validate Reviewers: bgamari, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2678 GHC Trac Issues: #12800
* Skip T5611 on OSX as it fails non-deterministically.Matthew Pickering2016-10-221-1/+2
| | | | | | | | | | Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2622 GHC Trac Issues: #12751
* Fix failure in setnumcapabilities001 (#12728)Simon Marlow2016-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The value of enabled_capabilities can change across a call to requestSync(), and we were erroneously using an old value, causing things to go wrong later. It manifested as an assertion failure, I'm not sure whether there are worse consequences or not, but we should get this fix into 8.0.2 anyway. The failure didn't happen for me because it only shows up on machines with fewer than 4 processors, due to the new logic to enable -qn automatically. I've bumped the test parameter 8 to make it more likely to exercise that code. Test Plan: Ran setnumcapabilities001 many times Reviewers: niteria, austin, erikd, rwbarton, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2617 GHC Trac Issues: #12728
* Add hs_try_putmvar()Simon Marlow2016-09-129-0/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a fast, non-blocking, asynchronous, interface to tryPutMVar that can be called from C/C++. It's useful for callback-based C/C++ APIs: the idea is that the callback invokes hs_try_putmvar(), and the Haskell code waits for the callback to run by blocking in takeMVar. The callback doesn't block - this is often a requirement of callback-based APIs. The callback wakes up the Haskell thread with minimal overhead and no unnecessary context-switches. There are a couple of benchmarks in testsuite/tests/concurrent/should_run. Some example results comparing hs_try_putmvar() with using a standard foreign export: ./hs_try_putmvar003 1 64 16 100 +RTS -s -N4 0.49s ./hs_try_putmvar003 2 64 16 100 +RTS -s -N4 2.30s hs_try_putmvar() is 4x faster for this workload (see the source for hs_try_putmvar003.hs for details of the workload). An alternative solution is to use the IO Manager for this. We've tried it, but there are problems with that approach: * Need to create a new file descriptor for each callback * The IO Manger thread(s) become a bottleneck * More potential for things to go wrong, e.g. throwing an exception in an IO Manager callback kills the IO Manager thread. Test Plan: validate; new unit tests Reviewers: niteria, erikd, ezyang, bgamari, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2501
* Testsuite: use ignore_stderr/stdout instead of ignore_outputThomas Miedema2016-06-291-3/+3
| | | | | | | | | | | | | | | | | The problem with ignore_output is that it hides errors for WAY=ghci. GHCi always returns with exit code 0 (unless it is broken itself). For example: ghci015 must have been failing with compile errors for years, but we didn't notice because all output was ignored. Therefore, replace all uses of ignore_output with either ignore_stderr or ignore_stdout. In some cases I opted for adding the expected output. Update submodule hpc and stm. Reviewed by: simonmar Differential Revision: https://phabricator.haskell.org/D2367
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-2036-705/+705
|
* NUMA supportSimon Marlow2016-06-102-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The aim here is to reduce the number of remote memory accesses on systems with a NUMA memory architecture, typically multi-socket servers. Linux provides a NUMA API for doing two things: * Allocating memory local to a particular node * Binding a thread to a particular node When given the +RTS --numa flag, the runtime will * Determine the number of NUMA nodes (N) by querying the OS * Assign capabilities to nodes, so cap C is on node C%N * Bind worker threads on a capability to the correct node * Keep a separate free lists in the block layer for each node * Allocate the nursery for a capability from node-local memory * Allocate blocks in the GC from node-local memory For example, using nofib/parallel/queens on a 24-core 2-socket machine: ``` $ ./Main 15 +RTS -N24 -s -A64m Total time 173.960s ( 7.467s elapsed) $ ./Main 15 +RTS -N24 -s -A64m --numa Total time 150.836s ( 6.423s elapsed) ``` The biggest win here is expected to be allocating from node-local memory, so that means programs using a large -A value (as here). According to perf, on this program the number of remote memory accesses were reduced by more than 50% by using `--numa`. Test Plan: * validate * There's a new flag --debug-numa=<n> that pretends to do NUMA without actually making the OS calls, which is useful for testing the code on non-NUMA systems. * TODO: I need to add some unit tests Reviewers: erikd, austin, rwbarton, ezyang, bgamari, hvr, niteria Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2199
* Testsuite: delete unused file [skip ci]Thomas Miedema2016-05-171-3/+0
|
* PPC: Implement SMP primitives using gcc built-insPeter Trommler2016-05-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | The SMP primitives were missing appropriate memory barriers (sync, isync instructions) on all PowerPCs. Use the built-ins _sync_* provided by gcc and clang. This reduces code size significantly. Remove broken mark for concprog001 on powerpc64. The referenced ticket number (11259) was wrong. Test Plan: validate on powerpc and ARM Reviewers: erikd, austin, simonmar, bgamari, hvr Reviewed By: bgamari, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2225 GHC Trac Issues: #12070
* Remove a copy of System.Random and use reqlib('random')Simon Marlow2016-05-113-600/+4
|
* Fix ASSERT failure and re-enable setnumcapabilities001Simon Marlow2016-05-112-11/+57
| | | | | | | | | | | | The assertion failure was fairly benign, I think, but this fixes it. I've been running the test repeatedly for the last 30 mins and it hasn't triggered. There are other problems exposed by this test (see #12038), but I've worked around those in the test itself for now. I also copied the relevant bits of the parallel library here so that we don't need parallel for the test to run.
* Testsuite: delete unused concurrent/prog002/FileIO.hsThomas Miedema2016-04-261-9/+0
|
* Don't infer CallStacksEric Seidel2016-04-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We originally wanted CallStacks to be opt-in, but dealing with let binders complicated things, forcing us to infer CallStacks. It turns out that the inference is actually unnecessary though, we can let the wanted CallStacks bubble up to the outer context by refusing to quantify over them. Eventually they'll be solved from a given CallStack or defaulted to the empty CallStack if they reach the top. So this patch prevents GHC from quantifying over CallStacks, getting us back to the original plan. There's a small ugliness to do with PartialTypeSignatures, if the partial theta contains a CallStack constraint, we *do* want to quantify over the CallStack; the user asked us to! Note that this means that foo :: _ => CallStack foo = getCallStack callStack will be an *empty* CallStack, since we won't infer a CallStack for the hole in the theta. I think this is the right move though, since we want CallStacks to be opt-in. One can always write foo :: (HasCallStack, _) => CallStack foo = getCallStack callStack to get the CallStack and still have GHC infer the rest of the theta. Test Plan: ./validate Reviewers: goldfire, simonpj, austin, hvr, bgamari Reviewed By: simonpj, bgamari Subscribers: bitemyapp, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1912 GHC Trac Issues: #11573
* Testsuite: delete empty files [skip ci]Thomas Miedema2016-02-256-0/+0
|
* Testsuite: for tests that use TH, omit *all* prof_waysThomas Miedema2016-02-251-1/+1
| | | | | | | | | Instead of just profasm and profthreaded. And at least until -fexternal-interpreter is the default. Also: * WAY=profc doesn't exist anymore. * Omit all threaded_ways for conc039, not just a few.
* testsuite: mark tests broken on powerpc64Peter Trommler2016-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following tests fail on powerpc64 and have a ticket. Mark those tests as expect_broken. Here are the details: The PowerPC native code generator does not support DWARF debug information. This is tracked in ticket #11261. Mark the respective tests broken on powerpc64. testsuite: mark print022 broken on powerpc64 Ticket #11262 tracks difference in stdout for print022. testsuite: mark recomp015 broken on powerpc64 testsuite: mark recomp011 broken on powerpc64 This is tracked as ticket #11323 and #11260. testsuite: mark linker tests broken on powerpc64 Ticket #11259 tracks tests failing because there is no RTS linker on powerpc64. Test Plan: validate Reviewers: erikd, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1928 GHC Trac Issues: #11259, #11260, #11261, #11262, #11323
* Testsuite: delete Windows line endings [skip ci] (#11631)Thomas Miedema2016-02-235-10/+10
|
* Another batch of typo fixes in non-codeGabor Greif2016-02-111-1/+1
|
* Fix three broken tests involving exceptionsSimon Peyton Jones2016-01-263-11/+9
| | | | See comment:16 in Trac #10712. The tests were wrong, not GHC!
* Testsuite: #10712 is fixedThomas Miedema2015-12-171-3/+3
| | | | | | Verified by running: make TEST='exceptionsrun001 T3279 conc012 conc014' slowtest
* Rework the Implicit CallStack solver to handle local lets.Eric Seidel2015-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't just solve CallStack constraints indiscriminately when they occur in the RHS of a let-binder. The top-level given CallStack (if any) will not be in scope, so I've re-worked the CallStack solver as follows: 1. CallStacks are treated like regular IPs unless one of the following two rules apply. 2. In a function call, we push the call-site onto a NEW wanted CallStack, which GHC will solve as a regular IP (either directly from a given, or by quantifying over it in a local let). 3. If, after the constraint solver is done, any wanted CallStacks remain, we default them to the empty CallStack. This rule exists mainly to clean up after rule 2 in a top-level binder with no given CallStack. In rule (2) we have to be careful to emit the new wanted with an IPOccOrigin instead of an OccurrenceOf origin, so rule (2) doesn't fire again. This is a bit shady but I've updated the Note to explain the trick. Test Plan: validate Reviewers: simonpj, austin, bgamari, hvr Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1422 GHC Trac Issues: #10845
* Make 'error' include the CCS call stack when profiledSimon Marlow2015-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The idea here is that this gives a more detailed stack trace in two cases: 1. With `-prof` and `-fprof-auto` 2. In GHCi (see #11047) Example, with an error inserted in nofib/shootout/binary-trees: ``` $ ./Main 3 Main: z CallStack (from ImplicitParams): error, called at Main.hs:67:29 in main:Main CallStack (from -prof): Main.check' (Main.hs:(67,1)-(68,82)) Main.check (Main.hs:63:1-21) Main.stretch (Main.hs:32:35-57) Main.main.c (Main.hs:32:9-57) Main.main (Main.hs:(27,1)-(43,42)) Main.CAF (<entire-module>) ``` This doesn't quite obsolete +RTS -xc, which also attempts to display more information in the case when the error is in a CAF, but I'm exploring other solutions to that. Includes submodule updates. Test Plan: validate Reviewers: simonpj, ezyang, gridaphobe, bgamari, hvr, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1426
* testsuite: performGC requires SMP support for 'qg' optionSergei Trofimovich2015-10-301-7/+2
| | | | Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* base: use Show for ErrorCall in uncaughtExceptionHandlerEric Seidel2015-09-211-0/+2
| | | | | | | | | | | | | The default top-level exception handler now uses the `Show` instance for `ErrorCall` when printing exceptions, so it will actually print the out-of-band data (e.g. `CallStack`s) in compiled binaries, instead of just printing the error message. This also updates the hpc submodule to fix the test output. Reviewed By: austin, thomie Differential Revision: https://phabricator.haskell.org/D1217