aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers
AgeCommit message (Collapse)Author
2018-06-18Update copyright yearHenrik Nord
2018-03-29Merge branch 'lukas/erts/tcp_send_return_closed/OTP-15001'Lukas Larsson
* lukas/erts/tcp_send_return_closed/OTP-15001: erts: tcp send should return {error,closed}
2017-11-30Reimplement efile_drv as a dirty NIFJohn Högberg
This improves the latency of file operations as dirty schedulers are a bit more eager to run jobs than async threads, and use a single global queue rather than per-thread queues, eliminating the risk of a job stalling behind a long-running job on the same thread while other async threads sit idle. There's no such thing as a free lunch though; the lowered latency comes at the cost of increased busy-waiting which may have an adverse effect on some applications. This behavior can be tweaked with the +sbwt flag, but unfortunately it affects all types of schedulers and not just dirty ones. We plan to add type-specific flags at a later stage. sendfile has been moved to inet_drv to lessen the effect of a nasty race; the cooperation between inet_drv and efile has never been airtight and the socket dying at the wrong time (Regardless of reason) could result in fd aliasing. Moving it to the inet driver makes it impossible to trigger this by closing the socket in the middle of a sendfile operation, while still allowing it to be aborted -- something that can't be done if it stays in the file driver. The race still occurs if the controlling process dies in the short window between dispatching the sendfile operation and the dup(2) call in the driver, but it's much less likely to happen now. A proper fix is in the works. -- Notable functional differences: * The use_threads option for file:sendfile/5 no longer has any effect. * The file-specific DTrace probes have been removed. The same effect can be achieved with normal tracing together with the nif__entry/nif__return probes to track scheduling. -- OTP-14256
2017-11-20Merge branch 'maint'Hans Nilsson
* maint: Updated OTP version Prepare release ssh: testcases for space trailing Hello msg ssh: Don't remove trailing WS in Hello msg ssh: dialyzer fixes ssh: Fix broken error handling during session setup Remove invalid EINTR loop around close(2) Conflicts: OTP_VERSION
2017-11-20Merge branch 'maint-20' into maintHans Nilsson
* maint-20: Updated OTP version Prepare release ssh: testcases for space trailing Hello msg ssh: Don't remove trailing WS in Hello msg ssh: dialyzer fixes ssh: Fix broken error handling during session setup Remove invalid EINTR loop around close(2) Conflicts: lib/ssh/test/ssh_options_SUITE.erl
2017-11-17Merge branch 'john/erts/fix-close-eintr/OTP-14775' into maint-20Erlang/OTP
* john/erts/fix-close-eintr/OTP-14775: Remove invalid EINTR loop around close(2)
2017-11-13Remove invalid EINTR loop around close(2)John Högberg
Retrying close(2) on anything other than HP-UX is likely to close something entirely different. POSIX says that the state of the file descriptor is unspecified, and Linux/BSD guarantee that it's closed on return.
2017-11-01Merge pull request #1592 from falkevik/sctp_return_only_connect_errorsRaimo Niskanen
OTP-13760 SCTP connect could return error even if the connect is ongoing
2017-10-30erts: tcp send should return {error,closed}Lukas Larsson
In the scenario where a gen_tcp:recv/2 detected an error, the next gen_tcp:send should get a closed error and not a enotconn error as was the case before.
2017-10-25sctp: change connect to only return connect errorsJonas Falkevik
gen_sctp:connect_init/4 could return error even though the connect are in progress. I.e. connect on socket returned "in progress". The error can come from packet_inet_output() which is checking the socket for errors. The issue here is that from erlang you don't think the connect is still ongoing. But you will receive a sctp_assoc_change message later on.
2017-10-17Merge branch 'maint'Sverker Eriksson
2017-10-17Merge branch 'sverker/dist-send-noreply-opt/OTP-14689' into maintSverker Eriksson
* sverker/dist-send-noreply-opt/OTP-14689: erts: Improve distribution send operations
2017-09-27Merge branch 'kvakvs/zero-size-read_file/ERL-327/PR-1524/OTP-14637'Lukas Larsson
* kvakvs/zero-size-read_file/ERL-327/PR-1524/OTP-14637: erts: On zero-size files attempt to read until EOF
2017-09-27erts: On zero-size files attempt to read until EOFDmytro Lytovchenko
2017-09-20erts: Improve distribution send operationsSverker Eriksson
by ignoring reply earlier.
2017-09-14Merge branch 'maint'Dan Gudmundsson
* maint: stdlib: Fix jumping to beginning or end of line Fix del_chars not considering wide chars and update buffer length before calling write_buf Make cp_pos_to_col function aware of the ANSI escape codes
2017-09-14Merge pull request #1549 from ggcampinho/fix-move-cursorDan Gudmundsson
Consider ANSI escape codes on cp_pos_to_col
2017-09-13Fix del_chars not considering wide chars and update buffer length before ↵Glauber Campinho
calling write_buf After deleting the chars the function `del_chars` was considering the code points to move the cursor back and not the graphemes
2017-09-11Merge branch 'lukas/erts/non-smp-removal-cleanup/OTP-14518'Lukas Larsson
* lukas/erts/non-smp-removal-cleanup/OTP-14518: Make estone work with older releases erts: Allow read in ttsl driver to return EAGAIN syntax_tools: Fix makefile dep erts: non-smp removal cleanup in erlexec
2017-09-11erts: Allow read in ttsl driver to return EAGAINLukas Larsson
2017-09-06Merge branch 'maint' into john/erts/merge-zlib-and-vector-qJohn Högberg
2017-09-06Merge branch 'john/erts/zlib-nif/OTP-14185' into maintJohn Högberg
OTP-14527
2017-09-05Replace the zlib driver with a NIFJohn Högberg
All operations will now yield appropriately, allowing them to be used freely in concurrent applications. This commit also deprecates the functions listed below, although they won't raise deprecation warnings until OTP 21: zlib:adler32 zlib:crc32 zlib:inflateChunk zlib:getBufSize zlib:setBufSize The behavior of throwing an error when a dictionary is required for decompression has also been deprecated.
2017-09-01Make cp_pos_to_col function aware of the ANSI escape codesGlauber Campinho
This fixes the issue with the function `move_cursor` described in #1536 and that causes the bug described in https://github.com/elixir-lang/elixir/issues/6504. The function `cp_pos_to_col` maps the current position in the buffer to the correct column on the screen, but it didn't handle ANSI escape codes. Since the ANSI escape codes aren't visible, the `cp_pos_to_col` now skips them when executing the calculations using `ansi_escape_width`. This new function only considers color escape codes, but also handles invalid codes.
2017-08-23Merge branch 'maint'Dan Gudmundsson
* maint: Fix ANSI support in the console
2017-08-21Fix ANSI support in the consoleGlauber Campinho
The ANSI support doesn't work properly with edlin, the issue can be noticed when you try to use the history of the shell and the prompt prefix has ANSI (https://github.com/elixir-lang/elixir/issues/6448). The problem is that when a `\e` character appears, it handles it like a new line, dropping the buffer before it. The solution is to always add the `\e` to the buffer like a regular character and handle it when writing the buffer instead.
2017-08-17Merge branch 'maint'Dan Gudmundsson
* maint: stdlib: Improve edlin handling of unicode chars
2017-08-17Merge branch 'dgud/stdlib/edit-unicode' into maintDan Gudmundsson
* dgud/stdlib/edit-unicode: stdlib: Improve edlin handling of unicode chars OTP-14542
2017-08-16stdlib: Improve edlin handling of unicode charsDan Gudmundsson
Let edlin handle grapheme clusters instead of codepoints to improve the handling multi-codepoints characters. The ttsl driver (and protocol) still expects all lengths as codepoints. Previously it was expected that each codepoint used (at least) one terminal column for each codepoint, and a hack was made for wide characters (multicolumn) by patching in TAGGED characters to occupy the extra space so that codepoint index was equal column index. This didn't work at all for combining codepoints that do not occupy any more space than the previous character. Improved this handling by calculating column positions in move_cursor. This is based on wcwidth() and is not perfect, wcwidth() is wrong for some codepoints and wcwidth() can not know with Hangul graphemes for example. But it works better than before without making a major change in the protocol.
2017-07-27Merge branch 'maint'John Högberg
* maint: Updated OTP version Update release notes Update version numbers Fix doc for the 'quiet' option; it defaults to false asn1: Fix missing quotes of external encoding call Add a dedicated close function for TCP ports to prevent issues like ERL-430/448 Close TCP ports properly on send timeout erts: Add missing release note
2017-07-27Merge branch 'maint-20' into maintJohn Högberg
* maint-20: Updated OTP version Update release notes Update version numbers Fix doc for the 'quiet' option; it defaults to false asn1: Fix missing quotes of external encoding call Add a dedicated close function for TCP ports to prevent issues like ERL-430/448 Close TCP ports properly on send timeout erts: Add missing release note
2017-07-26Merge branch 'john/erts/fix-tcp-send-timeout/OTP-14509/ERL-448' into maint-20Erlang/OTP
* john/erts/fix-tcp-send-timeout/OTP-14509/ERL-448: Add a dedicated close function for TCP ports to prevent issues like ERL-430/448 Close TCP ports properly on send timeout
2017-07-17erts: Remove ERTS_SMP and USE_THREAD definesLukas Larsson
This refactor was done using the unifdef tool like this: for file in $(find erts/ -name *.[ch]); do unifdef -t -f defile -o $file $file; done where defile contained: #define ERTS_SMP 1 #define USE_THREADS 1 #define DDLL_SMP 1 #define ERTS_HAVE_SMP_EMU 1 #define SMP 1 #define ERL_BITS_REENTRANT 1 #define ERTS_USE_ASYNC_READY_Q 1 #define FDBLOCK 1 #undef ERTS_POLL_NEED_ASYNC_INTERRUPT_SUPPORT #define ERTS_POLL_ASYNC_INTERRUPT_SUPPORT 0 #define ERTS_POLL_USE_WAKEUP_PIPE 1 #define ERTS_POLL_USE_UPDATE_REQUESTS_QUEUE 1 #undef ERTS_HAVE_PLAIN_EMU #undef ERTS_SIGNAL_STATE
2017-07-10Add a dedicated close function for TCP ports to prevent issues like ERL-430/448John Högberg
2017-07-10Close TCP ports properly on send timeoutJohn Högberg
2017-07-06Merge branch 'john/erts/runtime-lcnt' into maintJohn Högberg
* john/erts/runtime-lcnt: Document rt_mask and add warnings about copy_save Add an emulator test suite for lock counting Break erts_debug:lock_counters/1 into separate BIFs Allow toggling lock counting at runtime Move lock flags to a common header Enable register_SUITE for lcnt builds Enable lcnt smoke test on all builds that have lcnt enabled Make lock counter info independent of the locks being counted OTP-14412 OTP-13170 OTP-14413
2017-07-06Allow toggling lock counting at runtimeJohn Högberg
The implementation is still hidden behind ERTS_ENABLE_LOCK_COUNT, and all categories are still enabled by default, but the actual counting can be toggled at will. OTP-13170
2017-06-30Merge branch 'john/erts/fix-port-leak/OTP-13939/ERL-193' into maint-20Erlang/OTP
* john/erts/fix-port-leak/OTP-13939/ERL-193: Add a testcase for OTP-13939/ERL-193 Mark socket disconnected on tcp_send_or_shutdown_error # Conflicts: # lib/kernel/test/gen_tcp_misc_SUITE.erl
2017-06-27Merge branch 'maint-19' into maintJohn Högberg
* maint-19: Updated OTP version Update release notes Update version numbers Fix statistics(wall_clock) and statistics(runtime) implementation fixup! erts: Cleanup dropped port tasks correctly erts: Add tests to detect port close race Add a testcase for OTP-13939/ERL-193 erts: Cleanup dropped port tasks correctly Mark socket disconnected on tcp_send_or_shutdown_error
2017-06-26Merge branch 'john/erts/fix-port-leak/OTP-13939/ERL-193' into maint-19Erlang/OTP
* john/erts/fix-port-leak/OTP-13939/ERL-193: Add a testcase for OTP-13939/ERL-193 Mark socket disconnected on tcp_send_or_shutdown_error # Conflicts: # lib/kernel/test/gen_tcp_misc_SUITE.erl
2017-06-14Mark socket disconnected on tcp_send_or_shutdown_errorkvakvs
The socket left lingering due to {exit_on_close, false} will accept writes in a confusing way, returning either enotconn or blocking. This fix allows socket to know that it has been closed recently, and new writes won't pass.
2017-06-08Merge branch 'maint'Rickard Green
* maint: Updated OTP version Update release notes Update version numbers erts: Fix so that 81b628 (sigterm=kill) works Updated OTP version Prepare release Unconditionally clear IO buffers on send/shutdown errors Conflicts: OTP_VERSION erts/emulator/sys/unix/sys.c erts/vsn.mk
2017-06-07Merge branch 'john/erts/fix-zombie-tcp-ports/ERL-430/OTP-14441' into maint-19Erlang/OTP
* john/erts/fix-zombie-tcp-ports/ERL-430/OTP-14441: Unconditionally clear IO buffers on send/shutdown errors
2017-06-07Merge branch 'lukas/erts/sendfile_sunos_fix/OTP-14424'Lukas Larsson
* lukas/erts/sendfile_sunos_fix/OTP-14424: erts: Fix sendfile closeduring scenario on sunos
2017-06-07erts: Fix sendfile closeduring scenario on sunosLukas Larsson
On Solaris, giving a too long sfv_len results in an EINVAL error, but data is still transmitted and len is correctly. So we translate this to a success with that amount of data sent. This may hide some other errors that causes EINVAL, but it is the best we can do for now.
2017-06-01Unconditionally clear IO buffers on send/shutdown errorsJohn Högberg
This fixes a bug where a send/shutdown error on an active-mode socket results in the port never being properly closed.
2017-05-19Do not zero terminate Linux abstract addressesRaimo Niskanen
2017-05-04Update copyright yearRaimo Niskanen
2017-04-20implement SO_BINDTODEVICE for inet protocolsAndreas Schultz
bind to device is needed to properly support VRF-Lite under Linux (see [1] for details). [1]: https://www.kernel.org/doc/Documentation/networking/vrf.txt
2017-04-04Merge branch 'maint'Ingela Anderton Andin
Conflicts: OTP_VERSION erts/vsn.mk lib/crypto/c_src/crypto.c lib/crypto/src/crypto.erl lib/ssh/src/ssh.erl