Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot dereference 0x1401000: Exceeded higher bound of the address space. #845

Closed
rahulmutt opened this issue Aug 13, 2018 · 1 comment
Closed

Comments

@rahulmutt
Copy link
Member

Description

Running the following program (needs dependency on criterion):

import Criterion.Main

-- The function we're benchmarking.
fib m | m < 0     = error "negative!"
      | otherwise = go m
  where
    go 0 = 0
    go 1 = 1
    go n = go (n-1) + go (n-2)

-- Our benchmark harness.
main = defaultMain [
  bgroup "fib" [ bench "1"  $ whnf fib 1
               , bench "5"  $ whnf fib 5
               , bench "9"  $ whnf fib 9
               , bench "11" $ whnf fib 11
               ]
  ]

throws an exception.

Expected Behavior

Should run showing all the benchmark results without crashing.

Actual Behavior

benchmarking fib/1
time                 6.925 ns   (6.734 ns .. 7.256 ns)
                     0.993 R²   (0.987 R² .. 0.998 R²)
mean                 6.935 ns   (6.764 ns .. 7.239 ns)
std dev              480.5 ps   (230.3 ps .. 780.5 ps)
variance introduced by outliers: 84% (severely inflated)

benchmarking fib/5
Exception in thread "Thread-8" eta.runtime.exception.EtaException: JException java.lang.IllegalArgumentException: Cannot dereference 0x2401000: Exceeded higher bound of the address space.
    at eta.runtime.thunk.Thunk.handleExceptionSimple(Thunk.java:282)
    at eta.runtime.thunk.Thunk.handleException(Thunk.java:264)
    at eta.runtime.thunk.UpdatableThunk.evaluate(UpdatableThunk.java:21)
    at statistics.statistics.Regression$$wrnfAll$1.applyN(Regression.hs:-1)
    at statistics.statistics.Regression$sat$37.applyV(Regression.hs:136)
    at eta.runtime.exception.Exception.catch_(Exception.java:132)
    at statistics.statistics.Regression$sat$36.applyV(Regression.hs:-1)
    at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:125)
    at eta.runtime.stg.Capability.schedule(Capability.java:183)
    at eta.runtime.concurrent.WorkerThread.run(WorkerThread.java:16)

Possible Fix

This is most likely due to a race condition in the MemoryManager. Running the above several times caused the exception to occur at different times with different addresses.

Steps to Reproduce

  1. Create a simple Etlas project with an executable component that depends on criterion putting the code mentioned above in Main.hs.
  2. etlas run [exe-name] -- --output result.html

Context

I was trying to get criterion to work out so we can setup benchmarks.

Your Environment

  • Did you install an older version of Eta/Etlas before? Yes
  • Current Eta & Etlas version: latest
  • Operating System and version: OS X 10.11.5
  • Link to your project: N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant