aboutsummaryrefslogtreecommitdiffstats
path: root/erts
AgeCommit message (Collapse)Author
2018-09-17Merge branch 'raimo/receive-TOS-TCLASS/ERIERL-187/OTP-15145' into maintRaimo Niskanen
* raimo/receive-TOS-TCLASS/ERIERL-187/OTP-15145: Write testcases for recvtos and friends Fix term buffer overflow bug Fix documentation due to feedback Implement socket option recvtos and friends
2018-09-17Merge branch 'john/erts/improve-list-reverse-trapping/OTP-15199' into maintJohn Högberg
* john/erts/improve-list-reverse-trapping/OTP-15199: Improve trapping in lists:reverse/2 Fix unsafe use of lists:reverse/1
2018-09-17Merge branch 'rickard/conf-pgo/OTP-15282' into maintRickard Green
* rickard/conf-pgo/OTP-15282: Fix PGO configure test
2018-09-14Merge branch 'hasse/syntax_tools/fix_revert/OTP-15294' into maintHans Bolinder
* hasse/syntax_tools/fix_revert/OTP-15294: erts: Add comment about [] and nil() to The Abstract Format syntax_tools: Correct erl_syntax:revert/1
2018-09-14erts: Add comment about [] and nil() to The Abstract FormatHans Bolinder
2018-09-13Improve trapping in lists:reverse/2John Högberg
If the process had more free space than reductions it could run a lot longer than it was supposed to. It didn't honor the number of reductions going in either, nor did it bump reductions when returning its result or erroring out. This commit also removes this function from a work function in scheduler_SUITE as it's extremely sensitive to the number of reductions spent in the test, causing equal_and_high_with_part_time_max to fail on some machines.
2018-09-13Fix unsafe use of lists:reverse/1John Högberg
We said reverse/2 but used reverse/1 which is unsafe to use in preloaded modules. This didn't have any effect in practice as the affected functions weren't used before the code server was started, but it's still an error.
2018-09-12Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Update release notes Update version numbers erts: Fix "Prevent inconsistent node lists" fix Fix include-path regression caused by dd0a39c Restore default SIGTERM behaviour for port programs
2018-09-11Update release notesErlang/OTP
2018-09-11Update version numbersErlang/OTP
2018-09-11Merge branch 'sverker/erts/fix-aborted-pending-connection-race/OTP-15296' ↵Erlang/OTP
into maint-21 * sverker/erts/fix-aborted-pending-connection-race/OTP-15296: erts: Fix "Prevent inconsistent node lists" fix
2018-09-11erts: Fix "Prevent inconsistent node lists" fixSverker Eriksson
done in a31216200bdee2c04b3fb3ae5e26607674715c8a that could cause a new pending connection to be incorrectly aborted.
2018-09-11Fix term buffer overflow bugRaimo Niskanen
2018-09-10Merge branch 'raimo/improve-doc-indexing/ERL-666' into maintRaimo Niskanen
* raimo/improve-doc-indexing/ERL-666: Correct doc markers Improve indexing of cref docs
2018-09-10Restore default SIGTERM behaviour for port programsRickard Green
erl_child_setup program ignores TERM signals as of ERTS version 10.0 (cff8dce0). This setting was unfortunately inherited by port programs. This commit restores handling of TERM signals in port programs to the default behavior. That is, terminate the process.
2018-09-07Correct doc markersRaimo Niskanen
2018-09-06Merge branch 'rickard/pcre-8.42/OTP-15217' into maintRickard Green
* rickard/pcre-8.42/OTP-15217: Update PCRE from version 8.41 to version 8.42
2018-09-06Fix PGO configure testRickard Green
2018-09-06Merge pull request #1861 from fornwall/fix-cross-compilingRickard Green
erts: Fix configure check when cross-compiling OTP-15282
2018-09-06Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Update release notes Update version numbers kernel: Fix missing abort_connection in net_kernel Prevent inconsistent node lists Fix an endless rescheduling loop when a process is executing process_info(self(), ...)
2018-09-06Merge pull request #1943 from max-au/handle_signals_before_dirty_gcRickard Green
Fix an endless rescheduling loop when a process is executing process_… OTP-15275
2018-09-05Update release notesErlang/OTP
2018-09-05Update version numbersErlang/OTP
2018-09-05Merge branch 'rickard/dist-entry-gc-fix/OTP-15279' into maint-21Erlang/OTP
* rickard/dist-entry-gc-fix/OTP-15279: Prevent inconsistent node lists
2018-09-05Prevent inconsistent node listsRickard Green
If net_kernel "forgets" to abort a connection (as it currently might), the garbage collection of a distribution entry could cause node lists to enter an inconsistent state.
2018-09-05Merge branch 'sverker/erts/ets-memstat-false-leak/ERL-720/OTP-15278' into maintSverker Eriksson
* sverker/erts/ets-memstat-false-leak/ERL-720/OTP-15278: erts: Refactor ets FixedDeletion allocations erts: Fix ets memstat false leak of FixedDeletion
2018-09-04Fix an endless rescheduling loop when a process is executing ↵Maxim Fedorov
process_info(self(), ...) It is possible that a process has to yield before completing process_info BIF when it runs out of reductions. If this BIF is called by the process itself, it does not send a signal but executes in the context of a process. If it has to yield, it turns F_LOCAL_SIGS_ONLY flag on, which means new signals won't be fetched from the outer message queue. When the same process needs to execute dirty system code (e.g. dirty GC) it has to be run on a dirty scheduler. However signals enqueued into outer queue cause it to be rescheduled on a normal scheduler. F_LOCAL_SIGS_ONLY prevent outer queue signals delivery, creating an endless rescheduling loop. This commit disengages F_LOCAL_SIG_ONLY if process needs to execute dirty code in order to complete signal delivery and allow process to be moved to dirty run queue.
2018-09-04Merge PR-1920 from saleyn/float_to_list OTP-15276Sverker Eriksson
Fix bug in compact representation of float_to_list/2
2018-09-04Implement socket option recvtos and friendsRaimo Niskanen
Implement socket options recvtclass, recvtos, recvttl and pktoptions. Document the implemented socket options, new types and message formats. The options recvtclass, recvtos and recvttl are boolean options that when activated (true) for a socket will cause ancillary data to be received through recvmsg(). That is for packet oriented sockets (UDP and SCTP). The required options for this feature were recvtclass and recvtos, and recvttl was only added to test that the ancillary data parsing handled multiple data items in one message correctly. These options does not work on Windows since ancillary data is not handled by the Winsock2 API. For stream sockets (TCP) there is no clear connection between a received packet and what is returned when reading data from the socket, so recvmsg() is not useful. It is possible to get the same ancillary data through a getsockopt() call with the IPv6 socket option IPV6_PKTOPTIONS, on Linux named IPV6_2292PKTOPTIONS after the now obsoleted RFC where it originated. (unfortunately RFC 3542 that obsoletes it explicitly undefines this way to get packet ancillary data from a stream socket) Linux also has got a way to get packet ancillary data for IPv4 TCP sockets through a getsockopt() call with IP_PKTOPTIONS, which appears to be Linux specific. This implementation uses a flag field in the inet_drv.c socket internal data that records if any setsockopt() call with recvtclass, recvtos or recvttl (IPV6_RECVTCLASS, IP_RECVTOS or IP_RECVTTL) has been activated. If so recvmsg() is used instead of recvfrom(). Ancillary data is delivered to the application by a new return tuple format from gen_udp:recv/2,3 containing a list of ancillary data tuples [{tclass,TCLASS} | {tos,TOS} | {ttl,TTL}], as returned by recvmsg(). For a socket in active mode a new message format, containing the ancillary data list, delivers the data in the same way. For gen_sctp the ancillary data is delivered in the same way, except that the gen_sctp return tuple format already contained an ancillary data list so there are just more possible elements when using these socket options. Note that the active mode message format has got an extra tuple level for the ancillary data compared to what is now implemented gen_udp. The gen_sctp active mode format was considered to be the odd one - now all tuples containing ancillary data are flat, except for gen_sctp active mode. Note that testing has not shown that Linux SCTP sockets deliver any ancillary data for these socket options, so it is probably not implemented yet. Remains to be seen what FreeBSD does... For gen_tcp inet:getopts([pktoptions]) will deliver the latest received ancillary data for any activated socket option recvtclass, recvtos or recvttl, on platforms where IP_PKTOPTIONS is defined for an IPv4 socket, or where IPV6_PKTOPTIONS or IPV6_2292PKTOPTIONS is defined for an IPv6 socket. It will be delivered as a list of ancillary data items in the same way as for gen_udp (and gen_sctp). On some platforms, e.g the BSD:s, when you activate IP_RECVTOS you get ancillary data tagged IP_RECVTOS with the TOS value, but on Linux you get ancillary data tagged IP_TOS with the TOS value. Linux follows the style of RFC 2292, and the BSD:s use an older notion. For RFC 2292 that defines the IP_PKTOPTIONS socket option it is more logical to tag the items with the tag that is the item's, than with the tag that defines that you want the item. Therefore this implementation translates all BSD style ancillary data tags to the corresponding Linux style data tags, so the application will only see the tags 'tclass', 'tos' and 'ttl' on all platforms.
2018-09-03erts: Refactor ets FixedDeletion allocationsSverker Eriksson
2018-09-03erts: Fix ets memstat false leak of FixedDeletionSverker Eriksson
causing erlang:memory to report too much ets memory.
2018-09-03ops.tab: Fix potentially unsafe optimization of raise/2Björn Gustavsson
The operands for the raise/2 instruction are almost always in x(2) and x(1). Therefore the loader translates the raise/2 instruction to an i_raise/0 instruction which uses the values in x(2) and x(1). If the operands happens to be in other registers, the loader inserts move/2 instruction to move them to x(2) and x(1). The problem is that x(3) is used as a temporary register when generating the move/2 instructions. That is unsafe if the Value operand for raise/2 is x(3). Thus: raise x(0) x(3) will be translated to: move x(0) x(3) move x(3) x(1) move x(3) x(2) i_raise The Trace will be written to both x(2) and x(1). The current compiler will never use x(3) for the Value operand, so there is no need to patch previous releases. But a future compiler version might allocate registers differently.
2018-08-31Fix an endless rescheduling loop when a process is executing ↵Maxim Fedorov
process_info(self(), ...) It is possible that a process has to yield before completing process_info BIF when it runs out of reductions. If this BIF is called by the process itself, it does not send a signal but executes in the context of a process. If it has to yield, it turns F_LOCAL_SIGS_ONLY flag on, which means new signals won't be fetched from the outer message queue. When the same process needs to execute dirty system code (e.g. dirty GC) it has to be run on a dirty scheduler. However signals enqueued into outer queue cause it to be rescheduled on a normal scheduler. F_LOCAL_SIGS_ONLY prevent outer queue signals delivery, creating an endless rescheduling loop. This commit disengages F_LOCAL_SIG_ONLY if process needs to execute dirty code in order to complete signal delivery and allow process to be moved to dirty run queue.
2018-08-30Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Update release notes Update version numbers Fix missing 'in' trace events during 'running' trace
2018-08-29Update release notesErlang/OTP
2018-08-29Update version numbersErlang/OTP
2018-08-29Merge branch 'rickard/running-trace-fix/ERL-713/OTP-15269' into maint-21Erlang/OTP
* rickard/running-trace-fix/ERL-713/OTP-15269: Fix missing 'in' trace events during 'running' trace
2018-08-27Fix bug in compact representation of float_to_list/2Serge Aleynikov
2018-08-27Fix missing 'in' trace events during 'running' traceRickard Green
'in' trace events could be lost when a process had to be rescheduled on another scheduler type (normal <-> dirty).
2018-08-21Merge branch 'rickard/fix-suspend-monitor-down/OTP-15237/ERL-704' into maintRickard Green
* rickard/fix-suspend-monitor-down/OTP-15237/ERL-704: Fix incoming suspend monitor down
2018-08-20Fix incoming suspend monitor downRickard Green
An incoming suspend monitor down wasn't handled correct when the local monitor half had been removed with an emulator crash as result.
2018-08-16erts/time_correction.xml: remove extra closing parenthesisMariano Guerra
2018-08-15merge branch 'lukas/erts/fd_driver-fix_pollset_delete/ERL-692/OTP-15236' ↵Lukas Larsson
into maint erts: Delete fd from poll-set when closing fd_driver port
2018-08-11Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Update release notes Update version numbers
2018-08-11Merge branch 'maint-19' into maintRickard Green
* maint-19: Updated OTP version Update release notes Update version numbers syntax_tools: Fix a bug regarding reverting map types.
2018-08-10Update release notesErlang/OTP
2018-08-10Update version numbersErlang/OTP
2018-08-10Merge branch 'rickard/full-cache-nif-env/OTP-15223/ERL-695' into maint-21Erlang/OTP
* rickard/full-cache-nif-env/OTP-15223/ERL-695: Fix caching of NIF environment when executing dirty # Conflicts: # erts/emulator/beam/erl_nif.c
2018-08-10Merge branch 'dotsimon/ref_ordering_bug/OTP-15225' into maint-21Erlang/OTP
* dotsimon/ref_ordering_bug/OTP-15225: Fixed #Ref ordering bug Test #Ref ordering in lists and ets
2018-08-10Merge branch 'maint-20' into maintRickard Green
* maint-20: Updated OTP version Update release notes Update version numbers crypto: Fix crash in compute_key(ecdh, ...) on badarg Relax add_table_copy restriction Fixed #Ref ordering bug Test #Ref ordering in lists and ets Do NOT disc_load from ram_copies when master_node is set ssl: Make sure that a correct cipher suite is selected ssl: Correct handling of empty server SNI extension