summaryrefslogtreecommitdiff
path: root/rts
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Default to infinite stack size (#8189)"Austin Seipp2013-09-085-53/+24
| | | | This reverts commit d85044f6b201eae0a9e453b89c0433608e0778f0.
* Avoid allocating while holding a lock (#8242)Takano Akio2013-09-081-8/+8
| | | | | | | | | | This reverts commit 6770663f764db76dbb7138ccb3aea0527d194151. If the program enters the garbage collector with the closure lock held, it will confuse the garbage collector and will result in an infinite loop in evacuate(). Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Default to infinite stack size (#8189)Austin Seipp2013-09-085-24/+53
| | | | | | | | | | | | | When servicing a stack overflows, only throw an exception to the given thread if the user explicitly set a max stack size, using +RTS -K. Otherwise just service it normally and grow the stack. In case we actually run out of *heap* (stack chuncks are allocated on the heap), then we need to bail by calling the stackOverflow() hook and exit immediately. Authored-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Record PAP allocation to CCCS.Edward Z. Yang2013-09-071-0/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Windows: load eh_frame as rodata, fixes #8237Edward Z. Yang2013-09-051-0/+6
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Ignore drectve sections, partially fixing #7056Edward Z. Yang2013-09-041-0/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Don't refer to oc->next after freeing oc.Simon Marlow2013-09-041-2/+3
|
* Fix printf formats for pathchar on Windows (where it's wchar_t, not char)Simon Marlow2013-09-042-6/+4
|
* Don't move Capabilities in setNumCapabilities (#8209)Simon Marlow2013-09-0414-191/+138
| | | | | | | | | | | | | We have various problems with reallocating the array of Capabilities, due to threads in waitForReturnCapability that are already holding a pointer to a Capability. Rather than add more locking to make this safer, I decided it would be easier to ensure that we never move the Capabilities at all. The capabilities array is now an array of pointers to Capabaility. There are extra indirections, but it rarely matters - we don't often access Capabilities via the array, normally we already have a pointer to one. I ran the parallel benchmarks and didn't see any difference.
* minor: remove tabs from fileatomicsRyan Newton2013-08-311-4/+4
|
* Merge branch 'master' into atomicsRyan Newton2013-08-319-1663/+450
|\
| * Treat EPERM error from mmap as an OOM (#7500)Reid Barton2013-08-291-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux can give back EPERM from an mmap call when a user program attempts to map pages near `mmap_min_addr`, which is a kernel security measure to prevent people from mapping pages at address 0. We may do this when we hint to mmap what address to map the pages to. However, it's theoretically possible we're not actually out of memory - we could have continuously mapped pages at some other place far away from `mmap_min_addr` and succeeded instead. So as an added precaution, if mmap for a given addr gives us EPERM, we'll also attempt to map *again*, but without the address hint. Maybe the kernel can do the right thing. However, while testing #7500, the amount of free address space we could have otherwise used only turns out to be about 139MB. Which isn't really a lot. So, given that, we *also* otherwise treat EPERM as an out of memory error. This fixes #7500. Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Revert "Check for integer overflow in osGetMBlocks"Austin Seipp2013-08-291-12/+1
| | | | | | | | | | | | This reverts commit 48865521de6638240819b3979edbb3d33401dc8e. Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Revert "Paranoid integer overflow check in my_mmap"Austin Seipp2013-08-291-3/+0
| | | | | | | | | | | | This reverts commit 1ce65edbff90fc8103062a1f94258ecc0c682309. Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Revert "Paranoid integer overflow check in osGetMBlocks"Austin Seipp2013-08-291-2/+1
| | | | | | | | | | | | This reverts commit 1247dff7b852d45dc5006ae8be33ac991cc76c74. Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Paranoid integer overflow check in osGetMBlocksReid Barton2013-08-291-1/+2
| | | | | | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Paranoid integer overflow check in my_mmapReid Barton2013-08-291-0/+3
| | | | | | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Check for integer overflow in osGetMBlocksReid Barton2013-08-291-1/+12
| | | | | | | | | | | | Fixes Trac #5188. Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Add support for iOS simulator (issue #8152).Austin Seipp2013-08-241-1/+1
| | | | | | | | | | | | | | | | The iOS simulator is essentially an iOS target but for an x86 machine instead. It doesn't support the native code generator either, though. Authored-by: Stephen Blackheath <...@blacksapphire.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Fix i386/Linux build.Austin Seipp2013-08-241-1/+4
| | | | | | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Remove unused ghc-frontpanel.glade fileAustin Seipp2013-08-231-1622/+0
| | | | | | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Fix build for i386/windows.Austin Seipp2013-08-231-2/+7
| | | | | | | | | | | | symbol_extras is only part of ObjectCode on certain platforms. Signed-off-by: Austin Seipp <aseipp@pobox.com>
| * Strings and comments only: 'to to ' fixesGabor Greif2013-08-221-1/+1
| | | | | | | | I'd still prefer if a native english speaker would check them.
| * Remove DYNAMIC_GHC_PROGRAMS tests in the linkerSimon Marlow2013-08-222-22/+0
| | | | | | | | | | The linker is usable even when GHCi is dynamically linked. These tests make the linker_unload test fail.
| * Really unload object code when it is safe to do so (#8039)Simon Marlow2013-08-225-17/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The next major GC after an unloadObj() will do a traversal of the heap to determine whether the object code can be removed from memory or not. We'll keep doing these until it is safe to remove the object code. In my experiments with GHCi, the objects get unloaded immediately, which is a good sign: we're not accidentally holding on to any references anywhere in the GHC data structures. Changes relative to the patch earlier posted on the ticket: - fix two memory leaks discovered with Valgrind, after testing with tests/rts/linker_unload.c
* | minor bugfix to casIntArray# and fetchAddIntArray#Ryan Newton2013-08-221-4/+6
| |
* | Eliminate atomic_inc_by and instead medofiy atomic_inc.Ryan Newton2013-08-213-3/+3
| |
* | Add PrimOp fetchAddIntArray# plus supporting C function atomic_inc_by.Ryan Newton2013-08-212-1/+14
| |
* | Add PrimOp: casIntArray#. Modify casMutVar# for 'ticketed' style.Ryan Newton2013-08-212-2/+23
| |
* | Update stg_casArrayzh to conform to new CMM conventions.Ryan Newton2013-08-211-9/+6
| |
* | Tweak stg_casArrayzh as per Simon Marlow's suggestion.Ryan Newton2013-08-211-6/+4
| |
* | add casArray# primop, similar to casMutVar# but for array elementsRyan Newton2013-08-212-0/+28
|/
* Add a missing untag to the non-updatable selector thunks (#7978)Simon Marlow2013-08-131-2/+2
|
* Fix bug in readMVar implementation: keep clean MVars clean.Edward Z. Yang2013-07-171-2/+2
| | | | | | | | | | The readMVar implementation had only partially implemented a micro-optimization which allows us to avoid adding an MVar to the mutable list if the MVar was not changed. However, this was not applied to the release method on the fast path, resulting in dirty MVars which were not added to the mutable list. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* adding FastString.string_table to the sharedCAF/Globals.c mechanismNicolas Frisby2013-07-162-2/+15
|
* Rename atomicReadMVar and friends to readMVar.Edward Z. Yang2013-07-123-18/+18
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement tryAtomicReadMVar#.Edward Z. Yang2013-07-102-0/+17
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Don't call dirty_MVAR on atomicReadMVar unless we change the MVar.Edward Z. Yang2013-07-101-4/+4
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Add LOCK_CLOSURE macro for use in C--, which inlines the capability check.Edward Z. Yang2013-07-101-48/+8
| | | | | | | | This patch also tweaks lockClosure to be INLINE_HEADER, so C-- clients don't accidentally use them and updates some other code which locks closures to do the capability check. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement atomicReadMVar, fixing #4001.Edward Z. Yang2013-07-0912-6/+122
| | | | | | | | | We add the invariant to the MVar blocked threads queue that threads blocked on an atomic read are always at the front of the queue. This invariant is easy to maintain, since takers are only ever added to the end of the queue. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix segfault with STM; fixes #8035. Patch from errge.Ian Lynagh2013-07-071-1/+13
|
* Fix build on Win64Ian Lynagh2013-07-021-11/+7
| | | | | | gcc thought that fourthFloating could be used without being defined. In actual fact it couldn't, but I've refactored the code so that it can now see this.
* Fix #7970, #2161, unfix #551Simon Marlow2013-07-021-48/+52
| | | | | | | | | | | Establish the reachability of threads before weak pointers. Hence a deadlocked thread can keep a weak pointer alive and prevent it from being finalized early. However, an reference from the finalizer of a weak pointer will no longer prevent a thread from being considered deadlocked (#551). To keep the thread alive in that situation you need to use a StablePtr. See comments on #7970 and in the code for more details.
* Fix dynlib paths in the RTS too; part of #7833Ian Lynagh2013-06-221-0/+1
|
* Ensure gc_type is StgWord8.Austin Seipp2013-06-211-1/+1
| | | | | | | Again, the range of gc_type is actually 1-3, which is technically outside the range of rtsBool. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Ensure gc_thread->wakeup is of type StgWord8.Austin Seipp2013-06-211-1/+1
| | | | | | | | | | rtsBool is defined to only have two inhabitants, which are true (1) and false (0) But the wakeup flag is set to 4 possible values, outside the range of rtsBool. This leads Clang to warn about tautological comparisons. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Don't use -finline-limit with Clang.Austin Seipp2013-06-211-0/+2
| | | | | | It's unsupported. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Initialize ptr to NULL to silence Clang warning.Austin Seipp2013-06-201-1/+1
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix rts/package.conf.in ld-options for Clang.Austin Seipp2013-06-201-78/+78
| | | | | | | | | Now with less Mac-breakage. With this change, I can get a working stage1/stage2 compiler using Clang 3.4svn, which can be used to link working executables! Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Re-untabify rts/packages.conf.inAustin Seipp2013-06-191-25/+25
| | | | Signed-off-by: Austin Seipp <aseipp@pobox.com>