aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/nif_SUITE.erl
AgeCommit message (Collapse)Author
2019-02-06erts: Add test for bug in enif_make_maps_from_arraysSverker Eriksson
2018-08-03erts: Fix seq_trace to not clear token for system messagesLukas Larsson
A lot of erts internal messages used behind APIs to create non-blocking calls, e.g. port_command, would cause the seq_trace token to be cleared from the caller when it should not. This commit fixes that and adds asserts that makes sure that all messages sent have to correct token set. Fixes: ERL-602
2018-06-18Update copyright yearHenrik Nord
2018-05-17Merge PR-1819 from sverker/enif_binary_to_term-bug/OTP-15080Sverker Eriksson
Fix bug in enif_binary_to_term for immediates
2018-05-16erts: Fix bug in enif_binary_to_term for immediatesSverker Eriksson
Symptom: Heap corruption Expanded test case to provoke this bug and test some more term types.
2018-04-25Merge branch 'lukas/erts/poll-thread/OTP-14346'Lukas Larsson
* lukas/erts/poll-thread/OTP-14346: erts: nif resource stop from poll-thread is a indirect call
2018-04-24erts: nif resource stop from poll-thread is a indirect callLukas Larsson
2018-03-23Add enif_make_map_from_arraysJohn Högberg
2018-02-19Merge branch 'maint'John Högberg
2018-02-15Handle unaligned binaries in enif_inspect_iovecJohn Högberg
2017-12-08Merge pull request #1634 from bjorng/bjorn/get_stacktrace-syntax/OTP-14692Björn Gustavsson
Add syntax in try/catch to retrieve the stacktrace directly
2017-11-30Add enif_ioq_peek_headJohn Högberg
This introduces a way to retrieve erlang terms from NIF IO queues without having to resort to copying. OTP-14797
2017-11-30Use the new syntax in more test suitesBjörn Gustavsson
2017-10-02erts: enif_select steal testDmytro Lytovchenko
2017-09-06Merge branch 'maint' into john/erts/merge-zlib-and-vector-qJohn Högberg
2017-09-05erts: Add nif ioqLukas Larsson
2017-07-25Merge branch 'maint'Sverker Eriksson
2017-07-17Fix testcases after removal of non-smp emulatorLukas Larsson
2017-07-11erts: Fix bug in enif_whereis_pid/portSverker Eriksson
that could cause heap corruption if whereis lookup conflicts with other register updater AND other thread sends on-heap message while main lock is released. Also improved enif_whereis from dirty nifs by passing c_p as NULL.
2017-06-09Merge pull request #1400 from tburghart/trb/erts/enif_whereisRickard Green
Add enif_whereis_pid() and enif_whereis_port() functions OTP-14453
2017-05-23erts: Reduce runtime for nif_SUITE hash testsSverker Eriksson
and base allowed hash deviation on nr of standard deviations to make it easier to fiddle with the work load.
2017-05-23erts: Improve message flush in nif_SUITESverker Eriksson
Pass number of expected messages in order to wait longer for messages (for slow machines) while not wasting test time waiting for nothing.
2017-05-23erts: Test monitor resource destructor from threadSverker Eriksson
which is scheduled on non-smp VM.
2017-05-22Add enif_whereis_...() functionsTed Burghart
#### Why do we need this new feature? There are cases when a NIF needs to send a message, using `enif_send()`, to a long-lived process with a registered name. A common use-case is logging, where asynchronous fire-and-forget messages are the norm. There can also be cases where a yielding or dirty NIF or background thread may request a callback from a service with additional information it needs to complete its operation, yielding or waiting (with suitable timeouts, etc) until its state has been updated through the NIF module's API. NIFs can only send messages to pids, and the lack of name resolution leaves a complicated dance between separate monitoring processes and the NIF as the only way to keep a NIF informed of the whereabouts of such long-lived processes. Providing a reliable, built-in facility for NIFs to resolve process (or port) names simplifies these use cases considerably. #### Risks or uncertain artifacts? Testing has not exposed any significant risk. The implementation behaves as expected on regular and dirty scheduler threads as well as non-scheduler threads. By constraining the `enif_whereis_...()` functions to their minimal scopes and using patterns consistent with related functions, the implementation, testing, and maintenance burden is low. The API and behavior of existing functions is unchanged. #### How did you solve it? While extending `enif_send()` to operate on a pid or an atom (as `erlang:send/2` does) was attractive, it would have entailed changing the type of its `to_pid` parameter and thereby breaking backward compatibility. The same consideration applies to `enif_port_command()`. That leaves a choice between 1, 2, or 3 new functions: 1. `enif_whereis()` 2. `enif_whereis_pid()` and `enif_whereis_port()` 3. All of the above. While option (1), directly mimicking the behavior of `erlang:whereis/1`, is appealing, it poses potential problems if `pid()` or `port()` are subsequently implemented as non-integral types that must be bound to an owning `ErlNifEnv` instance. Therefore, option (2) has been chosen to use `ErlNifPid`/`ErlNifPort` structures in the API to maintain proper term ownership semantics.
2017-05-04Update copyright yearRaimo Niskanen
2017-04-24erts: Discontinue salted use of enif_hash/phash2Guilherme Andrade
2017-04-22erts: Add test cases for salted enif_hash callsGuilherme Andrade
2017-04-22erts: Support custom salt in enif_hashGuilherme Andrade
2017-04-20erts: Refactor enif_phash2 into enif_hashGuilherme Andrade
A more generic hashing function which can also hash terms based on `make_internal_hash'.
2017-04-20erts: Fix random floats in enif_phash2 testsGuilherme Andrade
2017-04-20erts: Remove enif_phash2_rangedGuilherme Andrade
2017-04-19erts: Add enif_phash2 and enif_phash2_rangedGuilherme Andrade
These allow one to hash VM terms from NIF code.
2017-02-22Fix nif_SUITE:select for old linuxSverker Eriksson
with pipe capacity equal to PIPE_BUF meaning pipe must be empty to be writable.
2017-02-20erts: Skip nif_SUITE:select on windowsSverker Eriksson
for now...
2017-02-20Expand nif_SUITE:monitor_frenzy to verify dtor callsSverker Eriksson
2017-02-20Expand nif_SUITE:monitor_frenzy with binary_to_termSverker Eriksson
to provoke resource revival race.
2017-02-20Merge branch 'master' into sverker/enif_selectSverker Eriksson
Conflicts: erts/emulator/beam/erl_binary.h erts/emulator/beam/erl_monitors.c erts/emulator/beam/erl_nif.c erts/emulator/beam/global.h erts/emulator/test/nif_SUITE_data/nif_SUITE.c
2017-02-20erts: Add enif_compare_monitorsSverker Eriksson
# Conflicts: # erts/emulator/test/nif_SUITE_data/nif_SUITE.c
2017-02-09erts: Change return value for enif_selectSverker Eriksson
to negative int as error and positive as success.
2017-02-09erts: Add pid argument to enif_selectSverker Eriksson
2017-02-09erts: Add enif_monitor_process and enif_demonitor_processSverker Eriksson
2017-02-06Use magic refs for NIF resourcesRickard Green
2017-02-03Merge branch 'master' into sverker/enif_selectSverker Eriksson
2017-01-12Reduction counting on non-tail returnRickard Green
2017-01-09nif_SUITE: Send message from stop callbackSverker Eriksson
2016-12-19Add ErlNifSelectReturnSverker Eriksson
2016-12-19nif_SUITE: Add last_fd_stop_callSverker Eriksson
2016-12-19erts: Add testing + some minor fixesSverker Eriksson
2016-11-30erts: Add enif_select & enif_open_resource_type_xSverker Eriksson
2016-11-25erts: Fix code_SUITE:api_2_0,upgrade crash on win64Sverker Eriksson