aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
AgeCommit message (Collapse)Author
2016-10-18Code cleanup to remove confusing assertionKostis Sagonas
The code of add_ref/6 contained an assertion that somehow appeared twice. Also, a recent commit (2b2de61) suppressed an unmatched return warning in a non-optimal way. By changing the return type of hipe_bifs:add_ref/2 to be 'ok' instead of [] the code can be cleaned up and simplified. While at it, fixed the wrong indentation of some nearby code.
2016-10-17Clarify permission bits in file.xmlMagnus Henoch
In commit 3d70cee4034e, this text was changed to suggest that a list of Unix-specific permission bits would follow, but no such list was added. Let's revert back to the previous wording, so people won't look for a list that isn't there.
2016-10-17Merge branch 'sverker/hipe-code-loadnpurge/OTP-13968'Sverker Eriksson
* sverker/hipe-code-loadnpurge: (35 commits) erts: Cleanup dead code kernel,hipe: Fix dialyzer warnings erts: Replace unsafe Module.first_hipe_ref erts: Disable DBG_TRACE_MFA for debug build kernel: Fix code_SUITE:upgrade for non-hipe erts: Cleanup hipe trampoline code erts: Remove dead alloc stats in hipe_amd64.c erts: Remove code_SUITE:make_stub and make_stub_many_funs erts: Let code:make_stub_module raise 'notsup' erts: Fix bug in stack walk on risc erts: Fix old leak for ppc hipe code erts: Fix old leak for arm hipe code erts: Fix old leak of sparc hipe code erts: Fix old leak of hipe code on x86 32-bit erts: Enable exec_alloc for all hipe architectures erts: Remove debug printout for hipe loader state erts: Free hipe_refs and hipe_sdesc of a failed load erts: Refactor out hipe_purge_refs/sdesc erts: Refactor hipe_loader_state_dtor into a true destructor hipe: TRY fix llvm external calls to own module ...
2016-10-17kernel,hipe: Fix dialyzer warningsSverker Eriksson
2016-10-14kernel: Fix code_SUITE:upgrade for non-hipeSverker Eriksson
2016-10-14kernel: Fix strange 'ok' return value from code_serverSverker Eriksson
when failing to load native code.
2016-10-14erts: Fix early hipe patch loadingSverker Eriksson
by introducing hipe_bifs:commit_patch_load/1 that creates the HipeModule.
2016-10-14erts: Move new hipe ref and sdesc lists to loader stateSverker Eriksson
2016-10-14Add a loader state for HiPE code loadingMagnus Lång
Just like the BEAM loader state (as returned by erlang:prepare_loading/2), the HiPE loader state is contained in a magic binary. Eventually, we will separate HiPE loading into a prepare and a finalise phase, like the BEAM loader, where the prepare phase will be implemented by hipe_unified_loader and the finalise phase be implemented in C by hipe_load.c and beam_load.c, making prepare side-effect free and finalise atomic. The finalise phase will be exposed through the erlang:finish_loading/1 API, just like the BEAM loader, as this will allow HiPE and BEAM modules to be mixed in the same atomic "commit". The usage of a loader state makes it easier to keep track of all resources allocated during loading, and will not only make it easy to prevent leaks when hipe_unified_loader crashes, but also paves the way for proper, leak-free, unloading of HiPE modules.
2016-10-10kernel: Add test pdict_SUITE:literalsSverker Eriksson
to get some coverage in beam_load.c:hash_internal_genop_arg().
2016-10-10erts: Remove unused hipe_bifs:code_sizeSverker Eriksson
and hipe_bifs:update_code_size
2016-10-10erts: Improve hipe load/upgrade/purge machinerySverker Eriksson
A step toward better integration of hipe load and purge Highlights: * code_server no longer needs to call hipe_unified_loader:post_beam_load/1 Instead new internal function hipe_redirect_to_module() is called by loading BIFs to patch native call sites if needed. * hipe_purge_module() is called by erts_internal:purge_module/2 to purge any native code. * struct hipe_mfa_info redesigned and only used for exported functions that are called from or implemented by native code. A list of native call sites (struct hipe_ref) are kept for each hipe_mfa_info. * struct hipe_sdesc used by hipe_find_mfa_from_ra() to build native stack traces.
2016-10-10hipe_unified_loader: Refactor rename all Addresses to FunDefsSverker Eriksson
as they are lists of #fundef records
2016-09-29Merge branch 'rickard/time-unit/OTP-13831'Rickard Green
* rickard/time-unit/OTP-13831: Replace usage of deprecated time units
2016-09-29Merge branch 'nathanl/kernel/write_file-uses-writev/PR-1149/OTP-13909'Björn Gustavsson
* nathanl/kernel/write_file-uses-writev/PR-1149/OTP-13909: Let file:write_file/3 use writev
2016-09-29Merge branch 'maint'Siri Hansen
2016-09-28Document the order of directories added with code:add_pathsa/1Siri Hansen
code:add_pathsa/1 reverts the list of directories when adding it at the beginning of the code path. The command line option '-pa' behaves in the same way. This is now documented.
2016-09-27Update appups in kernel, stdlib and sasl for OTP-20Siri Hansen
2016-09-27Merge branch 'maint'Siri Hansen
2016-09-26Update appups in kernel and stdlib for OTP versions > 19.1Siri Hansen
2016-09-24Let file:write_file/3 use writevNathan Long
Previously, this function would turn any input into a single binary before writing. This meant it could not take advantage of the `writev` system call if it was given a list of binaries and told to write with `raw` mode. To see this, start an erlang shell on the parent commit, and also start this dtrace script: https://github.com/evanmiller/tracewrite like this: sudo dtrace -s tracewrite.d -p $(pgrep beam) In the erlang shell, run the following: file:write_file("/tmp/tmp.txt", [<<97,98>>, <<98,97>>], [raw]). In the dtrace output, you will see that the system call used is `write`. Now repeat with this commit, and you will see that `writev` is used.
2016-09-23Merge branch 'maint'Björn Gustavsson
* maint: file_SUITE: Test file:write_file/3
2016-09-22Merge branch 'sverker/include-erl_nif/PR-1171'Sverker Eriksson
* sverker/include-erl_nif/PR-1171: Use more correct delimiters for erl_nif.h include
2016-09-22file_SUITE: Test file:write_file/3Björn Gustavsson
Extend file_SUITE:read_write_file/1 to test file:write_file/3 which was not tested at all. While we are it, remove the superfluous roundtrips tests of term_to_binary/1 and binary_to_term/1. Those BIFs are tested in detail in other test suites (for example, binary_SUITE in emulator_test).
2016-09-21Merge tag 'OTP-19.1'Henrik Nord
=== OTP-19.1 === Changed Applications: - asn1-4.0.4 - common_test-1.12.3 - compiler-7.0.2 - crypto-3.7.1 - debugger-4.2.1 - dialyzer-3.0.2 - diameter-1.12.1 - edoc-0.8 - erl_docgen-0.6 - erl_interface-3.9.1 - erts-8.1 - eunit-2.3.1 - gs-1.6.2 - hipe-3.15.2 - ic-4.4.2 - inets-6.3.3 - jinterface-1.7.1 - kernel-5.1 - mnesia-4.14.1 - observer-2.2.2 - odbc-2.11.3 - parsetools-2.1.3 - reltool-0.7.2 - runtime_tools-1.10.1 - sasl-3.0.1 - snmp-5.2.4 - ssh-4.3.2 - ssl-8.0.2 - stdlib-3.1 - syntax_tools-2.1 - tools-2.8.6 - wx-1.7.1 - xmerl-1.3.12 Unchanged Applications: - cosEvent-2.2.1 - cosEventDomain-1.2.1 - cosFileTransfer-1.2.1 - cosNotification-1.2.2 - cosProperty-1.2.1 - cosTime-1.2.2 - cosTransactions-1.3.2 - eldap-1.2.2 - et-1.6 - megaco-3.18.1 - orber-3.8.2 - os_mon-2.4.1 - otp_mibs-1.1.1 - percept-0.9 - public_key-1.2 - typer-0.9.11 Conflicts: OTP_VERSION lib/gs/doc/src/notes.xml lib/gs/vsn.mk
2016-09-20Prepare releaseErlang/OTP
2016-09-19Use more correct delimiters for erl_nif.h includeTuncer Ayaz
Anywhere but the beam sources we shouldn't #include "erl_nif.h", because what "erl_nif.h" does is: (1) fail to find it outside of -I dirs, (2) then treat it as if it was written like <erl_nif.h>. Using <erl_nif.h> skips (1). More information can be found in 6.10.2 of the C standard. Because the examples use "erl_nif.h", NIF projects in the Erlang ecosystem copy this verbatim and make the same mistake.
2016-09-19Allow for easier enabling of distribution debugLuis Rascao
Also update already deprecated calls.
2016-09-15Merge branch 'maint'Raimo Niskanen
2016-09-15Merge branch 'raimo/diffserv-socket-option/OTP-13582' into maintRaimo Niskanen
* raimo/diffserv-socket-option/OTP-13582: Tune 'tclass' semantics Implement IPV6_TCLASS
2016-09-15Merge branch 'maint'Björn Gustavsson
* maint: erts: Add nif_SUITE:t_on_load erts: Improve nif_SUITE:upgrade test Don't leak old code when loading a modules with an on_load function Conflicts: erts/preloaded/ebin/erts_code_purger.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/src/erts_code_purger.erl
2016-09-15Merge branch 'bjorn/erts/on_load/ERL-240/OTP-13893' into maintBjörn Gustavsson
* bjorn/erts/on_load/ERL-240/OTP-13893: erts: Add nif_SUITE:t_on_load erts: Improve nif_SUITE:upgrade test Don't leak old code when loading a modules with an on_load function
2016-09-14Merge branch 'maint'Peter Andersson
2016-09-14Don't leak old code when loading a modules with an on_load functionBjörn Gustavsson
Normally, calling code:delete/1 before re-loading the code for a module is unnecessary but causes no problem. But there will be be problems if the new code has an on_load function. Code with an on_load function will always be loaded as old code to allowed it to be easily purged if the on_load function would fail. If the on_load function succeeds, the old and current code will be swapped. So in the scenario where code:delete/1 has been called explicitly, there is old code but no current code. Loading code with an on_load function will cause the reference to the old code to be overwritten. That will at best cause a memory leak, and at worst an emulator crash (especially if NIFs are involved). To avoid that situation, we will put the code with the on_load function in a special, third slot in Module. ERL-240
2016-09-14Tune 'tclass' semanticsRaimo Niskanen
2016-09-12Implement IPV6_TCLASSRaimo Niskanen
2016-09-08Fix incorrect priv_dir when adding app's ebin directory to pathPeter Andersson
2016-09-07Merge branch 'tuncer/kernel/on_load-error-string/PR-1155'Björn Gustavsson
* tuncer/kernel/on_load-error-string/PR-1155: Print on_load error in a more useful style
2016-09-06Merge branch 'maint'Hans Bolinder
* maint: kernel: Correct file(3)
2016-09-06kernel: Correct file(3)Hans Bolinder
2016-09-05Merge branch 'maint'Lukas Larsson
2016-09-05Merge branch 'lukas/kernel/os_cmd_fix_stdin_close/OTP-13867' into maintLukas Larsson
* lukas/kernel/os_cmd_fix_stdin_close/OTP-13867: kernel: Close stdin of commands run in os:cmd
2016-09-05Merge branch 'maint'Lukas Larsson
2016-09-05Merge branch 'lukas/kernel/fix_os_SUITE_message_leak_testcase/OTP-13867' ↵Lukas Larsson
into maint * lukas/kernel/fix_os_SUITE_message_leak_testcase/OTP-13867: kernerl: Remove infinite loop from testcase
2016-09-02kernel: Close stdin of commands run in os:cmdLukas Larsson
This is needed when running programs that only exit when stdin has been closed, e.g. 'more'.
2016-09-02Merge branch 'maint'Hans Bolinder
* maint: doc: Correct errors introduced by Editorial changes
2016-09-01doc: Correct errors introduced by Editorial changesHans Bolinder
Fix some older errors as well.
2016-09-01Merge branch 'maint'Hans Bolinder
* maint: Fix xmllint-warnings
2016-08-31Print on_load error in a more useful styleTuncer Ayaz
When printing the error term from on_load, insert a newline because the term is never short and will produce hard to read/copy output that is just hanging off to the right.
2016-08-31Fix xmllint-warningsHans Bolinder