co-dan / interactive-diagrams

Interactive-diagrams
39 stars 2 forks source link

Error reporting for permission violations is somewhat misleading #8

Open co-dan opened 11 years ago

co-dan commented 11 years ago

For example, if we try to execute the following code

module Main where

main = do
  putStrLn "hi there"
  writeFile "/home/vagrant/www" "hello"
  return 3

The following will be printed to stdout:

evali: /home/vagrant/www: openFile: permission denied (Permission denied)

And the result will be:

Deserialization error:
too few bytes
From:   demandInput

Exit status was: Exited (ExitFailure 1)

checked on: https://github.com/co-dan/interactive-diagrams/tree/3129ad6780b08fc52acf504f74d11ed4acefe70d

co-dan commented 11 years ago

A simpler example could be:

error "test" :: ()

resulting in:

evali: test
Deserialization error:
too few bytes
From:   demandInput

Exit status was: Exited (ExitFailure 1)
co-dan commented 10 years ago

https://github.com/co-dan/interactive-diagrams/commit/e9786b4c2f8f5146110559399944c5de4aaac3ac and https://github.com/co-dan/interactive-diagrams/commit/3fc9d24373dd8185ddbed34749aefcb8bda269a8

co-dan commented 10 years ago

Async out of memory exceptions can not be caught: http://www.reddit.com/r/haskell/comments/1i5coe/catching_all_exceptions_school_of_haskell/cb1qhcs

comments from luite: if you set rlimits, the syscall will return some value, perhaps we can trap the syscall and track the value somehow on a lower level