#5838: integer overflow in rts/RtsUtils:heapOverflow()
-----------------------------------------+----------------------------------
Reporter: hvr | Owner:
Type: bug | Status: new
Priority: normal | Component: Runtime System
Version: 7.2.2 | Keywords:
Os: Unknown/Multiple | Architecture: x86_64 (amd64)
Failure: Incorrect result at runtime | Testcase:
Blockedby: | Blocking:
Related: |
-----------------------------------------+----------------------------------
Comment(by hvr):
Unless I've forgotten everything about C99, the following untested(!)
modification should fix it:
{{{
#!diff
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c
index e04b984..b880f8c 100644
--- a/rts/RtsUtils.c
+++ b/rts/RtsUtils.c
@@ -130,7 +130,7 @@ heapOverflow(void)
{
/* don't fflush(stdout); WORKAROUND bug in Linux glibc */
OutOfHeapHook(0/*unknown request size*/,
- RtsFlags.GcFlags.maxHeapSize * BLOCK_SIZE);
+ (lnat)RtsFlags.GcFlags.maxHeapSize * BLOCK_SIZE);
heap_overflow = rtsTrue;
}
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5838#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs