aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-09-01Merge branch 'nox/erl_scan-fix-column-tracking' into maintMarcus Arendt
* nox/erl_scan-fix-column-tracking: Properly track column numbers in erl_scan
2014-09-01Merge branch 'siri/ct-runtime-deps/OTP-12037' into maintSiri Hansen
* siri/ct-runtime-deps/OTP-12037: [ct] Update runtime dependencies towards test_server
2014-09-01Merge branch 'maint-17' into maintMarcus Arendt
Conflicts: OTP_VERSION
2014-08-29Clarify error for slow `cpu_sup` port initLuca Favatella
I noticed that running an R16B03-1 node on an overloaded host produced log entries like the following ones: ``` 2014-08-22 21:52:31 =ERROR REPORT==== Error in process <0.24112.3> on node '[email protected]' with exit value: {{case_clause,{data,4711}},[{cpu_sup,get_uint32_measurement,2,[{file,"cpu_sup.erl"},{line,227}]},{cpu_sup,measurement_server_loop,1,[{file,"cpu_sup.erl"},{line,585}]}]} ``` ``` ===== ALIVE Fri Aug 22 21:50:14 CEST 2014 [os_mon] cpu supervisor port (cpu_sup): Erlang has closed [os_mon] cpu supervisor port (cpu_sup): Erlang has closed [os_mon] cpu supervisor port (cpu_sup): Erlang has closed [os_mon] cpu supervisor port (cpu_sup): Erlang has closed ===== ALIVE Fri Aug 22 22:07:46 CEST 2014 ``` I performed a code inspection on the `cpu_sup` module and I concluded that the `case_clause` error shows a small issue in the `cpu_sup` module, that happens when the port used in `cpu_sup` is slow to start - as it may happen on an overloaded node. The `cpu_sup` `gen_server` process keeps in its state the pid of an unlinked process (called "measurement server" - see `cpu_sup:init/1`), in order to do dirty stuff (e.g. reading the filesystem, running OS commands) and start_link-ing & managing the connected process to a port (called "port server" - see `measurement_server_init/0`). So the process organization looks like this: ``` cpu_sup - measurement server - port server - port ``` When the measurement server start_links the port server (see `port_server_start/0`) it sends a `{self(), ?ping}` message to it and expects an answer within 6s, otherwise it returns `{error, timeout}` rather than the pid. This has two issues: * The measurement server keeps `{error, ...}` in its state as if it were a pid - that makes no sense; * A late `{Pid, {data,4711}}` response may arrive in the mailbox of the measurement server, that will believe it to be a request to be processed, causing a `case_clause` error. This commit teaches the measurement server to check the success of the initialization of the port server by matching on the return value of `port_server_start/0` (renamed to `port_server_start_link/0` for the sake of clarity) in order to fail earlier and with an error clearer than `{case_clause,{data,4711}}`. In such case I expect the measurement server to be restarted by the `cpu_sup` `gen_server` (see `handle_call/3`) - as before. BTW It is not clear to me when the `handle_info({'EXIT', _Port, Reason}, State)` may be called (the `cpu_sup` `gen_server` does not link to the measurement server) but I am leaving it.
2014-08-29Merge branch 'rickard/runnable-trace-ooo-bug/OTP-12105' into maintRickard Green
* rickard/runnable-trace-ooo-bug/OTP-12105: Fix busy_port_SUITE:io_to_busy test-case Ensure "runnable port" trace messages are not sent out of order Ensure "runnable proc" trace messages are not sent out of order
2014-08-29Merge branch 'rickard/port-emigrate-bug/maint/OTP-12084' into maintRickard Green
* rickard/port-emigrate-bug/maint/OTP-12084: Verify run-queue asserts Fix emigrate bug in erts_port_task_schedule()
2014-08-29Merge branch 'ia/public_key/dialyzer' into maintIngela Anderton Andin
* ia/public_key/dialyzer: public_key: Fix spec and documentation for pkix_crls_validate public_key: Fix spec and documentation for PBES
2014-08-29Updated OTP versionOTP-17.2.2Erlang/OTP
2014-08-29Prepare releaseErlang/OTP
2014-08-29Merge branch 'dgud/mnesia/create-table-race/OTP-12124' into maint-17Erlang/OTP
* dgud/mnesia/create-table-race/OTP-12124: Avoid timing issue in schema transaction when node is stopping
2014-08-28Merge branch 'vinoski/enif-schedule-nif' into maintRickard Green
* vinoski/enif-schedule-nif: add enif_schedule_nif() to NIF API
2014-08-28add enif_schedule_nif() to NIF APISteve Vinoski
In the #erlang IRC channel Anthony Ramine once mentioned the idea of allowing a NIF to use an emulator trap, similar to a BIF trap, to schedule another NIF for execution. This is exactly how dirty NIFs were implemented for Erlang/OTP 17.0, so this commit refactors and generalizes that dirty NIF code to support a new enif_schedule_nif() API function. The enif_schedule_nif() function allows a long-running NIF to be broken into separate NIF invocations. The NIF first executes part of the long-running task, then calls enif_schedule_nif() to schedule a NIF for later execution to continue the task. Any number of NIFs can be scheduled in this manner, one after another. Since the emulator regains control between invocations, this helps avoid problems caused by native code tying up scheduler threads for too long. The enif_schedule_nif() function also replaces the original experimental dirty NIF API. The function takes a flags parameter that a caller can use to indicate the NIF should be scheduled onto either a dirty CPU scheduler thread, a dirty I/O scheduler thread, or scheduled as a regular NIF on a regular scheduler thread. With this change, the original experimental enif_schedule_dirty_nif(), enif_schedule_dirty_nif_finalizer() and enif_dirty_nif_finalizer() API functions are no longer needed and have been removed. Explicit scheduling of a dirty NIF finalization function is no longer necessary; if an application wants similar functionality, it can have a dirty NIF just invoke enif_schedule_nif() to schedule a non-dirty NIF to complete its task. Lift the restriction that dirty NIFs can't call enif_make_badarg() to raise an exception. This was a problem with the original dirty NIF API because it forced developers to get and check all incoming arguments in a regular NIF, and then schedule the dirty NIF which then had to get all the arguments again. Now, the argument checking can be done in the dirty NIF and it can call enif_make_badarg() itself to flag incorrect arguments. Extend the ErlNifFunc struct with a new flags field that allows NIFs to be declared as dirty. The default value for this field is 0, indicating a regular NIF, so it's backwards compatible with all existing statically initialized ErlNifFunc struct instances, and so such instances require no code changes. Defining the flags field with a value of ERL_NIF_DIRTY_JOB_CPU_BOUND indicates that the NIF should execute on a dirty CPU scheduler thread, or defining it with a value of ERL_NIF_DIRTY_JOB_IO_BOUND indicates that the NIF should execute on a dirty I/O scheduler thread. Any other flags field value causes a NIF library loading error. Extend the ErlNifEntry struct with a new options field that indicates whether a NIF library was built with support for optional features such as dirty NIFs. When a NIF library is loaded, the runtime checks the options field to ensure compatibility. If a NIF library built with dirty NIF support is loaded into a runtime that does not support dirty NIFs, and the library defines one or more ErlNifFunc entries with non-zero flags fields indicating dirty NIFs, a NIF library loading error results. There is no error if a NIF library built with dirty NIF support is loaded into a runtime that does not support dirty NIFs but the library does not have any dirty NIFs. It is also not an error if a library without dirty NIF support is loaded into a runtime built with dirty NIF support. Add documentation and tests for enif_schedule_nif().
2014-08-28Merge branch 'dgud/stdlib/format_status_terminate/OTP-11967' into maintDan Gudmundsson
* dgud/stdlib/format_status_terminate/OTP-11967: stdlib: Call format_status even if terminate callback crashes
2014-08-28Merge branch 'michaelkschmidt/ssh_bug_fix' into maintMarcus Arendt
* michaelkschmidt/ssh_bug_fix: Test Other Clauses of start_shell Fix SSH CLI when using custom "shell" option
2014-08-28Merge branch 'tuncer/misspelled-another' into maintMarcus Arendt
* tuncer/misspelled-another: Fix misspellings of 'another'
2014-08-28Merge branch 'okeuday/erts-poll-debug-print-fix' into maintMarcus Arendt
* okeuday/erts-poll-debug-print-fix: Fix ERTS_POLL_DEBUG_PRINT usage
2014-08-28Avoid timing issue in schema transaction when node is stoppingDan Gudmundsson
By doing an abort, the create_table can be restarted if a node go down during the transaction. {badarg, [{erlang,link,[undefined],[]}, {mnesia_controller, wait_for_schema_commit_lock,0, [{file,"mnesia_controller.erl"}, {line,303}]}, {mnesia_schema,prepare_commit,3, [{file,"mnesia_schema.erl"}, {line,1838}]}, {mnesia_tm,commit_participant,6, [{file,"mnesia_tm.erl"}, {line,1669}]}]}}},
2014-08-28SSH: only enable ciphers/MACs when they are available in cryptoAlex Wilson
Also adjusts tests to only expect a positive outcome when crypto supports the relevant base ciphers/MACs.
2014-08-27public_key: Fix spec and documentation for pkix_crls_validateIngela Anderton Andin
2014-08-27public_key: Fix spec and documentation for PBESIngela Anderton Andin
2014-08-27Merge branch 'lpgauth/fix_httpc_doc_typo' into maintBruce Yinhe
* lpgauth/fix_httpc_doc_typo: Fix typo in documentation /header_as_is/headers_as_is/
2014-08-27Merge branch 'ia/odbc/win-test' into maintIngela Anderton Andin
* ia/odbc/win-test: odbc: Condition test case to avoid permission issues in Vista
2014-08-26stdlib: Test maps:with/2Björn-Egil Dahlberg
2014-08-26stdlib: Document maps:with/2Björn-Egil Dahlberg
2014-08-26odbc: Condition test case to avoid permission issues in VistaIngela Anderton Andin
2014-08-26Merge branch 'kittee/maps_only' into maintMarcus Arendt
* kittee/maps_only: maps:only/2 -> maps:with/2 add maps:only/2
2014-08-26Merge branch 'ia/public_key/PBES2/OTP-11915' into maintIngela Anderton Andin
* ia/public_key/PBES2/OTP-11915: public_key: Add encodeing functionality for PBES1 and PBES2 public_key: Add PBES1 decoding support
2014-08-25Merge branch 'vladdu/jinterface_fun_equals' into maintBruce Yinhe
OTP-12121 * vladdu/jinterface_fun_equals: jinterface: fix bug in equality for OtpErlangFun
2014-08-25Fix misspellings of 'another'Tuncer Ayaz
2014-08-25Merge branch 'ia/inets/ipv6-tests' into maintIngela Anderton Andin
* ia/inets/ipv6-tests: inets: Enable ipv6 tests for httpd
2014-08-25public_key: Add encodeing functionality for PBES1 and PBES2Ingela Anderton Andin
2014-08-22Test Other Clauses of start_shellMichael K. Schmidt
start_shell() is called by exec, so test those cases as well. Also add support for passing a fun to exec.
2014-08-22Fix ERTS_POLL_DEBUG_PRINT usageMichael Truog
2014-08-22inets: Enable ipv6 tests for httpdIngela Anderton Andin
2014-08-22Fix busy_port_SUITE:io_to_busy test-caseRickard Green
2014-08-22Ensure "runnable port" trace messages are not sent out of orderRickard Green
2014-08-22Ensure "runnable proc" trace messages are not sent out of orderRickard Green
2014-08-22public_key: Add PBES1 decoding supportIngela Anderton Andin
2014-08-22DevelopmentMarcus Arendt
2014-08-22Merge branch 'marcus/OTP-17.2.1/mergefix' into maintMarcus Arendt
* marcus/OTP-17.2.1/mergefix: Updated OTP version Update release notes
2014-08-22Updated OTP versionErlang/OTP
2014-08-22Update release notesErlang/OTP
2014-08-21Merge branch 'egil/proc_lib-optimizations/OTP-12060' into maintBjörn-Egil Dahlberg
* egil/proc_lib-optimizations/OTP-12060: stdlib: Update dependencies to erts-6.2 erts: Update preloaded erlang.beam stdlib: Use erlang:fun_info_mfa/1 in proc_lib:init_p/3 erts: Test erlang:fun_info_mfa/1 erts: Introduce erlang:fun_info_mfa/1
2014-08-21Merge branch 'nox/reedr-logging/OTP-12115' into maintLukas Larsson
* nox/reedr-logging/OTP-12115: Add number of entries to mnesia copy debug message Add thread index to allocator enomem dump slogan Add run queue index to process dump info Add missing error string to syslog logging in epmd Demote rare debug slogan of message discarding to debug build
2014-08-21Merge branch 'maint-17' into maintMarcus Arendt
2014-08-21Merge branch 'ia/ssl/dialyzer-certificate_requests' into maintIngela Anderton Andin
* ia/ssl/dialyzer-certificate_requests: ssl: Fix boolean expression ssl: Fix broken contract
2014-08-21Merge branch 'lucafavatella/accept-ip-in-net_adm-names' into maintMarcus Arendt
* lucafavatella/accept-ip-in-net_adm-names: Refactor erl_epmd:names/1 Accept inet:ip_address() in net_adm:names/1
2014-08-21Merge branch 'hb/dialyzer/bugfixes/OTP-12018' into maintHans Bolinder
* hb/dialyzer/bugfixes/OTP-12018: dialyzer, hipe: Fix a bug concerning is_record/2,3
2014-08-21dialyzer, hipe: Fix a bug concerning is_record/2,3Hans Bolinder
Also fixed some cases where Dialyzer could crash due to reaching system limits.
2014-08-21Merge branch 'hb/dialyzer/bugfix/OTP-12111' into maintHans Bolinder
* hb/dialyzer/bugfix/OTP-12111: dialyzer: fix a -Wunderspecs bug