summaryrefslogtreecommitdiff
path: root/rts
Commit message (Collapse)AuthorAgeFilesLines
* Fix #16525: ObjectCode freed wrongly because of lack of info header checkPhuong Trinh2019-06-133-1/+8
| | | | | | | `checkUnload` currently doesn't check the info header of static objects. Thus, it may free an `ObjectCode` struct wrongly even if there's still a live static object whose info header lies in a mapped section of that `ObjectCode`. This fixes the issue by adding an appropriate check.
* rts/linker: Only mprotect GOT after it is filledBen Gamari2019-06-121-2/+5
| | | | | | | | This fixes a regression, introduced by 67c422ca, where we mprotect'd the global offset table (GOT) region to PROT_READ before we had finished filling it, resulting in a linker crash. Fixes #16779.
* rts/linker: Make elf_got.c a bit more legibleBen Gamari2019-06-121-1/+10
|
* Fix an error message in CheckUnload.c:searchHeapBlocksÖmer Sinan Ağacan2019-06-111-1/+1
|
* rts/linker: Use mmapForLinker to map PLTBen Gamari2019-06-111-6/+2
| | | | | | | The PLT needs to be located within a close distance of the code calling it under the small memory model. Fixes #16784.
* rts/linker: Mmap into low memory on AArch64Ben Gamari2019-06-111-13/+22
| | | | | This extends mmapForLinker to use the same low-memory mapping strategy used on x86_64 on AArch64. See #16784.
* rts/RtsFlags.c: mention that -prof too enables support for +RTS -lAlp Mestanogullari2019-06-111-1/+1
|
* rts: Fix RetainerProfile early return with TREC_CHUNKDaniel Gröber2019-06-091-1/+1
| | | | | | | | When pop() returns with `*c == NULL` retainerProfile will immediately return. All other code paths is pop() continue with the next stackElement when this happens so it seems weird to me that TREC_CHUNK we would suddenly abort everything even though the stack might still have elements left to process.
* rts: Separate population of eventTypes from initial event generationBen Gamari2019-06-091-8/+17
| | | | | | Previously these two orthogonal concerns were both implemented in postHeaderEvents which made it difficult to send header events after RTS initialization.
* Fix two lint failures in rts/linker/MachO.cMatthew Pickering2019-06-081-2/+2
|
* Add HEAP_PROF_SAMPLE_END event to mark end of samplesMatthew Pickering2019-06-075-0/+25
| | | | | | | This allows a user to observe how long a sampling period lasts so that the time taken can be removed from the profiling output. Fixes #16697
* rts: Remove unused decls from CNF.hÖmer Sinan Ağacan2019-06-011-3/+0
|
* Remove unused RTS function 'unmark'Ömer Sinan Ağacan2019-05-311-10/+0
|
* support small arrays and CONSTR_NOCAF in ghc-heapDavid Hewson2019-05-311-0/+11
|
* Apply suggestion to rts/CheckUnload.cTrịnh Tuấn Phương2019-05-301-1/+2
|
* Apply suggestion to rts/CheckUnload.cTrịnh Tuấn Phương2019-05-301-1/+1
|
* Use binary search to speedup checkUnloadPhuong Trinh2019-05-301-32/+135
| | | | | | | | | We are iterating through all object code for each heap objects when checking whether object code can be unloaded. For large projects in GHCi, this can be very expensive due to the large number of object code that needs to be loaded/unloaded. To speed it up, this arrangess all mapped sections of unloaded object code in a sorted array and use binary search to check if an address location fall on them.
* rts: Handle zero-sized mappings in MachO linkerBen Gamari2019-05-301-2/+6
| | | | | | | As noted in #16701, it is possible that we will find that an object has no segments needing to be mapped. Previously this would result in mmap being called for a zero-length mapping, which would fail. We now simply skip the mmap call in this case; the rest of the logic just works.
* CNF.c: Move debug functions behind ifdefÖmer Sinan Ağacan2019-05-291-1/+1
|
* Fix padding of entries in .prof filesJasper Van der Jeugt2019-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | When the number of entries of a cost centre reaches 11 digits, it takes up the whole space reserved for it and the prof file ends up looking like: ... no. entries %time %alloc %time %alloc ... ... 120918 978250 0.0 0.0 0.0 0.0 ... 118891 0 0.0 0.0 73.3 80.8 ... 11890229702412351 8.9 13.5 73.3 80.8 ... 118903 153799689 0.0 0.1 0.0 0.1 ... This results in tooling not being able to parse the .prof file. I realise we have the JSON output as well now, but still it'd be good to fix this little weirdness. Original bug report and full prof file can be seen here: <https://github.com/jaspervdj/profiteur/issues/28>.
* Add `keepCAFs` to RtsSymbolsMoritz Angermann2019-05-251-0/+1
|
* RTS: Fix restrictive castAlec Theriault2019-05-221-2/+2
| | | | | | | | | | | | | Commit e75a9afd2989e0460f9b49fa07c1667299d93ee9 added an `unsigned` cast to account for OSes that have signed `rlim_t` signed. Unfortunately, the `unsigned` cast has the unintended effect of narrowing `rlim_t` to only 4 bytes. This leads to some spurious out of memory crashes (in particular: Haddock crashes with OOM whenn building docs of `ghc`-the-library). In this case, `W_` is a better type to cast to: we know it will be unsigned too and it has the same type as `*len` (so we don't suffer from accidental narrowing).
* Print PAP object address in stg_PAP_info entry codeÖmer Sinan Ağacan2019-05-081-1/+1
| | | | Continuation to ce23451c
* PrimOps.cmm: remove unused stuffÖmer Sinan Ağacan2019-05-031-6/+2
|
* rts: Properly free the RTSSummaryStats structureÖmer Sinan Ağacan2019-05-031-6/+4
| | | | | | | | `stat_exit` always allocates a `RTSSummaryStats` but only sometimes frees it, which casues leaks. With this patch we unconditionally free the structure, fixing the leak. Fixes #16584
* Minor RTS refactoring:Ömer Sinan Ağacan2019-04-252-2/+2
| | | | | | - Remove redundant casting in evacuate_static_object - Remove redundant parens in STATIC_LINK - Fix a typo in GC.c
* osReserveHeapMemory: handle signed rlim_tFraser Tweedale2019-04-231-2/+4
| | | | | | rlim_t is a signed type on FreeBSD, and the build fails with a sign-compare error. Add explicit (unsigned) cast to handle this case.
* Restore Xmm registers properly in StgCRun.cklebinger.andreas@gmx.at2019-04-041-9/+9
| | | | | This fixes #16514: Xmm6-15 was restored based off rax instead of rsp. The code was introduced in the fix for #14619.
* Improve performance of newSmallArray#Michal Terepeta2019-04-012-4/+7
| | | | | | | | | | | | | | This: - Hoists part of the condition outside of the initialization loop in `stg_newSmallArrayzh`. - Annotates one of the unlikely branches as unlikely, also in `stg_newSmallArrayzh`. - Adds a couple of annotations to `allocateMightFail` indicating which branches are likely to be taken. Together this gives about 5% improvement. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
* Update Wiki URLs to point to GitLabTakenobu Tani2019-03-2530-34/+34
| | | | | | | | | | | | | | | | | | | | | | | This moves all URL references to Trac Wiki to their corresponding GitLab counterparts. This substitution is classified as follows: 1. Automated substitution using sed with Ben's mapping rule [1] Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy... New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy... 2. Manual substitution for URLs containing `#` index Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz 3. Manual substitution for strings starting with `Commentary` Old: Commentary/XxxYyy... New: commentary/xxx-yyy... See also !539 [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
* Gracefully handle error condition in Mach-O relocateSectionArtem Pyanykh2019-03-201-1/+6
|
* Directly test section alignment, fix internal reloc probing lengthArtem Pyanykh2019-03-201-2/+6
|
* Add missing levels to SegmentProt enumArtem Pyanykh2019-03-202-4/+19
|
* Address some todos and fixmesArtem Pyanykh2019-03-203-21/+22
|
* Use segments for section layoutArtem Pyanykh2019-03-206-94/+296
|
* Adjust section placement and relocation logic for Mach-OArtem Pyanykh2019-03-204-123/+234
| | | | | | | | | | | | | | 1. Place each section on a separate page to ensure required alignment (wastes lots ot space, needs to be improved). 2. Unwire relocation logic from macho sections (the most fiddly part is adjusting internal relocations). Other todos: 0. Add a test for section alignment. 1. Investigate 32bit relocations! 2. Fix memory leak in ZEROPAGE section allocation. 3. Fix creating redundant jump islands for GOT. 4. Investigate more compact section placement.
* rts/RtsSymbols: Drop __mingw_vsnwprintfBen Gamari2019-03-201-1/+0
| | | | | | As described in #16387, this is already defined by mingw and consequently defining it in the RTS as well leads to multiple definition errors from the RTS linker at runtime.
* err: clean up error handlerTamar Christina2019-03-191-19/+30
|
* ghc-heap: Introduce closureSizeBen Gamari2019-03-172-0/+8
| | | | | | This function allows the user to compute the (non-transitive) size of a heap object in words. The "closure" in the name is admittedly confusing but we are stuck with this nomenclature at this point.
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-1514-18/+18
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* rts: Factor out large bitmap walkingBen Gamari2019-03-092-16/+40
| | | | | This will be needed by the mark phase of the non-moving collector so let's factor it out.
* Fix itBen Gamari2019-03-063-6/+10
|
* rts: Unglobalize dead_weak_ptr_list and resurrected_threadsÖmer Sinan Ağacan2019-03-065-24/+23
| | | | | | | | 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.
* rts/Printer: Print forwarding pointersÖmer Sinan Ağacan2019-03-051-3/+8
|
* rts/Printer: Introduce a few more printing utilitiesÖmer Sinan Ağacan2019-03-052-0/+74
| | | | | These include printLargeAndPinnedObjects, printWeakLists, and printStaticObjects. These are generally useful things to have.
* RTS: Add missing memory barrierPeter Trommler2019-02-271-3/+6
| | | | | | | | | | | | | 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
* Drop support for i386 and PowerPC in MachO linkerArtem Pyanykh2019-02-224-231/+8
| | | | | | 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.
* Fix two bugs in stg_ap_0_fast in profiling runtimeÖmer Sinan Ağacan2019-02-201-7/+11
| | | | | | | | | | | | | | | | | | 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).
* Fix checkStackChunk() call in Interepter.c, enable an assertionÖmer Sinan Ağacan2019-02-132-2/+2
| | | | Fixes #16303
* rts/ProfilerReportJson: Fix format stringBen Gamari2019-02-081-1/+1
| | | | This was warning on i386.