Opened 9 months ago

Last modified 6 months ago

#8097 infoneeded bug

internal error: getMBlock: mmap: Operation not permitted

Reported by: singpolyma Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.2
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Runtime crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I get the following:

<interactive>: internal error: getMBlock: mmap: Operation not permitted
    (GHC version 7.4.2 for i386_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Aborted (core dumped)

when running

parseOnly queryKeyParse (Data.Text.pack "hello")

where:

queryKeyParse :: Attoparsec.Parser [T.Text]
queryKeyParse = do
   top <- Attoparsec.takeTill (=='[')
   keys <- many key
   return (top:keys)
   where
   key = many (Attoparsec.char '[') *>
      Attoparsec.takeTill (==']') <* many (Attoparsec.char ']')

Attachments (1)

log.txt (44.2 KB) - added by SirReal 6 months ago.
strace log

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 months ago by rwbarton

Looks like the same issue as #7500, but more info may be useful anyways. What distro are you running and what is the value in /proc/sys/vm/mmap_min_addr?

comment:2 Changed 6 months ago by SirReal

I've experienced this as well:

internal error: getMBlock: mmap: Operation not permitted
    (GHC version 7.4.2 for i386_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Aborted (core dumped)

value in /proc/sys/vm/mmap_min_addr : 65536

Here's the code that caused it:

import Data.Ratio
import Data.List

limit :: Integer
limit = 1000000

main :: IO()
main = print $ "The solution is: " ++ show (countUniques allFractions)

allFractions :: [Ratio Integer]
allFractions = [x % y | y <- [1..limit], x <- [1..y-1]]

countUniques :: Ord a => [a] -> Int
countUniques = length . group . sort

comment:3 follow-up: Changed 6 months ago by ezyang

  • Status changed from new to infoneeded

Can you reproduce on 7.6?

comment:4 follow-up: Changed 6 months ago by rwbarton

Hmm, interesting. I couldn't reproduce with GHC 7.4.2 on Debian Linux 2.6.32-5-686 (mmap_min_addr = 65536). How are you building your program (e.g., are you using -O2)? What kernel version are you running (uname -a)? And can you run your program under strace:

strace -e trace=mmap2 -o log ./countUniques

and attach the last page or so of log to this ticket?

I'm 95% sure that in HEAD, you will get an out of memory error rather than this "Operation not permitted" error, but I'd like to understand what's going on here.

Last edited 6 months ago by rwbarton (previous) (diff)

comment:5 in reply to: ↑ 3 Changed 6 months ago by SirReal

Replying to ezyang:

Can you reproduce on 7.6?

I've tested the same code on another machine with 7.6 with no problem. I don't really have time to install 7.6 on the original machine right now.

Changed 6 months ago by SirReal

strace log

comment:6 in reply to: ↑ 4 Changed 6 months ago by SirReal

Replying to rwbarton:

Hmm, interesting. I couldn't reproduce with GHC 7.4.2 on Debian Linux 2.6.32-5-686 (mmap_min_addr = 65536). How are you building your program (e.g., are you using -O2)? What kernel version are you running (uname -a)? And can you run your program under strace:

strace -e trace=mmap2 -o log ./countUniques

and attach the last page or so of log to this ticket?

I'm 95% sure that in HEAD, you will get an out of memory error rather than this "Operation not permitted" error, but I'd like to understand what's going on here.

The build was: ghc -Werror -Wall -O2
I've attached the end of the log.

Note: See TracTickets for help on using tickets.