aboutsummaryrefslogtreecommitdiffstats
path: root/erts
AgeCommit message (Collapse)Author
2016-01-13erts: Move copy_literals/2 from erlang to erts_internalSverker Eriksson
as it's not a public interface.
2016-01-13erts: Make erlang:purge_module/1 safeSverker Eriksson
Problem: erlang:purge_module/1 is not safe in the sense that very bad things may happen if the code to be purged is still referred to by live processes. Introduce erts_internal:purge_module which is the same as the old erlang:purge_module BIF (except it returns false if no such old module). Implement erlang:purge_module in Erlang and let it invoke erts_code_purger for safe purging where all clogging processes first are killed.
2016-01-13Merge branch 'sverk/fvisibility-hidden/OTP-13227'Sverker Eriksson
* sverk/fvisibility-hidden/OTP-13227: erts: Allow -fvisibility=hidden for NIFs and drivers erts: Cleanup erl_driver.h for windows erts: Refactor ERL_NIF_INIT macro
2016-01-13erts: Refactor code:purge/1 and code:soft_purge/1Sverker Eriksson
by moving code from code_server to erts_code_purger. This is more or less a copy-paste from code_server.erl to erts_code_purger.erl. All the inner mechanics of code:purge/1 and code:soft_purge/1 are unchanged.
2016-01-13erts: Introduce erts_code_purgerSverker Eriksson
as a system process with preloaded code.
2016-01-11erts: Workaround memset bug in test caseSverker Eriksson
memset seen to fail with values larger than 255 on (armata) 32-bit ARM Debian with EGLIBC 2.13-38+rpi2+deb7u8 and gcc 4.6.3-14+rpi1.
2016-01-08erts: Allow -fvisibility=hidden for NIFs and driversSverker Eriksson
as is strongly recommended by gcc man page. We use __attribute__ ((visibility("default"))) to make sure the init functions are properly exported.
2016-01-08erts: Cleanup erl_driver.h for windowsSverker Eriksson
The comment is misleading and no need to "export" static windows drivers. DRIVER_INIT for dynamic windows drivers is defined in erl_win_dyn_driver.h
2016-01-08erts: Refactor ERL_NIF_INIT macroSverker Eriksson
2016-01-07Merge branch 'sverk/proc-dict-opt'Sverker Eriksson
OTP-13167 * sverk/proc-dict-opt: erts: Add new test case pdict_SUITE:mixed erts: Add 'fill_heap' to erts_debug:state_internal_state erts: Rename proc dict size to arraySize erts: Refactor proc dict with 'usedSlots' erts: Add sizeMask for faster proc dict indexing erts: Remove ProcDict.used erts: Add proc dict macros ERTS_PD_START/SIZE erts: Optimize away function "array_put" in proc dict erts: Optimize hashing in process dictionary
2016-01-07Merge branch 'sverk/hipe-mmap-config'Sverker Eriksson
* sverk/hipe-mmap-config: erts: Add config test for MAP_NORESERVE for hipe on 64-bit
2016-01-07erts: Add config test for MAP_NORESERVE for hipe on 64-bitSverker Eriksson
to get a nicer error on FreeBSD and others that does not support MAP_NORESERVE for mmap. Q: How to support this? A: Implement the "literal tag" in hipe or another way to reserve virtual address space in erl_mmap.c
2016-01-07Merge branch 'sverk/float_SUITE-arith'Sverker Eriksson
* sverk/float_SUITE-arith: erts: Add new test cases to float_SUITE
2016-01-07Merge branch 'sverk/check_process_code-fix'Sverker Eriksson
* sverk/check_process_code-fix: erts: Fix bug in check_process_code for literals
2015-12-30Merge branch 'maint'Rickard Green
* maint: Light weight statistics of run queue lengths Conflicts: erts/preloaded/ebin/erlang.beam
2015-12-30Merge branch 'rickard/rq-len/OTP-13201' into maintRickard Green
* rickard/rq-len/OTP-13201: Light weight statistics of run queue lengths
2015-12-30Light weight statistics of run queue lengthsRickard Green
- statistics(total_run_queue_lengths) - statistics(run_queue_lengths) - statistics(total_active_tasks) - statistics(active_tasks) Conflicts: erts/emulator/beam/erl_process.c
2015-12-30Merge branch 'maint'Rickard Green
* maint: Use monotonic time for call_time trace
2015-12-30Merge branch 'rickard/trace_call_time/OTP-13216' into maintRickard Green
* rickard/trace_call_time/OTP-13216: Use monotonic time for call_time trace
2015-12-30Merge branch 'rickard/ohmq-fixup/OTP-13047'Rickard Green
* rickard/ohmq-fixup/OTP-13047: Fix asynchronous BIF timer cancellation message reply
2015-12-30Fix HL timer hard debug implementationRickard Green
2015-12-30Fix stack alignment problem in ethread test on armRickard Green
2015-12-30Skip time_SUITE:timestamp on timewarp testRickard Green
2015-12-29Fix asynchronous BIF timer cancellation message replyRickard Green
2015-12-28Merge branch 'maint'Zandra
2015-12-28Merge branch 'binarin/maint' into maintZandra
* binarin/maint: Don't wait for twice the delay_write timeout OTP-13220
2015-12-23Use monotonic time for call_time traceRickard Green
2015-12-21Do not allow aux work on dirty schedulersSteve Vinoski
The nature of aux work is such that dirty schedulers should not attempt to perform it. Modify the code to ensure that dirty schedulers avoid aux work. Also fix an incorrect assumption about the size of a Uint in the ErtsDirtySchedId type.
2015-12-20efile_drv: logic error in compressed file writeMikael Pettersson
Compiling OTP 18.2.1 with gcc-5.3 shows the following warning: drivers/common/efile_drv.c:1538:23: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] The code in question is: if (! (status = erts_gzwrite((ErtsGzFile)d->fd, iov[i].iov_base, iov[i].iov_len)) == iov[i].iov_len) { d->errInfo.posix_errno = d->errInfo.os_errno = errno; /* XXX Correct? */ break; } If we hoist the assignment out of the if for clarity, it becomes: status = erts_gzwrite(..., iov[i].iov_len); if (! status == iov[i].iov_len) { ...; break; } iov_len is > 0 here, and status will equal iov_len if erts_gzwrite succeeded, but will be less than iov_len if an error occurred. "! status" is 0 or 1, which can only equal iov_len if iov_len is 1 and erts_gzwrite detected an error and returned 0. The effect of this mistake is that any error when iov_len >= 2 will skip the conditional code and break statement. In particular, partial writes (0 < status && status < iov_len) will not be flagged as errors. All releases since OTP R8B-0 are affected. The variable "status" is really a boolean, which is to be set to zero on error. The fix is to set status to 1 if erts_gzwrite() returned iov_len and 0 otherwise, and to change the condition to "if (! status) ...". I'm also hoisting the assignment out of the condition since it obscures the code while providing not benefit (the condition in a while or for loop would be a different matter).
2015-12-18Merge branch 'lv/fix-compilation-with-vm-probes/OTP-13209'Björn-Egil Dahlberg
* lv/fix-compilation-with-vm-probes/OTP-13209: Fix compilation with `--enable-vm-probes`
2015-12-18Merge branch 'maint'Henrik Nord
Conflicts: OTP_VERSION erts/vsn.mk
2015-12-18Merge branch 'rickard/ohmq-fixup/OTP-13047'Rickard Green
* rickard/ohmq-fixup/OTP-13047: Fix offset_mqueue
2015-12-17Update release notesErlang/OTP
2015-12-17Update version numbersErlang/OTP
2015-12-17Merge branch 'jj1bdx/jj1bdx-18.2-freebsd-hipe-fix-2' into maintErlang/OTP
* jj1bdx/jj1bdx-18.2-freebsd-hipe-fix-2: hipe_x86_signal.c: add FreeBSD sigaction code
2015-12-17Revert "Fix erroneous splitting of emulator path"Björn-Egil Dahlberg
This reverts commit 731890f3b4ac62eed1221aa7d9fd2bfa6bf51d8c.
2015-12-17hipe_x86_signal.c: add FreeBSD sigaction codeKenji Rikitake
* erts/emulator/hipe/hipe_x86_signal.c: add FreeBSD sigaction code, based on the Darwin (OS X) code
2015-12-16Update preloaded modulesBjörn Gustavsson
2015-12-16erl_prim_loader doc: Remove mention of user supplied loaderBjörn Gustavsson
Custom loaders are no longer supported. Most of the documentation for them were removed in c8a7d2d7.
2015-12-16erl_prim_loader: Clean up string_match()Björn Gustavsson
Part of the return value for string_match/3 is not used by its only caller. Eliminate the unused part of the return value and the accumulator argument for string_match().
2015-12-16erl_prim_loader: Avoid making absolute pathsBjörn Gustavsson
We don't need absolute paths unless we are dealing with archives. Since it is not free to turn a relative path absolute (we will need a call to prim_file to fetch the current directory), it's better to delay the call to absname/1 until we are sure it's needed.
2015-12-16erl_prim_loader: Clean up splitting of filenamesBjörn Gustavsson
2015-12-16init: Eliminate the concat/1 functionBjörn Gustavsson
There is no need to use the concat/1 function since all arguments that are passed to it have known types.
2015-12-16Clean up start of erl_prim_loaderBjörn Gustavsson
The 'init' module fetches command line parameters and passes them to erl_prim_loader:start/3. The code can be simplified if 'init' calls a new erl_prim_loader:start/0 function that itself fetches the necessary command line parameters. Also remove the documentation for the start() function, since it there is no way that it can be usefully called by a user application. While we are at it, also get rid of '-id' command line parameter, which is fetched and stored but never actually used.
2015-12-16Remove erl_prim_loader:get_files/2Björn Gustavsson
erl_prim_loader:get_files/2 was an optimization introduced before the SMP emulator (that is, before R11). The idea was to use the async threads in the efile driver to read multiple BEAM files from the disk in parallel. In a modern computer with the SMP emulator, loading a BEAM module seems to be more time-consuming than reading it from disk. To optimize loading we would need to load several modules in parallel. We could modify get_files/2 so that it would support parallel loading, but it is cleaner to first remove get_files/2 and then (in a future commit), introduce new functions to support parallel loading.
2015-12-16erl_prim_loader: Remove code for handling OSEBjörn Gustavsson
2015-12-16erl_prim_loader: Break loop/3 into two functions for readabilityBjörn Gustavsson
The deep indentation makes loop/3 difficult to read and maintain. Break out the request handling code into a separate function.
2015-12-16prim_file: Suppress a dialyzer warningBjörn Gustavsson
Kostis Sagonas pointed out that there is a dialyzer warning for constructing an improper list in the following clause: translate_response(?FILE_RESP_N2DATA = X, [<<_:64, _:64, _:64>> | <<>>] = Data) -> {error, {bad_response_from_port, [X | Data]}}; I don't want to change the code to somehow eliminate the warning. An improper list has already been constructed in the efile driver itself, and that would be difficult to fix. Therefore, tell dialyzer to ignore warnings for improper lists in translate_response/2.
2015-12-16Reduce the ludicrous number of arguments for eval_script()Björn Gustavsson
The compact wall of arguments makes it hard to see what is actually happening in eval_script(). Collect the arguments into a record.
2015-12-16Clean up handling of boot_varsBjörn Gustavsson
Expansion of $ROOT in paths are handled specially compared to boot variables. There is no reason $ROOT can't be handled as a boot variable. We can simplify the expansion of boot variables if we spend a little extra effort upfront collecting all boot variables into a map. Make the error checking for -boot_var arguments stricter. Only allow -boot_var followed by exactly two arguments to help users catch errors earlier.