dhall-lang / dhall-json

This repository has moved to https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-json
BSD 3-Clause "New" or "Revised" License
65 stars 6 forks source link

OOM killed when using headers with file with relative import #60

Closed reactormonk closed 5 years ago

reactormonk commented 5 years ago

Reproduce:

Download https://gist.github.com/reactormonk/a8192fe784608f1f7515d5583c448095

dhall-to-yaml < local.dhall

Enjoy OOM!

Gabriella439 commented 5 years ago

I can reproduce:

$ dhall <<< 'https://gist.githubusercontent.com/reactormonk/a8192fe784608f1f7515d5583c448095/raw/d46f5b9aea9eb56c4bdd92d187936ee87e9f4cf2/local.dhall'
<Ctrl-C>
...

↳ https://gist.githubusercontent.com/reactormonk/a8192fe784608f1f7515d5583c448095/raw/d46f5b9aea9eb56c4bdd92d187936ee87e9f4cf2/local.dhall
  ↳ https://gist.githubusercontent.com/reactormonk/a8192fe784608f1f7515d5583c448095/raw/e8e5b14c2afe9acc342fe111bcf6e09b90dced9c/test.dhall using ./headers
    ↳ https://gist.githubusercontent.com/reactormonk/a8192fe784608f1f7515d5583c448095/raw/e8e5b14c2afe9acc342fe111bcf6e09b90dced9c/headers

↳ https://gist.githubusercontent.com/reactormonk/a8192fe784608f1f7515d5583c448095/raw/d46f5b9aea9eb56c4bdd92d187936ee87e9f4cf2/local.dhall
  ↳ https://gist.githubusercontent.com/reactormonk/a8192fe784608f1f7515d5583c448095/raw/e8e5b14c2afe9acc342fe111bcf6e09b90dced9c/test.dhall using ./headers
    ↳ https://gist.githubusercontent.com/reactormonk/a8192fe784608f1f7515d5583c448095/raw/e8e5b14c2afe9acc342fe111bcf6e09b90dced9c/headers

I'm investigating why

Gabriella439 commented 5 years ago

Oh, so the issue here is due to custom headers being used to configure their own import, which triggers an infinite recursion. Let me see if this is simple to fix

Gabriella439 commented 5 years ago

I found the bug. The fix is up here: https://github.com/dhall-lang/dhall-haskell/pull/618

reactormonk commented 5 years ago

Could you cut a new binary release?

Gabriella439 commented 5 years ago

@reactormonk: We're not ready to cut a release yet because there are some in-flight changes to the standard. However, you can download a prerelease build of dhall-json from here:

http://hydra.dhall-lang.org/job/dhall-json/master/tarball/latest