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

Test suite fails with OTP 21.2 #1837

Closed
jaydoane opened this issue Dec 28, 2018 · 4 comments
Closed

Test suite fails with OTP 21.2 #1837

jaydoane opened this issue Dec 28, 2018 · 4 comments

Comments

@jaydoane
Copy link
Contributor

jaydoane commented Dec 28, 2018

When we upgrade .travis.yml otp_release from 21.1 to 21.2, we get a test failure. On closer examination, it looks like a nif is crashing the BEAM.

Expected Behavior

make javascript should pass

Current Behavior

make javascript fails with:

test/javascript/tests/config.js                                Error: 
FAIL isRunning
Stacktrace:
	waitForSuccess((function () {CouchDB.last_req = CouchDB.request("GET", "/");return typeof CouchDB.last_req == "object";}),"isRunning")@test/javascript/test_setup.js:64
	@test/javascript/cli_runner.js:46
Failed to execute script.
fail

However, when run on it's own make javascript suites=config passes, as does make javascript suites=compact. However, looking at the couch logs for the latter, there is this suspicious entry:

nifs/common/prim_file_nif.c:388:[notice] 2018-12-28T07:41:03.834726Z node1@127.0.0.1 <0.3868.0> aaa8c4d9b0 127.0.0.1:15984 127.0.0.1 undefined DELETE /test_suite_db_lvxwriai/?sync=true 200 ok 10
owner_death_callback(): Internal error: Failed to defer prim_file close.

My hypothesis is that during the full suite run, the nif crashes the BEAM at the end of compact.js after it passes, but then config.js fails to run because the db process crashed from the previous test.

Possible Solution

Steps to Reproduce (for bugs)

  1. Install OTP 21.2 (currently brew install erlang will do that on a mac)
  2. make javascript

Context

Discovered when attempting to upgrade .travis.yml but reproducible locally on a mac.

Your Environment

  • Version used: latest development master
  • Browser Name and version: N/A
  • Operating System and version (desktop or mobile): macos 10.13.6
  • Link to your project:
@jaydoane
Copy link
Contributor Author

I checked the release notes for 21.2., and didn't see anything obviously related to changes in nifs.

@nickva
Copy link
Contributor

nickva commented Dec 30, 2018

I wonder if it is this commit:

erlang/otp@d15bd6b#diff-2d07be10f253f2c53640f98f104b3f23

It landed in the 21.1.x series sometimes in Nov 13. 21.1 was released in Sep.

The crashing line is:

erlang/otp@d15bd6b#diff-2d07be10f253f2c53640f98f104b3f23R387

enif_send say that it either fails if calling env process is dead or the that prim_file (the destination) is dead. I suspect it is the sending process that's dead. But then also wonder how come it wasn't crashing in routine tests, as a process with an open handle dying would trigger this issue...

http://erlang.org/doc/man/erl_nif.html#enif_send

@nickva
Copy link
Contributor

nickva commented Jan 2, 2019

Confirmed it's an Erlang/OTP bug. Filed it as: https://bugs.erlang.org/browse/ERL-821

@wohali
Copy link
Member

wohali commented Jan 24, 2019

This is resolved - you need a minimum of 21.2.3 for the 21.2 series.

@wohali wohali closed this as completed Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants