aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
AgeCommit message (Collapse)Author
2015-03-20Erlang based BIF timer implementation for scalabilityRickard Green
2015-03-20Introduce a new time APIRickard Green
The old time API is based on erlang:now/0. The major issue with erlang:now/0 is that it was intended to be used for so many unrelated things. This tied these unrelated operations together and unnecessarily caused performance, scalability as well as accuracy, and precision issues for operations that do not need to have such issues. The new API spreads different functionality over multiple functions in order to improve on this. The new API consists of a number of new BIFs: - erlang:convert_time_unit/3 - erlang:monotonic_time/0 - erlang:monotonic_time/1 - erlang:system_time/0 - erlang:system_time/1 - erlang:time_offset/0 - erlang:time_offset/1 - erlang:timestamp/0 - erlang:unique_integer/0 - erlang:unique_integer/1 - os:system_time/0 - os:system_time/1 and a number of extensions of existing BIFs: - erlang:monitor(time_offset, clock_service) - erlang:system_flag(time_offset, finalize) - erlang:system_info(os_monotonic_time_source) - erlang:system_info(time_offset) - erlang:system_info(time_warp_mode) - erlang:system_info(time_correction) - erlang:system_info(start_time) See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
2015-03-20Merge branch 'nox/fix-port_info-race' into maintZandra Hird
* nox/fix-port_info-race: Fix a race condition when calling port_info/1 OTP-12587
2015-03-19erts: Silence valgrind warning in nif_SUITE.cSverker Eriksson
Hmm, seems like gcc (4.4.3 at least) can switch the order of an &&-expression and do the last condition first if it think it's more efficient (and without side effects I hope). Which led to valgrind complaining about 'prev_ret' being used uninitialized in this case.
2015-03-19erts: Fix bug in binary_to_term with more than one big mapSverker Eriksson
2015-03-18Fix a race condition when calling port_info/1Anthony Ramine
This variable hold the values returned by erlang:port_info/1 and shouldn't be static. Reported-by: Heinz Nikolaus Gies
2015-03-15Ensure NIF term creation disallows illegal valuesSteve Vinoski
Add a check to enif_make_double to see if its double argument is infinity or NaN, returning a badarg exception if it is. Change the erl_nif documentation to specify that enif_make_double returns a badarg exception if its double argument is either infinity or NaN. Add tests to nif_SUITE for this change. Add checks to the enif_make* functions for atoms to prevent the creation of atoms whose name lengths are greater than the allowed maximum atom length. The enif_make_atom and enif_make_atom_len functions now return a badarg exception if the input string is too long. The enif_make_existing_atom and enif_make_existing_atom_len functions return false if the input string is too long. Change the erl_nif documentation to reflect the changes to these functions. Add tests to nif_SUITE for these changes. Add a field to ErlNifEnv to track that a NIF has raised an exception via enif_make_badarg. If a NIF calls enif_make_badarg but then ignores its return value and instead tries to return a non-exception term as its return value, the runtime still raises a badarg. This is needed to prevent enif_make_badarg values resulting from calls to enif_make_double, enif_make_atom, or enif_make_atom_len from being erroneously stored within other terms and returned from a NIF. Calling enif_make_badarg but not returning its return value has been documented as being illegal ever since enif_make_badarg was added, but the runtime has not enforced it until now. Add tests for regular and dirty NIFs to ensure that calls to enif_make_badarg result in badarg exceptions even if a NIF fails to return the result of enif_make_badarg as its return value. Add documentation to enif_make_badarg to specify that calling it raises a badarg even if a NIF ignores its return value.
2015-03-13erts: Enhance maps ordering testsBjörn-Egil Dahlberg
2015-03-12erts: Fix nif API for hashmapsSverker Eriksson
2015-03-12erts: Enhance match spec tests for mapsBjörn-Egil Dahlberg
2015-03-12erts: Make is_members in map_SUITE's more stringentSverker Eriksson
2015-03-12erts: Fix maps testcase unordered enc/decBjörn-Egil Dahlberg
2015-03-12erts: Update map tests for unordered mapsBjörn-Egil Dahlberg
2015-03-12erts: Update tests for maps:merge/2 and erlang:map_size/1Björn-Egil Dahlberg
2015-03-12erts: Fix erlang:hash and erlang:phash for hamtSverker Eriksson
by calling make_hash2.
2015-03-12erts: Update build_and_check maps testcaseBjörn-Egil Dahlberg
2015-03-12erts: Extend tests of maps:merge/2Björn-Egil Dahlberg
2015-03-12erts: Test building and removing mapsBjörn-Egil Dahlberg
2015-03-12erts: Add tests for large maps:get/2 and maps:find/2Björn-Egil Dahlberg
2015-03-12erts: Remove hashmap from testsBjörn-Egil Dahlberg
2015-03-12erts: Improve map_SUITE:t_map_compareSverker Eriksson
2015-03-12erts: Change phash2 of maps to be sensitive to key-value combos.Sverker Eriksson
The old hashing did not care which value belonged to which key, for example: would hash the same.
2015-03-12erts: Add map_SUITE:t_map_compareSverker Eriksson
2015-03-12erts: Change to total ordering of keys in small mapsSverker Eriksson
2015-03-12Merge branch 'nox/maps-match_specs-fixes/OTP-12270'Björn-Egil Dahlberg
* nox/maps-match_specs-fixes/OTP-12270: erts: Strengthen maps match spec compilation tests Properly collect variables in match specs with maps Fix compilation of match specs with maps
2015-03-12Merge branch 'maint'Henrik Nord
Conflicts: erts/emulator/hipe/hipe_bif0.c
2015-03-12erts: Strengthen maps match spec compilation testsBjörn-Egil Dahlberg
2015-03-11Fix compilation of match specs with mapsAnthony Ramine
The previous compilation was just plain wrong with push/pop mismatches. Reported-by: Björn-Egil Dahlberg
2015-02-04don't create oversize bignums in binary matchingMikael Pettersson
Bignums are artifically restricted in size. Arithmetic and logical operations check the sizes of resulting bignums, and turn oversize results into system_limit exceptions. However, this check is not performed when bignums are constructed by binary matching. The consequence is that such matchings can construct oversize bignums that satisfy is_integer/1 yet don't work. Performing arithmetic such as Term - 0 fails with a system_limit exception. Worse, performing a logical operation such as Term band Term results in []. The latter occurs because the size checking (e.g. in erts_band()) is a simple ASSERT(is_not_nil(...)) on the result of the bignum operation, which internally is [] (NIL) in the case of oversize results. However, ASSERT is a no-op in release builds, so the error goes unnoticed and [] is returned as the result of the band/2. This patch addresses this by preventing oversize bignums from entering the VM via binary matching: - the internal bytes_to_big() procedure is augmented to return NIL for oversize results, just like big_norm() - callers of bytes_to_big() are augmented to check for NIL returns and signal errors in those cases - erts_bs_get_integer_2() can only fail with badmatch, so that is the Erlang-level result of oversize bignums from binary matches - big_SUITE.erl is extended with a test case that fails without this fix (no error signalled) and passes with it (badmatch occurs) Credit goes to Nico Kruber for the initial bug report.
2015-02-03trace_bif_SUITE: Ensure that a call to time/0 is not removedBjörn Gustavsson
Assigning the result of a BIF call to a variable used to be sufficient to prevent the call from being optimized away. With the more aggressive optimization that will be introduced in a future commit it will not be sufficient. Matching the return value will prevent the compiler from doing the optimization.
2014-12-19erts: Improve crash dumpsLukas Larsson
This commit improves crash dumps in several ways: * Suspends schedulers to get a current snapshot * Dumps information about scheduler * Dumps stack trace of current running process (including Garbing processes)
2014-11-26Merge branch 'maint'Sverker Eriksson
2014-11-26Merge branch 'sverk/port_get_data-race/OTP-12208' into maintSverker Eriksson
* sverk/port_get_data-race/OTP-12208: erts: Fix port data memory allocation bug
2014-11-25erts: Fix port data memory allocation bugSverker Eriksson
for non-immediate port data >= sizeof(Eterm)*2 words.
2014-11-10Merge branch 'maint'Bruce Yinhe
2014-11-10Merge branch 'vinoski/dirty-nif-return-gc' into maintBruce Yinhe
OTP-12300 * vinoski/dirty-nif-return-gc: Fix gc-related problem with dirty NIFs
2014-11-07Merge branch 'maint'Bruce Yinhe
2014-11-04Fix gc-related problem with dirty NIFsSteve Vinoski
Ensure that the return value from a dirty NIF call is made part of the GC rootset. Add a new regression test to nif_SUITE. Thanks to Daniel Goertzen for reporting the error and providing a test case, and to Sverker Eriksson for making test case reproducible and finding the fix.
2014-11-02Expose NIF versionPeter Lemenkov
This patch allows checking for NIF API version in a way similar to driver version. E.g. by calling erlang:system_info(nif_version). Signed-off-by: Peter Lemenkov <[email protected]>
2014-10-28Merge branch 'egil/nox/maps-match_specs/OTP-12270'Björn-Egil Dahlberg
* egil/nox/maps-match_specs/OTP-12270: erts: Fix return value from erts_maps_get to be const Properly support maps in match_specs Support maps in ms_transform Return pointer to value in erts_maps_get()
2014-10-28Merge branch 'maint'Lukas Larsson
* maint: Use isfinite() instead of finite() when available
2014-10-28Merge branch 'sv/isfinite/OTP-12268' into maintLukas Larsson
* sv/isfinite/OTP-12268: Use isfinite() instead of finite() when available
2014-10-28Use isfinite() instead of finite() when availableAnthony Ramine
OS X Mavericks builds result in a number of warnings about finite() being deprecated, like these: beam/erl_arith.c:451:7: warning: 'finite' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations] ERTS_FP_ERROR(p, f1.fd, goto badarith); ^ sys/unix/erl_unix_sys.h:319:33: note: expanded from macro 'ERTS_FP_ERROR' ^ sys/unix/erl_unix_sys.h:244:51: note: expanded from macro '__ERTS_FP_ERROR' ^ /usr/include/math.h:718:12: note: 'finite' has been explicitly marked deprecated here extern int finite(double) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA); Add checks to use isfinite() instead of finite() where available. Verified on OS X Mavericks 10.9.5 and Ubuntu 12.04.
2014-10-23Merge branch 'rickard/master/eager-check-io/OTP-12117'Rickard Green
* rickard/master/eager-check-io/OTP-12117: No eager check I/O on OSE Introduce support for eager check I/O scheduling
2014-10-23Merge branch 'rickard/maint-17/eager-check-io/OTP-12117' into maintRickard Green
* rickard/maint-17/eager-check-io/OTP-12117: No eager check I/O on OSE Introduce support for eager check I/O scheduling
2014-10-13Merge branch 'maint'Sverker Eriksson
2014-09-30erts: Add test case for port_set_data and port_get_dataSverker Eriksson
2014-09-25Merge branch 'rickard/maint-17/eager-check-io/OTP-12117' into ↵Rickard Green
rickard/master/eager-check-io/OTP-12117 * rickard/maint-17/eager-check-io/OTP-12117: No eager check I/O on OSE Introduce support for eager check I/O scheduling Conflicts: erts/preloaded/ebin/erlang.beam
2014-09-25Merge branch 'rickard/eager-check-io/OTP-12117' into ↵Rickard Green
rickard/maint-17/eager-check-io/OTP-12117 * rickard/eager-check-io/OTP-12117: Introduce support for eager check I/O scheduling Conflicts: erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_process.c erts/preloaded/ebin/erlang.beam
2014-09-25Introduce support for eager check I/O schedulingRickard Green