erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.38k stars 2.95k forks source link

ERL-243: file:open() returns 'error' #3441

Closed OTP-Maintainer closed 3 years ago

OTP-Maintainer commented 8 years ago

Original reporter: kzemek Affected version: OTP-19.0.2 Component: kernel Migrated from: https://bugs.erlang.org/browse/ERL-243


We've encountered a case where 19.0.5's {{file:open()}} returns an {{error}} atom - not \{error, Reason\}. Unfortunately I don't have a simple repro. We're encountering the bug while running cover on [onedata/ctool project|https://github.com/onedata/ctool/tree/b918597e72e97d41b7d351a803630130b677f76e]. The cover fails with case_clause when [matching {{file:open()}} result|https://github.com/erlang/otp/blob/OTP-19.0.5/lib/tools/src/cover.erl#L2520].

The error can be reproduced by running {{make deps compile eunit}} with \{cover_enabled, true\} uncommented in rebar.conf . The project has quite a few dependencies (and quite a few build-deps) but for test purposes you can remove all but meck, n2o, jiffy, parse_trans and annotations (the tests will fail, but the issue will be reproduced). Alternatively, you can use onedata/builder docker which has all of the dependencies installed (be advised that it's not lightweight, though).

I've reproduced the bug on Ubuntu 16.04, Ubuntu 15.10 (with Erlang 18.3) and OS X 10.11.6.

Note: I'm resubmitting the issue on bugs.erlang.org after sending a mail to erlang-bugs list ~10 days ago.
OTP-Maintainer commented 8 years ago

bjorn said:

I failed to reproduce the problem you described, but I encountered many other problems...

I will need much clearer instructions to make any progress.

Please create a branch of the ctool project where you have made all the modifications you mentioned above (removing dependencies, enabling cover etc) so that I only have to run a single command to reproduce the bug.
OTP-Maintainer commented 8 years ago

bjorn said:

Open a new issue if you can provide clearer instructions for how to reproduce.