[erlang-questions] Half word emulators and NIFs

Paolo Negri paolo.negri@REDACTED
Mon Jun 27 11:30:44 CEST 2011

Dear list,

We're running some test using the half word emulator and we're seeing
few regressions.
Our application runs with no problem on 32 and 64 VMs and regressions
are specific to this emulator.
While we're still looking at shrinking the broken test in order to
identify exactly the failure, so far it seems - but we're not sure yet
- that regressions are due to some interaction with a NIF [1]
The behavior we're observing is that function clauses in pure erlang
code (code not involving NIF calls) stop matching after the invocation
of such a NIF.
So far we couldn't build very simple ad hoc test cases to reproduce
the failure, while more elaborated ones part of our application tests
are consistent and always fail (while always pass using plain 32 or 64
bit VMs).
All function clauses that we seem to "lose" are very simple matches
like integers and atoms.
What I would like to ask is

- Is it possible for a NIF to somehow break such basic features of the
VM because of the NIF non compliance with the half word machine?
- How is it possible to recognize if a NIF is or not safe to be used
with the half word emulator?

While cutting out the minimal piece of code to reproduce the failure
in order to publish it might take us some time, we're open to provide
access to an environment where is possible to consistently reproduce
the failure if someone is interested into looking into this matter.

[1] https://github.com/davisp/jiffy

Thanks in advance for your answers,


More information about the erlang-questions mailing list