summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts
Commit message (Collapse)AuthorAgeFilesLines
* rts: Fix isByteArrayPinned#'s treatment of large arraysBen Gamari2017-07-032-0/+19
| | | | | | | | | | | | | | | 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
* configure: Coerce gcc to use $LD instead of system defaultBen Gamari2017-06-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | The configure script will now try to coerce gcc to use the linker pointed to by $LD instead of the system default (typically bfd ld). Moreover, we now check for `ld.gold` and `ld.lld` before trying `ld`. The previous behavior can be reverted to by using the new --disable-ld-override flag. On my machine gold seems to trigger an apparent infelicity in constructor behavior, causing T5435_asm to fail. I've opened #13883 to record this issue and have accepted the questionable constructor ordering for the time being. Test Plan: Validate with `config_args='--enable-ld-override'` Reviewers: austin, hvr, simonmar Subscribers: duog, nh2, rwbarton, thomie, erikd, snowleopard GHC Trac Issues: #13541, #13810, #13883 Differential Revision: https://phabricator.haskell.org/D3449
* base: Validate input in setNumCapabilitiesBen Gamari2017-06-163-1/+6
| | | | | | | | | | | | Test Plan: validate Reviewers: austin, hvr, erikd, simonmar Subscribers: rwbarton, thomie GHC Trac Issues: #13832 Differential Revision: https://phabricator.haskell.org/D3652
* Various testsuite fixes for 32-bit WindowsBen Gamari2017-04-026-1/+52
|
* rts: Make out-of-memory errors more consistentBen Gamari2017-04-023-3/+3
| | | | This will make it a bit easier to maintain consistent output in the testsuite.
* Report heap overflow in the same way as stack overflowSimon Marlow2017-04-021-3/+0
| | | | | | | | | | | | | | | | | | | | | | | Now that we throw an exception for heap overflow, we should only print the heap overflow message in the main thread when the HeapOverflow exception is caught, rather than as a side effect in the GC. Stack overflows were already done this way, I just made heap overflow consistent with stack overflow, and did some related cleanup. Fixes broken T2592(profasm) which was reporting the heap overflow message twice (you would only notice when building with profiling libs enabled). Test Plan: validate Reviewers: bgamari, niteria, austin, DemiMarie, hvr, erikd Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3394
* tests: remove extra_files.py (#12223)Reid Barton2017-02-264-27/+53
| | | | | | | | | | | | 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.
* tests: manually move some extra_files into *.T filesReid Barton2017-02-261-6/+12
| | | | | Some of the *.T files were in libraries/hpc, so this contains an update to that submodule.
* Manually move extra_files for tests T9579_*Reid Barton2017-02-261-2/+1
| | | | | | | | | | | | Summary: My script won't understand this. Test Plan: validate Reviewers: austin, bgamari, simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3210
* base: Add handling of -- to getArgs for WindowsAndreas Klebinger2017-02-233-0/+9
| | | | | | | | | | | | | getArgs didn't match the treatmeant of -- in the RTS leading to inconsistencies between behavior on Windows and other platforms. See #13287. Reviewers: austin, hvr, bgamari, erikd, simonmar, rwbarton Reviewed By: bgamari, rwbarton Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3147
* Update output of failing 11223 testsTamar Christina2017-02-014-10/+10
| | | | | | | | | | | | | | Summary: make accept new test output Test Plan: make test TEST="T11223_link_order_a_b_2_fail T11223_simple_duplicate_lib" Reviewers: austin, bgamari, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3053
* Remove clean_cmd and extra_clean usage from .T filesThomas Miedema2017-01-226-87/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add missing test files for T13082.Tamar Christina2017-01-162-0/+10
| | | | | | | | | | | | | | | | | | | Summary: Add two missing test files for T13082. The reason they were missing is because the .gitignore contains a very harmful and broad wildcard `foo*`. Why? Test Plan: make test TEST="T13082_good T13082_fail" Reviewers: austin, bgamari, simonmar, erikd Reviewed By: erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2981 GHC Trac Issues: #13082
* Improve access violation reporting on WindowsRyan Scott2017-01-153-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is courtesy of @awson. Currently, whenever GHC catches a segfault on Windows, it simply reports the somewhat uninformative message `Segmentation fault/access violation in generated code`. This patch adds to the message the type of violation (read/write/dep) and location information, which should help debugging segfaults in the future. Fixes #13108. Test Plan: Build on Windows Reviewers: austin, erikd, bgamari, simonmar, Phyx Reviewed By: bgamari, Phyx Subscribers: awson, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2969 GHC Trac Issues: #13108
* Fix abort and import lib search on WindowsTamar Christina2017-01-155-0/+35
| | | | | | | | | | | | | | | | | | | | | | Summary: Apparently `sysErrorBelch` doesn't terminate the program anymore making previously unreachable code now execute. If a dll is not found the error message we return needs to be a heap value. Secondly also allow the pattern `lib<name>` to be allowed for finding an import library with the name `lib<name>.dll.a`. Test Plan: ./validate, new tests T13082_good and T13082_fail Reviewers: austin, RyanGlScott, hvr, erikd, simonmar, bgamari Reviewed By: RyanGlScott, bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2941 GHC Trac Issues: #13082
* Throw an exception on heap overflowDemi Obenour2017-01-106-0/+36
| | | | | | | | | | | | | | | | | This changes heap overflow to throw a HeapOverflow exception instead of killing the process. Test Plan: GHC CI Reviewers: simonmar, austin, hvr, erikd, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2790 GHC Trac Issues: #1791
* Testsuite: Skip failing tests on PowerPC 64-bitPeter Trommler2016-12-271-2/+2
| | | | | | | | | | | | | | | | | | | The Power ISA says the result of a division by zero is undefined. So ignore stdout on PowerPC 64-bit systems. Disable ext-interp tests on 64-bit PowerPC. We don't have support for PowerPC 64-bit ELF in the RTS linker, which is needed for the external interpreter. Test Plan: ./validate Reviewers: austin, simonmar, hvr, erikd, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2782
* T8242: disable on NOSMP targetsSergei Trofimovich2016-12-181-1/+1
| | | | | | Test calls setNumCapabilities, requires SMP support. Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* T10296a: disable on NOSMP targetsSergei Trofimovich2016-12-181-1/+1
| | | | | | Test uses +RTS -N2, requires SMP support. Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* T8209: disable on NOSMP targetsSergei Trofimovich2016-12-181-1/+1
| | | | | | Test calls setNumCapabilities, requires SMP support. Signed-off-by: Sergei Trofimovich <siarheit@google.com>
* array: Check for integer overflow during allocationBen Gamari2016-12-151-5/+15
| | | | | | | | | | | | This fixes #229, where creating a new array can cause array to allocate a smaller array than it thinks it allocates due to integer overflow, resulting in memory unsafety. This breaks the rts/overflow1 test, which relied on this unchecked overflow. I fix it by reimplementing the test in terms of newByteArray# directly. Updates the array submodule.
* Reset FPU precision back to MSVCRT defaultsTamar Christina2016-12-155-0/+46
| | | | | | | | | | | | | | | | | | | | | | Mingw-w64 does a stupid thing. They set the FPU precision to extended mode by default. The reasoning is that it's for compatibility with GNU Linux ported libraries. However the problem is this is incompatible with the standard Windows double precision mode. In fact, if we create a new OS thread then Windows will reset the FPU to double precision mode. So we end up with a weird state where the main thread by default has a different precision than any child threads. Test Plan: ./validate new test T7289 Reviewers: simonmar, austin, bgamari, erikd Reviewed By: simonmar Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2819 GHC Trac Issues: #7289
* Fix testcase T12903 on OS XAlexander Vershilov2016-12-132-8/+15
| | | | | | | | | | | | | | | Old test used timeouts that leads to the various sporadic errors. Tet was rewritten to not use timeouts. Reviewers: austin, erikd, simonmar, bgamari Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2827 GHC Trac Issues: #12956
* Disable T12903 due to flakinessTamar Christina2016-12-121-1/+4
| | | | | | | | | | | | | | | | Test seems to randomly fail on harbormaster. Disabling it until it can be fixed. Test Plan: make test TEST=T12903 Reviewers: austin, bgamari, simonmar, mpickering Reviewed By: mpickering Subscribers: mpickering, thomie, qnikst Differential Revision: https://phabricator.haskell.org/D2821 GHC Trac Issues: #12903
* testsuite: Fix syntax error in rts/all.TBen Gamari2016-12-091-1/+1
| | | | Yet another reason why no change to too small to validate. Arg.
* Mark T12903 as broken on OS XBen Gamari2016-12-091-1/+3
| | | | Something has recently broken it. See #12956.
* Install toplevel handler inside fork.Alexander Vershilov2016-12-023-0/+12
| | | | | | | | | | | | | | | | | | | | When rts is forked it doesn't update toplevel handler, so UserInterrupt exception is sent to Thread1 that doesn't exist in forked process. We install toplevel handler when fork so signal will be delivered to the new main thread. Fixes #12903 Reviewers: simonmar, austin, erikd, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2770 GHC Trac Issues: #12903
* Update test output for WindowsTamar Christina2016-11-291-2/+1
| | | | | | | | | | | | | | | | | | | | | Following D2684 these two tests need to be updated: * T7037: timeout.exe now waits until all processes are finished. this makes T7037 reliable. So enabled. * T876: Unknown reason, allocations are much lower than before. Test Plan: ./validate Reviewers: austin, simonmar, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2759 GHC Trac Issues: #12725, #12004
* Replace -fshow-source-paths with -fhide-source-pathsSylvain Henry2016-11-292-2/+2
| | | | | | | | | | | | | | | | | | | | | This patch reverts the change introduced with 587dcccfdfa7a319e27300a4f3885071060b1f8e and restores the previous default output of GHC (i.e., show source path and object path for each compiled module). The -fhide-source-paths flag can be used to hide these paths and reduce the line noise. Reviewers: gracjan, nomeata, austin, bgamari, simonmar, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2728 GHC Trac Issues: #12851
* Make default output less verbose (source/object paths)Sylvain HENRY2016-11-112-2/+2
| | | | | | | | | | | | Reviewers: simonmar, mpickering, austin, bgamari Reviewed By: bgamari Subscribers: mpickering, nomeata, thomie Differential Revision: https://phabricator.haskell.org/D2679 GHC Trac Issues: #12807
* Align GHCi's library search order more closely with LDsTamar Christina2016-10-316-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Given a static library and an import library in the same folder. e.g. ``` libfoo.a libfoo.dll.a ``` running `ghci -lfoo` we should prefer the import library `libfoo.dll.a` over `libfoo.a` because we prefer having to just load the DLL. And not having to do any linking. This also more closely emulated the behaviour of LD, which has a search order of ``` libxxx.dll.a xxx.dll.a libxxx.a cygxxx.dll (*) libxxx.dll xxx.dll ``` Test Plan: ./validate Reviewers: RyanGlScott, austin, hvr, bgamari, erikd, simonmar Reviewed By: RyanGlScott Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2651 GHC Trac Issues: #12771
* fixup! Add option to not retain CAFs to the linker APISimon Marlow2016-10-181-1/+1
|
* testsuite: Mark T7037 as broken on WindowsBen Gamari2016-10-171-1/+2
| | | | Due to #12725.
* testsuite: Mark T9405 as broken on WindowsBen Gamari2016-10-172-2/+4
| | | | There seems to be a runtime system bug here, as described in #12714.
* Ignore output from derefnull and divbyzero on DarwinBen Gamari2016-10-021-2/+8
| | | | | | The output contains the pid and executable path of the bash process which spawned the failing process. It doesn't seem worth the effort to cleanse this output; just ignore it.
* Implement deriving strategiesRyan Scott2016-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allows users to explicitly request which approach to `deriving` to use via keywords, e.g., ``` newtype Foo = Foo Bar deriving Eq deriving stock Ord deriving newtype Show ``` Fixes #10598. Updates haddock submodule. Test Plan: ./validate Reviewers: hvr, kosmikus, goldfire, alanz, bgamari, simonpj, austin, erikd, simonmar Reviewed By: alanz, bgamari, simonpj Subscribers: thomie, mpickering, oerjan Differential Revision: https://phabricator.haskell.org/D2280 GHC Trac Issues: #10598
* Make the test for #11108 less fragileTakano Akio2016-09-052-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | This change should close #11108 by fixing the test case. This commit fixes two issues: * Make sure that each weak pointer we allocate has a constructor as the key, not a thunk. A failure to do so meant these weak pointers died prematurely on the 'ghci' WAY. * Don't print anything in the finalizer, because they are not guaranteed to run. Test Plan: validate Reviewers: austin, simonmar, erikd, bgamari Reviewed By: erikd, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2512 GHC Trac Issues: #11108
* Added support for deprecated POSIX functions on Windows.Tamar Christina2016-09-014-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With the introduction of 8.0.1 We've stopped supporting in GHCi the use of POSIX functions under their deprecated names on Windows. This to be compatible with object and libraries from the most popular compilers on the platform (Microsoft and Intel compilers). However this brings a confusing disparity between the compiled and interpreted behavior since MingW-W64 does support the deprecated names. Also It seems clear that package writers won't update their packages to properly support Windows. As such I have added redirects in the RTS for the deprecated functions as listed on https://msdn.microsoft.com/en-us/library/ms235384.aspx. This won't export the functions (as in, they won't be in the symbol table of compiled code for the RTS.) but we inject them into the symbol table of the dynamic linker at startup. Test Plan: ./validate and make test TEST="ffi017 ffi021" Reviewers: thomie, simonmar, RyanGlScott, bgamari, austin, hvr, erikd Reviewed By: simonmar, bgamari Subscribers: RyanGlScott, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2500 GHC Trac Issues: #12209, #12497, #12496
* Testsuite: expose TEST_CC (path to gcc)Thomas Miedema2016-07-091-1/+1
| | | | | | Reviewed by: Phyx Differential Revision: https://phabricator.haskell.org/D2394
* Testsuite: use ignore_stderr/stdout instead of ignore_outputThomas Miedema2016-06-298-32/+53
| | | | | | | | | | | | | | | | | 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
* Stop the simplifier from removing StaticPtr binds.Facundo Domínguez2016-06-281-6/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: We have the FloatOut pass create exported ids for floated StaticPtr bindings. The simplifier doesn't try to remove those. This patch also improves on 7fc20b by making a common definition collectStaticPtrSatArgs to test for StaticPtr binds. Fixes #12207. Test Plan: ./validate Reviewers: simonpj, austin, bgamari, simonmar, goldfire Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2366 GHC Trac Issues: #12207
* Testsuite: do not add -debug explicitly in .T fileThomas Miedema2016-06-282-5/+3
| | | | | This prevents `cannot find -lHSrts_debug_p` when running `make TEST=T9078 WAY=profasm` (#9078).
* Testsuite: open/close stdin/stdout/stderr explicitlyThomas Miedema2016-06-281-1/+1
| | | | | | | | | | | | | | | | | | This allows run_command's to contain `|`, and `no_stdin` isn't necessary anymore. Unfortunately it doesn't fix T7037 on Windows which I had hoped it would (testsuite driver tries to read a file that it just created itself, but the OS says it doesn't exist). The only drawback of this commit is that the command that the testsuite prints to the terminal (for debugging purposes) doesn't mention the files that stdout and stderr are redirected to anymore. This is probably ok. Update submodule unix. Differential Revision: https://phabricator.haskell.org/D1234
* Testsuite: mark tests expect brokenThomas Miedema2016-06-201-3/+7
| | | | | | | | | * CgStaticPointers, GcStaticPointers, ListStaticPointers, TcStaticPointers01, TcStaticPointers02: #12207 * T11535: #12210 * ffi017/ffi021: #12209 * T11108: #11108 * T9646: #9646
* Testsuite: remove Windows CR [skip ci]Thomas Miedema2016-06-207-31/+31
|
* Testsuite: run tests in <testdir>.run instead of /tmpThomas Miedema2016-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | As discussed in Phab:D1187, this approach makes it a bit easier to inspect the test directory while working on a new test. The only tests that needed changes are the ones that refer to files in ancestor directories. Those files are now copied directly into the test directory. validate still runs the tests in a temporary directory in /tmp, see `Note [Running tests in /tmp]` in testsuite/driver/runtests.py. Update submodule hpc. Reviewed by: simonmar Differential Revision: https://phabricator.haskell.org/D2333 GHC Trac Issues: #11980
* NUMA cleanupsSimon Marlow2016-06-172-0/+23
| | | | | - Move the numaMap and nNumaNodes out of RtsFlags to Capability.c - Add a test to tests/rts
* Add thin library support to Windows tooTamar Christina2016-06-135-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Code already existed in the RTS to add thin library support for non-Windows operating systems. This adds it to Windows as well. ar thin libraries have the exact same format as normal archives except they have a different magic string and they don't copy the object files into the archive. Instead each header entry points to the location of the object file on disk. This is useful when a library is only created to satisfy a compile time dependency instead of to be distributed. This saves the time required for copying. Test Plan: ./validate and new test T11788 Reviewers: austin, bgamari, simonmar, erikd Reviewed By: bgamari, simonmar Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2323 GHC Trac Issues: #11788
* Disable T12031 on linuxTamar Christina2016-06-121-0/+1
|
* Fix incorrect calculated relocations on Windows x86_64Tamar Christina2016-06-127-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: See #12031 for analysis, but essentially what happens is: To sum up the issue, the reason this seems to go wrong is because of how we initialize the `.bss` section for Windows in the runtime linker. The first issue is where we calculate the zero space for the section: ``` zspace = stgCallocBytes(1, bss_sz, "ocGetNames_PEi386(anonymous bss)"); sectab_i->PointerToRawData = ((UChar*)zspace) - ((UChar*)(oc->image)); ``` Where ``` UInt32 PointerToRawData; ``` This means we're stuffing a `64-bit` value into a `32-bit` one. Also `zspace` can be larger than `oc->image`. In which case it'll overflow and then get truncated in the cast. The address of a value in the `.bss` section is then calculated as: ``` addr = ((UChar*)(oc->image)) + (sectabent->PointerToRawData + symtab_i->Value); ``` If it does truncate then this calculation won't be correct (which is what is happening). We then later use the value of `addr` as the `S` (Symbol) value for the relocations ``` S = (size_t) lookupSymbol_( (char*)symbol ); ``` Now the majority of the relocations are `R_X86_64_PC32` etc. e.g. They are guaranteed to fit in a `32-bit` value. The `R_X86_64_64` introduced for these pseudo-relocations so they can use the full `48-bit` addressing space isn't as lucky. As for why it sometimes work has to do on whether the value is truncated or not. `PointerToRawData` can't be changed because it's size is fixed by the PE specification. Instead just like with the other platforms, we now use `section` on Windows as well. This gives us a `start` parameter of type `void*` which solves the issue. This refactors the code to use `section.start` and to fix the issues. Test Plan: ./validate and new test added T12031 Reviewers: RyanGlScott, erikd, bgamari, austin, simonmar Reviewed By: simonmar Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2316 GHC Trac Issues: #12031, #11317