1 Kernel Release Notes This document describes the changes made to the Kernel application. 1.1 Kernel 8.4 Fixed Bugs and Malfunctions The DNS resolver implementation has been rewritten to validate replies more thoroughly, and a bit optimized to create less garbage. Own Id: OTP-17323 The socket option 'reuseaddr' is *no longer* ignored on Windows. Own Id: OTP-17447 Aux Id: GH-4819 Fix bug where using the atoms string or report as the format when calling logger:log(Level, Format, Args) (or any other logging function) would cause a crash or incorrect logging. Own Id: OTP-17551 Aux Id: GH-5071 PR-5075 As of OTP 25, global will by default prevent overlapping partitions due to network issues by actively disconnecting from nodes that reports that they have lost connections to other nodes. This will cause fully connected partitions to form instead of leaving the network in a state with overlapping partitions. Prevention of overlapping partitions can be disabled using the prevent_overlapping_partitions kernel(6) parameter, making global behave like it used to do. This is, however, problematic for all applications expecting a fully connected network to be provided, such as for example mnesia, but also for global itself. A network of overlapping partitions might cause the internal state of global to become inconsistent. Such an inconsistency can remain even after such partitions have been brought together to form a fully connected network again. The effect on other applications that expects that a fully connected network is maintained may vary, but they might misbehave in very subtle hard to detect ways during such a partitioning. Since you might get hard to detect issues without this fix, you are strongly advised not to disable this fix. Also note that this fix has to be enabled on all nodes in the network in order to work properly. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-17911 Aux Id: PR-5687, PR-5611, OTP-17843 Starting the helper program for name resolving; inet_gethost, has been improved to use an absolute file system path to ensure that the right program is started. If the helper program can not be started - the system now halts, to avoid running with a silently broken name resolver. Own Id: OTP-17958 Aux Id: OTP-17978 The type specification for inet_res:getbyname/2,3 has been corrected to reflect that it can return peculiar #hostent{} records. Own Id: OTP-17986 Aux Id: PR-5412, PR-5803 code:module_status/1 would always report BEAM files loaded from an archive as modified, and code:modified_modules/0 would always return the name of all modules loaded from archives. Own Id: OTP-17990 Aux Id: GH-5801 In logger fix file handler shutdown delay by using erlang timers instead of the timer module's timers. Own Id: OTP-18001 Aux Id: GH-5780 PR-5829 Fix the meta data in log events generated by logger on failure to not contain the original log event's meta data. Own Id: OTP-18003 Aux Id: PR-5771 Fix logger file backend to re-create the log folder if it has been deleted. Own Id: OTP-18015 Aux Id: GH-5828 PR-5845 [socket] Encode of sockaddr has been improved. Own Id: OTP-18020 Fix put_chars requests to the io server with incomplete unicode data to exit with no_translation error. Own Id: OTP-18070 Aux Id: PR-5885 Improvements and New Features The net module now works on Windows. Own Id: OTP-16464 An Erlang installation directory is now relocatable on the file system given that the paths in the installation's RELEASES file are paths that are relative to the installations root directory. The `release_handler:create_RELEASES/4 function can generate a RELEASES file with relative paths if its RootDir parameter is set to the empty string. Own Id: OTP-17304 The following distribution flags are now mandatory: DFLAG_BIT_BINARIES, DFLAG_EXPORT_PTR_TAG, DFLAG_MAP_TAGS, DFLAG_NEW_FLOATS, and DFLAG_FUN_TAGS. This mainly concerns libraries or application that implement the distribution protocol themselves. Own Id: OTP-17318 Aux Id: PR-4972 Fix os:cmd to work on Android OS. Own Id: OTP-17479 Aux Id: PR-4917 The configuration files .erlang, .erlang.cookie and .erlang.crypt can now be located in the XDG Config Home directory. See the documentation for each file and filename:basedir/2 for more details. Own Id: OTP-17554 Aux Id: GH-5016 PR-5408 OTP-17821 Dynamic node name improvements: erlang:is_alive/0 changed to return true for pending dynamic node name and new function net_kernel:get_state/0. Own Id: OTP-17558 Aux Id: OTP-17538, PR-5111, GH-5402 The types for callback result types in gen_statem has bee augmented with arity 2 types where it is possible for a callback module to specify the type of the callback data, so the callback module can get type validation of it. Own Id: OTP-17589 Aux Id: PR-4926 The tagged tuple tests and fun-calls have been optimized and are now a little bit cheaper than previously. These optimizations become possible after making sure that all boxed terms have at least one word allocated after the arity word. This has been accomplished by letting all empty tuples refer to the same empty tuple literal which also reduces memory usage for empty tuples. Own Id: OTP-17608 A net_ticker_spawn_options kernel configuration parameter with which one can set spawn options for the distribution channel ticker processes has been introduced. Own Id: OTP-17617 Aux Id: PR-5069 The most, or at least the most used, rpc operations now require erpc support in order to communicate with other Erlang nodes. erpc was introduced in OTP 23. That is, rpc operations against Erlang nodes of releases prior to OTP 23 will fail. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-17681 Aux Id: PR-5307 The new module peer supersedes the slave module. The slave module is now deprecated and will be removed in OTP 27. peer contains an extended and more robust API for starting erlang nodes. Own Id: OTP-17720 Aux Id: PR-5162 In order to make it easier for the user to manage multiple outstanding asynchronous call requests, new functionality utilizing request identifier collections have been introduced in erpc, gen_server, gen_statem, and gen_event. Own Id: OTP-17784 Aux Id: PR-5792 Type specifications have been added to the gen_server, and the documentation has been updated to utilize this. This surfaced a few type violations that has been corrected in global, logger_olp and rpc. Own Id: OTP-17915 Aux Id: PR-5751, GH-2375, GH-2690 IP address validation functions is_ipv4_address/1, is_ipv6_address/1 and is_ip_address/1 have been added to the module inet in Kernel. Own Id: OTP-17923 Aux Id: PR-5646 An API for multihomed SCTP connect has been added in the guise of gen_sctp:connectx_init/* Own Id: OTP-17951 Aux Id: PR-5656 [socket] Add encoding of the field hatype of the type sockaddr_ll (family 'packet'). Own Id: OTP-17968 Aux Id: OTP-16464 Added support for configurable features as described in EEP-60. Features can be enabled/disabled during compilation with options (-enable-feature Feature, -disable-feature Feature and +{feature, Feature, enable|disable}) to erlc as well as with directives (-feature(Feature, enable|disable).) in the file. Similar options can be used to erl for enabling/disabling features noahhayes@example.net. The new maybe expression (EEP-49) is fully supported as the feature maybe_expr. The features support is documented in the reference manual. Own Id: OTP-17988 1.2 Kernel 8.3.2 Fixed Bugs and Malfunctions inet:getopts/2 for the 'raw' option for a socket created with inet-backend 'socket' failed. Own Id: OTP-18078 Aux Id: GH-5930 Corrected the behaviour of the shutdown function when using with the inet_backend = socket. It was not sufficiently compatible with the "old" gen_tcp. Own Id: OTP-18080 Aux Id: GH-5930 1.3 Kernel 8.3.1 Fixed Bugs and Malfunctions Fix failed accepted connection setup after previous established connection from same node closed down silently. Own Id: OTP-17979 Aux Id: ERIERL-780 Fixed a problem where typing Ctrl-R in the shell could hang if there were some problem with the history log file. Own Id: OTP-17981 Aux Id: PR-5791 1.4 Kernel 8.3 Fixed Bugs and Malfunctions Handling of send_timeout for gen_tcp has been corrected so that the timeout is honored also when sending 0 bytes. Own Id: OTP-17840 By default global does not take any actions to restore a fully connected network when connections are lost due to network issues. This is problematic for all applications expecting a fully connected network to be provided, such as for example mnesia, but also for global itself. A network of overlapping partitions might cause the internal state of global to become inconsistent. Such an inconsistency can remain even after such partitions have been brought together to form a fully connected network again. The effect on other applications that expects that a fully connected network is maintained may vary, but they might misbehave in very subtle hard to detect ways during such a partitioning. In order to prevent such issues, we have introduced a prevent overlapping partitions fix which can be enabled using the prevent_overlapping_partitions kernel(6) parameter. When this fix has been enabled, global will actively disconnect from nodes that reports that they have lost connections to other nodes. This will cause fully connected partitions to form instead of leaving the network in a state with overlapping partitions. Note that this fix has to be enabled on all nodes in the network in order to work properly. Since this quite substantially changes the behavior, this fix is currently disabled by default. Since you might get hard to detect issues without this fix you are, however, strongly advised to enable this fix in order to avoid issues such as the ones described above. As of OTP 25 this fix will become enabled by default. Own Id: OTP-17843 Aux Id: ERIERL-732, PR-5611 Fix bug where logger would crash when logging a report including improper lists. Own Id: OTP-17851 Make erlang:set_cookie work for dynamic node names. Own Id: OTP-17902 Aux Id: GH-5402, PR-5670 Improvements and New Features Add support for using socket:sockaddr_in() and socket:sockaddr_in6() when using gen_sctp, gen_tcp and gen_udp. This will make it possible to use Link Local IPv6 addresses. Own Id: OTP-17455 Aux Id: GH-4852 A net_tickintensity kernel parameter has been introduced. It can be used to control the amount of ticks during a net_ticktime period. A new net_kernel:start/2 function has also been introduced in order to make it easier to add new options. The use of net_kernel:start/1 has been deprecated. Own Id: OTP-17905 Aux Id: ERIERL-732, PR-5740 Improve documentation for the dynamic node name feature. Own Id: OTP-17918 1.5 Kernel 8.2 Fixed Bugs and Malfunctions socket:which_sockets( pid() ) uses wrong keyword when looking up socket owner ('ctrl' instead of 'owner'). Own Id: OTP-17716 In epmd_ntop, the #if defined(EPMD6) conditional was inverted and it was only including the IPv6-specific code when EPMD6 was undefined. This was causing IPv6 addrs to be interpreted as IPv4 addrs and generating nonsense IPv4 addresses as output. Several places were incorrectly using 'num_sockets' instead of 'i' to index into the iserv_addr array during error logging. This would result in a read into uninitialized data in the iserv_addr array. Thanks to John Eckersberg for providing this fix. Own Id: OTP-17730 Minor fix of the erl_uds_dist distribution module example. Own Id: OTP-17765 Aux Id: PR-5289 A bug has been fixed for the legacy TCP socket adaption module gen_tcp_socket where it did bind to a socket address when given a file descriptor, but should not. Own Id: OTP-17793 Aux Id: PR-5348, OTP-17451, PR-4787, GH-4680, PR-2989, OTP-17216 Improve the error printout when open_port/2 fails because of invalid arguments. Own Id: OTP-17805 Aux Id: PR-5406 Calling socket:monitor/1 on an already closed socket should succeed and result in an immediate DOWN message. This has now been fixed. Own Id: OTP-17806 Fix the configuration option logger_metadata to work. Own Id: OTP-17807 Aux Id: PR-5418 Fix tls and non-tls distribution to use erl_epmd:address_please to figure out if IPv4 or IPv6 addresses should be used when connecting to the remote node. Before this fix, a dns lookup of the remote node hostname determined which IP version was to be used which meant that the hostname had to resolve to a valid ip address. Own Id: OTP-17809 Aux Id: PR-5337 GH-5334 Improvements and New Features Add logger:reconfigure/0. Own Id: OTP-17375 Aux Id: PR-4663 PR-5186 Add socket function ioctl/2,3,4 for socket device control. Own Id: OTP-17528 Add simple support for socknames/1 for gen_tcp_socket and gen_udp_socket. Own Id: OTP-17531 The types for callback result types in gen_statem has bee augmented with arity 2 types where it is possible for a callback module to specify the type of the callback data, so the callback module can get type validation of it. Own Id: OTP-17738 Aux Id: PR-4926, OTP-17589 1.6 Kernel 8.1.3 Fixed Bugs and Malfunctions The internal, undocumented, but used, module inet_dns has been fixed to handle mDNS high bit usage of the Class field. Code that uses the previously obsolete, undocumented and unused record field #dns_rr.func will need to be updated since that field is now used as a boolean flag for the mDNS high Class bit. Code that uses the also undocumented record #dns_query will need to be recompiled since a boolean field #dns_query.unicast_response has been added for the mDNS high Class bit. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-17734 Aux Id: GH-5327, OTP-17659 The fix for Linux's behaviour when reconnecting an UDP socket in PR-5120 released in OTP-24.1.2 has been refined to only dissolve the socket's connection before a connect if the socket is already connected, that is: only for a reconnect. This allows code to open a socket with an ephemeral port, get the port number and connect; without the port number changing (on Linux). This turned out to have at least one valid use case (besides test cases). Should one reconnect the socket then the port number may change, on Linux; it is a known quirk, which can be worked around by binding to a specific port number when opening the socket. If you can do without an ephemeral port, that is... Own Id: OTP-17736 Aux Id: GH-5279, PR-5120, OTP-17559 1.7 Kernel 8.1.2 Fixed Bugs and Malfunctions The undocumented DNS encode/decode module inet_dns has been cleaned up to handle the difference between "symbolic" and "raw" records in a more consistent manner. PR-5145/OTP-17584 introduced a change that contributed to an already existing confusion, which this correction should remedy. Own Id: OTP-17659 Aux Id: ERIERL-702 1.8 Kernel 8.1.1 Fixed Bugs and Malfunctions Add more info about the socket 'type' ('socket' or 'port') for the DOWN message when monitoring sockets. Own Id: OTP-17640 1.9 Kernel 8.1 Fixed Bugs and Malfunctions The extended error information has been corrected and improved for the following BIFs: binary_to_existing_atom/2, list_to_existing_atom/1, erlang:send_after/{3,4}, and erlang:start_timer/{3,4}. Own Id: OTP-17449 Aux Id: GH-4900 Fixed rare bug that could cause net_kernel process to hang for ever. Have seen to happen with massive number of TLS connections while remote nodes are restarting. Bug exists since OTP-22.0. Own Id: OTP-17476 Aux Id: GH-4931, PR-4934 Improve handling of closed sockets for inet:info/1. Own Id: OTP-17492 This change fixes a performance problem introduced in pull-request #2675. Pull-request #2675 made so the system tried to start children of already started applications which is unnecessary. This change fixes this performance problem. Own Id: OTP-17519 Fix code:get_doc/1 to not crash when module is located in an escript. Own Id: OTP-17570 Aux Id: PR-5139 GH-4256 ERL-1261 Parsing of the result value in the native DNS resolver has been made more defensive against incorrect results. Own Id: OTP-17578 Aux Id: ERIERL-683 A bug in the option handling for the legacy socket adaptor, that is; when using inet_backend = socket, has been fixed. Now socket options are set before the bind() call so options regarding, for example address reuse have the desired effect. Own Id: OTP-17580 Aux Id: GH-5122 inet:ntoa/1 has been fixed to not accept invalid numerical addresses. Own Id: OTP-17583 Aux Id: GH-5136 Parsing of DNS records has been improved for records of known types to not accept and present malformed ones in raw format. Own Id: OTP-17584 Aux Id: PR-5145 The ip_mreq() type for the {ip,add_membership} and {ip,drop_membership} socket options has been corrected to have an interface field instead of, incorrectly, an address field. Own Id: OTP-17590 Aux Id: PR-5170 Improvements and New Features Add simple utility function to display existing sockets i the erlang shell (socket:i/0). Own Id: OTP-17376 Aux Id: OTP-17157 gen_udp can now be configured to use the socket inet-backend (in the same way as gen_tcp). Own Id: OTP-17410 Functions erlang:set_cookie(Cookie) and erlang:get_cookie(Node) have been added for completeness and to facilitate configuring distributed nodes with different cookies. The documentation regarding distribution cookies has been improved to be less vague. Own Id: OTP-17538 Aux Id: GH-5063, PR-5111 A workaround has been implemented for Linux's quirky behaviour to not adjust the source IP address when connecting a connected (reconnecing) UDP socket. The workaround is to, on Linux, always dissolve any connection before connecting an UDP socket. Own Id: OTP-17559 Aux Id: GH-5092, PR-5120 Documented our recommendation against opening NFS-mounted files, FIFOs, devices, and similar using file:open/2. Own Id: OTP-17576 Aux Id: ERIERL-685 1.10 Kernel 8.0.2 Fixed Bugs and Malfunctions For gen_tcp:connect/3,4 it is possible to specify a specific source port, which should be enough to bind the socket to an address with that port before connecting. Unfortunately that feature was lost in OTP-17216 that made it mandatory to specify the source address to get an address binding, and ignored a specified source port if no source address was specified. That bug has now been corrected. Own Id: OTP-17536 Aux Id: OTP-17216, ERIERL-677 1.11 Kernel 8.0.1 Fixed Bugs and Malfunctions Fix a race condition in Global. Own Id: OTP-16033 Aux Id: ERIERL-329, ERL-1414, GH-4448, ERL-885, GH-3923 After a node restart with init:restart/0,1, the module socket was not usable because supporting tables had been cleared and not re-initialized. This has now been fixed. Handling of the "." domain as a search domain was incorrect and caused a crash in the DNS resolver inet_res, which has now been fixed. Own Id: OTP-17439 Aux Id: GH-4827, PR-4888, GH-4838 Handling of combinations of the fd option and binding to an address has been corrected, especially for the local address family. Own Id: OTP-17451 Aux Id: OTP-17374 Bug fixes and code cleanup for the new socket implementation, such as: Assertions on the result of demonitoring has been added in the NIF code, where appropriate. Internal state handling for socket close in the NIF code has been reviewed. Looping over close() for EINTR in the NIF code has been removed, since it is strongly discouraged on Linux and Posix is not clear about if it is allowed. The inet_backend temporary socket option for legacy gen_tcp sockets has been documented. The return value from net:getaddrinfo/2 has been corrected: the protocol field is now an atom(), instead of, incorrectly, list(atom()). The documentation has also been corrected about this return type. Deferred close of a socket:sendfile/* file was broken and has been corrected. Some debug code, not enabled by default, in the socket NIF has been corrected to not accidentally core dump for debug printouts of more or less innocent events. Own Id: OTP-17452 1.12 Kernel 8.0 Fixed Bugs and Malfunctions A bug has been fixed for the internal inet_res resolver cache that handled a resolver configuration file status timer incorrectly and caused performance problems due to many unnecessary file system accesses. Own Id: OTP-14700 Aux Id: PR-2848 Change the value of the tag head returned by disk_log:info/1 from {ok, Head} to just Head. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-16809 Aux Id: ERL-1313 Two options have been added to erl_call. The -fetch_stdout option fetches stdout data resulting from the code invoked by erl_call. The -fetch_stdout option disables printing of the result term. In order to implement the first of these two options a new function called ei_xrpc_from has been added to erl_interface. For details see the erl_call documentation and erl_interface documentation. Own Id: OTP-17132 Missing runtime dependencies has been added to this application. Own Id: OTP-17243 Aux Id: PR-4557 inet:get_rc/0 has been corrected to return host entries as separate entries instead of (incorrectly) in a list within the list. This bug was introduced by OTP-16487 in OTP-23.0-rc1. Own Id: OTP-17262 Aux Id: GH-4588, PR-4604, OTP-16487 The type gen_tcp:option_name() had a duplicate pktoptions value. Own Id: OTP-17277 Fixed removal of empty groups from internal state in pg. Own Id: OTP-17286 Aux Id: PR-4619 erl -remsh now prints an error message when it fails to connect to the remote node. Own Id: OTP-17287 Aux Id: PR-4581 Fix bugs related to corrupt shell history files. Error messages printed by shell history are now logged as logger error reports instead of written to standard error. Own Id: OTP-17288 Aux Id: PR-4581 A logger warning is now issues when too many arguments are given to -name or -sname. Example: erl -name a b. Own Id: OTP-17315 Aux Id: GH-4626 The cache used by inet_res now, again, can handle multiple IP addresses per domain name, and thus fixes a bug introduced in PR-3041 (OTP-13126) and PR-2891 (OTP-14485). Own Id: OTP-17344 Aux Id: PR-4633, GH-4631, OTP-14485, OTP-12136 Sockets created with socket:accept not counted (socket:info/0). Own Id: OTP-17372 The {fd, Fd} option to gen_tcp:listen/2 did not work for inet_backend socket, which has been fixed. Own Id: OTP-17374 Aux Id: PR-4787, GH-4680, PR-2989, OTP-17216 Improvements and New Features The cache used by the DNS resolver inet_res has been improved to use ETS lookups instead of server calls. This is a considerable speed improvement for cache hits. Own Id: OTP-13126 Aux Id: PR-3041 The cache ETS table type for the internal DNS resolver inet_res has changed type (internally) to get better speed and atomicity. Own Id: OTP-14485 Aux Id: PR-2891 The experimental socket module can now use any protocol (by name) the OS supports. Suggested in PR-2641, implemented in PR-2670. Own Id: OTP-14601 Aux Id: PR-2641, PR-2670, OTP-16749 The DNS resolver inet_res has been updated to support CAA (RFC 6844) and URI (RFC 7553) records. Own Id: OTP-16517 Aux Id: PR-2827 A compatibility adaptor for gen_tcp to use the new socket API has been implemented (gen_tcp_socket). Used when setting the kernel application variable inet_backend = socket. Own Id: OTP-16611 Aux Id: OTP-16749 Extended error information for failing BIF calls as proposed in EEP 54 has been implemented. When a BIF call from the Erlang shell fails, more information about which argument or arguments that were in error will be printed. The same extended error information will by proc_lib, common_test, and qlc when BIF calls fail. For applications that wish to provide the same extended error information, there are new functions erl_error:format_exception/3 and erl_error:format_exception/4. There is a new error/3 BIF that allows applications or libraries to provide extended error information in the same way for their own exceptions. Own Id: OTP-16686 The file server can now be bypassed in file:delete/1,2 with the raw option. Own Id: OTP-16698 Aux Id: PR-2634 An example implementation of Erlang distribution over UDS using distribution processes has been introduced. Thanks to Jérôme de Bretagne Own Id: OTP-16703 Aux Id: PR-2620 The process alias feature as outlined by EEP 53 has been introduced. It is introduced in order to provide a lightweight mechanism that can prevent late replies after timeout or connection loss. For more information, see EEP 53 and the documentation of the new alias/1 BIF and the new options to the monitor/3 BIF. The call operation in the framework used by gen_server, gen_statem, and gen_event has been updated to utilize alias in order to prevent late responses. The gen_statem behavior still use a proxy process in the distributed case, since it has always prevented late replies and aliases won't work against pre OTP 24 nodes. The proxy process can be removed in OTP 26. The alias feature also made it possible to introduce new functions similar to the erpc:receive_response() function in the gen behaviors, so the new functions gen_server:receive_response(), gen_statem:receive_response(), gen_event:receive_response() have also been introduced. Own Id: OTP-16718 Aux Id: PR-2735 The experimental new socket API has been further developed. Some backwards incompatible changes with respect to OTP 23 have been made. The control message format has been changed so a decoded value is now in the 'value' field instead of in the 'data' field. The 'data' field now always contains binary data. Some type names have been changed regarding message headers and control message headers. socket:bind/2 now returns plain ok instead of {ok, Port} which was only relevant for the inet and inet6 address families and often not interesting. To find out which port was chosen use socket:sockname/1. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-16749 Aux Id: OTP-14601 New function os:env/0 returns all OS environment variables as a list of 2-tuples. Own Id: OTP-16793 Aux Id: ERL-1332, PR-2740 Remove the support for distributed disk logs. The new function disk_log:all/0 is to be used instead of disk_log:accessible_logs/0. The function disk_log:close/1 is to be used instead of disk_log:lclose/1,2. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-16811 Expand the spec for erl_epmd:listen_port_please/2 to mirror erl_epmd:port_please/2. Own Id: OTP-16947 Aux Id: PR-2781 A new erl parameter for specifying a file descriptor with configuration data has been added. This makes it possible to pass the parameter "-configfd FD" when executing the erl command. When this option is given, the system will try to read and parse configuration parameters from the file descriptor. Own Id: OTP-16952 The experimental HiPE application has been removed, together with all related functionality in other applications. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-16963 The pg2 module has been removed. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-16968 Accept references up to a size of 160-bits from remote nodes. This is the first step in an upgrade path toward using references up to 160-bits in a future OTP release. Own Id: OTP-17005 Aux Id: OTP-16718 Allow utf-8 binaries as parts of logger_formatter template. Own Id: OTP-17015 Let disk_log:open/1 change the size if a wrap log is opened for the first time, that is, the disk log process does not exist, and the value of option size does not match the current size of the disk log. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-17062 Aux Id: ERL-1418, GH-4469, ERIERL-537 Allow the shell history of an erlang node to be fetched and stores using a custom callback module. See shell_history configuration parameter in the kernel documentation for more details. Own Id: OTP-17103 Aux Id: PR-2949 The simple logger (used to log events that happen before kernel has been started) has been improved to print prettier error messages. Own Id: OTP-17106 Aux Id: PR-2885 socket:sendfile/2,3,4,5 has been implemented, for platforms that support the underlying socket library call. Own Id: OTP-17154 Aux Id: OTP-16749 Add socket monitor(s) for all types sockets. Own Id: OTP-17155 Fix various issues with the gen_tcp_socket. Including documenting some incompatibilities. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-17156 inet:i/0 now also shows existing gen_tcp compatibility sockets (based on 'socket'). Own Id: OTP-17157 Added support in logger for setting primary metadata. The primary metadata is passed as a base metadata to all log events in the system. See Metadata in the Logger chapter of the Kernel User's Guide for more details. Own Id: OTP-17181 Aux Id: PR-2457 Recognize new key 'optional_applications' in application resource files. Own Id: OTP-17189 Aux Id: PR-2675 The Fun's passed to logger:log/2,3,4 can now return metadata that will only be fetched when needed. See logger:log/2,3,4 for more details. Own Id: OTP-17198 Aux Id: PR-2721 erpc:multicall() has been rewritten to be able to utilize the newly introduced and improved selective receive optimization. Own Id: OTP-17201 Aux Id: PR-4534 Add utility fiunction inet:info/1 to provide miscellaneous info about a socket. Own Id: OTP-17203 Aux Id: OTP-17156 The behaviour for gen_tcp:connect/3,4 has been changed to not per default bind to an address, which allows the network stack to delay the address and port selection to when the remote address is known. This allows better port re-use, and thus enables far more outgoing connections, since the ephemeral port range no longer has to be a hard limit. There is a theoretical possibility that this behaviour change can affect the set of possible error values, or have other small implications on some platforms. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-17216 Aux Id: PR-2989 An option {nxdomain_reply, boolean()} has been implemented in the DNS resolver inet_res. It is useful since an nxdomain error from a name server does contain the SOA record if the domain noahhayes@example.net. This record is useful to determine a TTL for negative caching of the failed entry. Own Id: OTP-17266 Aux Id: PR-4564 Optimized lookup of local processes part of groups in pg. Own Id: OTP-17284 Aux Id: PR-4615 The return values from module socket functions send(), sendto(), sendmsg(), sendfile() and recv() has been changed to return a tuple tagged with select when a SelectInfo was returned, and not sometimes tagged with ok. This is a backwards incompatible change that improves usability for code using asynchronous operations. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-17355 Aux Id: OTP-17154 Fixed warnings in code matching on underscore prefixed variables. Own Id: OTP-17385 Aux Id: OTP-17123 1.13 Kernel (336)487-6214 Fixed Bugs and Malfunctions By default global does not take any actions to restore a fully connected network when connections are lost due to network issues. This is problematic for all applications expecting a fully connected network to be provided, such as for example mnesia, but also for global itself. A network of overlapping partitions might cause the internal state of global to become inconsistent. Such an inconsistency can remain even after such partitions have been brought together to form a fully connected network again. The effect on other applications that expects that a fully connected network is maintained may vary, but they might misbehave in very subtle hard to detect ways during such a partitioning. In order to prevent such issues, we have introduced a prevent overlapping partitions fix which can be enabled using the prevent_overlapping_partitions kernel(6) parameter. When this fix has been enabled, global will actively disconnect from nodes that reports that they have lost connections to other nodes. This will cause fully connected partitions to form instead of leaving the network in a state with overlapping partitions. Note that this fix has to be enabled on all nodes in the network in order to work properly. Since this quite substantially changes the behavior, this fix is currently disabled by default. Since you might get hard to detect issues without this fix you are, however, strongly advised to enable this fix in order to avoid issues such as the ones described above. As of OTP 25 this fix will become enabled by default. Own Id: OTP-17843 Aux Id: ERIERL-732, PR-5611 Fix failed accepted connection setup after previous established connection from same node closed down silently. Own Id: OTP-17979 Aux Id: ERIERL-780 Improvements and New Features A net_tickintensity kernel parameter has been introduced. It can be used to control the amount of ticks during a net_ticktime period. A new net_kernel:start/2 function has also been introduced in order to make it easier to add new options. The use of net_kernel:start/1 has been deprecated. Own Id: OTP-17905 Aux Id: ERIERL-732, PR-5740 1.14 Kernel (336)487-6214 Fixed Bugs and Malfunctions Parsing of the result value in the native DNS resolver has been made more defensive against incorrect results. Own Id: OTP-17578 Aux Id: ERIERL-683 1.15 Kernel (336)487-6214 Fixed Bugs and Malfunctions Fix code:get_doc/1 to not crash when module is located in an escript. Own Id: OTP-17570 Aux Id: PR-5139 GH-4256 ERL-1261 1.16 Kernel (336)487-6214 Fixed Bugs and Malfunctions Handling of the "." domain as a search domain was incorrect and caused a crash in the DNS resolver inet_res, which has now been fixed. Own Id: OTP-17473 Aux Id: GH-4838, OTP-17439 Fixed rare bug that could cause net_kernel process to hang for ever. Have seen to happen with massive number of TLS connections while remote nodes are restarting. Bug exists since OTP-22.0. Own Id: OTP-17476 Aux Id: GH-4931, PR-4934 1.17 Kernel (336)487-6214 Fixed Bugs and Malfunctions Fix a race condition in Global. Own Id: OTP-16033 Aux Id: ERIERL-329, ERL-1414, GH-4448, ERL-885, GH-3923 1.18 Kernel 7.3.1 Fixed Bugs and Malfunctions A bug in the Erlang DNS resolver has been fixed, where it could be made to bring down the kernel supervisor and thereby the whole node, when getting an incorrect (IN A reply to an IN CNAME query) reply from the DNS server and used the reply record's value without verifying its type. Own Id: OTP-17361 1.19 Kernel 7.3 Fixed Bugs and Malfunctions The range check for compression pointers in DNS encoding was faulty, which caused incorrect label compression encoding for very large DNS messages; larger than about 16 kBytes, such as AXFR responses. This more than 11 year old bug has now been corrected. Own Id: OTP-13641 Aux Id: PR-2959 Fix of internal links in the erpc documentation. Own Id: OTP-17202 Aux Id: PR-4516 Fix bug where complex seq_trace tokens (that is lists, tuples, maps etc) could becomes corrupted by the GC. The bug was introduced in OTP-21. Own Id: OTP-17209 Aux Id: PR-3039 When running Xref in the modules mode, the Debugger application would show up as a dependency for the Kernel applications. Own Id: OTP-17223 Aux Id: GH-4546, PR-4554 Improvements and New Features erl_epmd (the epmd client) will now try to reconnect to the local EPMD if the connection is broken. Own Id: OTP-17178 Aux Id: PR-3003 1.20 Kernel 7.2.1 Fixed Bugs and Malfunctions When using the DNS resolver option servfail_retry_timeout it did not honour the overall call time-out in e.g inet_res:getbyname/3. This misbehaviour has now been fixed. Also, the servfail_retry_timeout behaviour has been improved to only be enforced for servers that gives a servfail answer. Own Id: OTP-12960 Aux Id: ERIERL-598, PR-4509 1.21 Kernel 7.2 Fixed Bugs and Malfunctions The apply call's in logger.hrl are now called with erlang prefix to avoid clashed with local apply/3 functions. Own Id: OTP-16976 Aux Id: PR-2807 Fix memory leak in pg. Own Id: OTP-17034 Aux Id: PR-2866 Fix crash in logger_proxy due to stray gen_server:call replies not being handled. The stray replies come when logger is under heavy load and the flow control mechanism is reaching its limit. Own Id: OTP-17038 Fixed a bug in erl_epmd:names() that caused it to return the illegal return value noport instead of {error, Reason} where Reason is the actual error reason. This bug also propagated to net_adm:names(). This bug was introduced in kernel version 7.1 (OTP 23.1). Own Id: OTP-17054 Aux Id: ERL-1424 Improvements and New Features Add export of some resolver documented types. Own Id: OTP-16954 Aux Id: ERIERL-544 Add configurable retry timeout for resolver lookups. Own Id: OTP-16956 Aux Id: ERIERL-547 gen_server:multi_call() has been optimized in the special case of only calling the local node with timeout set to infinity. Own Id: OTP-17058 Aux Id: PR-2887 1.22 Kernel 7.1 Fixed Bugs and Malfunctions A fallback has been implemented for file:sendfile when using inet_backend socket Own Id: OTP-15187 Aux Id: ERL-1293 Make default TCP distribution honour option backlog in inet_dist_listen_options. Own Id: OTP-16694 Aux Id: PR-2625 Raw option handling for the experimental gen_tcp_socket backend was broken so that all raw options were ignored by for example gen_tcp:listen/2, a bug that now has been fixed. Reported by Jan Uhlig. Own Id: OTP-16743 Aux Id: ERL-1287 Accept fails with inet-backend socket. Own Id: OTP-16748 Aux Id: ERL-1284 Fixed various minor errors in the socket backend of gen_tcp. Own Id: OTP-16754 Correct disk_log:truncate/1 to count the header. Also correct the documentation to state that disk_log:truncate/1 can be used with external disk logs. Own Id: OTP-16768 Aux Id: ERL-1312 Fix erl_epmd:port_please/2,3 type specs to include all possible error values. Own Id: OTP-16783 Fix erl -erl_epmd_port to work properly. Before this fix it did not noahhayes@example.net. Own Id: OTP-16785 Fix typespec for internal function erlang:seq_trace_info/1 to allow term() as returned label. This in turn fixes so that calls to seq_trace:get_token/1 can be correctly analyzer by dialyzer. Own Id: OTP-16823 Aux Id: PR-2722 Fix erroneous double registration of processes in pg when distribution is dynamically started. Own Id: OTP-16832 Aux Id: PR-2738 Improvements and New Features Make (use of) the socket registry optional (still enabled by default). Its now possible to build OTP with the socket registry turned off, turn it off by setting an environment variable and controlling in runtime (via function calls and arguments when creating sockets). Own Id: OTP-16763 erl -remsh nodename no longer requires the hostname to be given when used together with dynamic nodenames. Own Id: OTP-16784 1.23 Kernel 7.0 Fixed Bugs and Malfunctions Fix race condition during shutdown when shell_history is enabled. The race condition would trigger crashes in disk_log. Own Id: OTP-16008 Aux Id: PR-2302 Fix the Erlang distribution to handle the scenario when a node connects that can handle message fragmentation but can not handle the atom cache. This bug only affects users that have implemented a custom distribution carrier. It has been present since OTP-21. The DFLAG_FRAGMENT distribution flag was added to the set of flags that can be rejected by a distribution implementation. Own Id: OTP-16284 Fix bug where a binary was not allowed to be the format string in calls to logger:log. Own Id: OTP-16395 Aux Id: PR-2444 Fix bug where logger would end up in an infinite loop when trying to log the crash of a handler or formatter. Own Id: OTP-16489 Aux Id: ERL-1134 code:lib_dir/1 has been fixed to also return the lib dir for erts. This is been marked as an incompatibility for any application that depended on {error,bad_name} to be returned for erts. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-16502 The application stop/1 callback was not called if the application master of the application terminated. Own Id: OTP-16504 Aux Id: PR-2328 Fix bug in application:loaded_applications/0 that could cause it to fail with badarg if for example a concurrent upgrade/downgrade is running. Own Id: OTP-16627 Aux Id: PR-2601 Improvements and New Features A new module erpc has been introduced in the kernel application. The erpc module implements an enhanced subset of the operations provided by the rpc module. Enhanced in the sense that it makes it possible to distinguish between returned value, raised exceptions, and other errors. erpc also has better performance and scalability than the original rpc implementation. This by utilizing the newly introduced spawn_request() BIF. Also the rpc module benefits from these improvements by utilizing erpc when it is possible. This change has been marked as a potential incompatibility since rpc:block_call() now only is guaranteed to block other block_call() operations. The documentation previously claimed that it would block all rpc operations. This has however never been the case. It previously did not block node-local block_call() operations. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-13450 Aux Id: OTP-15251 A client node can receive its node name dynamically from the node that it first connects to. This featured can by used by starting with erl -sname undefined erl_interface functions ei_connect_init and friends erl_call -R Own Id: OTP-13812 Improved the printout of single line logger events for most of the OTP behaviours in STDLIB and Kernel. This includes proc_lib, gen_server, gen_event, gen_statem, gen_fsm, supervisor, supervisor_bridge and application. Improved the chars_limit and depth handling in proc_lib and when formatting of exceptions. Own Id: OTP-15299 Remove usage and documentation of old requests of the I/O-protocol. Own Id: OTP-15695 Directories can now be opened by file:open/2 when passing the directory option. Own Id: OTP-15835 Aux Id: PR-2212 The check of whether to log or not based on the log level in logger has been optimized by using persistent_term to store the log level. Own Id: OTP-15948 Aux Id: PR-2356 file:read_file_info/2 can now be used on opened files and directories. Own Id: OTP-15956 Aux Id: PR-2231 The -config option to erl now can take multiple config files without repeating the -config option. Example: erl -config sys local Own Id: OTP-16148 Aux Id: PR-2373 Improved node connection setup handshake protocol. Made possible to agree on protocol version without dependence on epmd or other prior knowledge of peer node version. Also added exchange of node incarnation ("creation") values and expanded the distribution capability flag field from 32 to 64 bits. Own Id: OTP-16229 The possibility to run Erlang distribution without relying on EPMD has been extended. To achieve this a couple of new options to the inet distribution has been added. -dist_listen false Setup the distribution channel, but do not listen for incoming connection. This is useful when you want to use the current node to interact with another node on the same machine without it joining the entire cluster. -erl_epmd_port Port Configure a default port that the built-in EPMD client should return. This allows the local node to know the port to connect to for any other node in the cluster. The erl_epmd callback API has also been extended to allow returning -1 as the creation which means that a random creation will be created by the node. In addition a new callback function called listen_port_please has been added that allows the callback to return which listen port the distribution should use. This can be used instead of inet_dist_listen_min/max if the listen port is to be fetched from an external service. Own Id: OTP-16250 A first EXPERIMENTAL module that is a socket backend to gen_tcp and inet has been implemented. Others will follow. Feedback will be appreciated. Own Id: OTP-16260 Aux Id: OTP-15403 The new experimental socket module has been moved to the Kernel application. Own Id: OTP-16312 Replace usage of deprecated function in the group module. Own Id: OTP-16345 Minor updates due to the new spawn improvements made. Own Id: OTP-16368 Aux Id: OTP-15251 Update of sequential tracing to also support other information transfers than message passing. Own Id: OTP-16370 Aux Id: OTP-15251, OTP-15232 code:module_status/1 now accepts a list of modules. code:module_status/0, which returns the statuses for all loaded modules, has been added. Own Id: OTP-16402 filelib:wildcard/1,2 is now twice as fast when a double star (**) is part of the pattern. Own Id: OTP-16419 A new implementation of distributed named process groups has been introduced. It is available in the pg module. Note that this pg module only has the name in common with the experimental pg module that was present in stdlib up until OTP 17. Thanks to Maxim Fedorov for the implementation. Own Id: OTP-16453 Aux Id: PR-2524 The pg2 module has been deprecated. It has also been scheduled for removal in OTP 24. You are advised to replace the usage of pg2 with the newly introduced pg module. pg has a similar API, but with a more scalable implementation. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-16455 Refactored the internal handling of deprecated and removed functions. Own Id: OTP-16469 The internal hosts file resolver cache inet_hosts has been rewritten to behave better when the hosts file changes. For example the cache is updated per entry instead of cleared and reloaded so lookups do not temporarily fail during reloading, and; when multiple processes simultaneously request reload these are now folded into one instead of all done in sequence. Reported and first solution suggestion by Maxim Fedorov. Own Id: OTP-16487 Aux Id: PR-2516 Add code:all_available/0 that can be used to get all available modules. Own Id: OTP-16494 As of OTP 23, the distributed disk_log feature has been deprecated. It has also been scheduled for removal in OTP 24. *** POTENTIAL INCOMPATIBILITY *** Own Id: OTP-16495 Add the function code:fetch_docs/1 for fetching embedded documentation for aa Erlang module. Own Id: OTP-16499 Improve configure for the net nif, which should increase portability. Own Id: OTP-16530 Aux Id: OTP-16464 socket: Socket counters and socket global counters are now represented as maps (instead of property lists). Own Id: OTP-16535 The experimental socket module has gotten restrictions removed so now the 'seqpacket' socket type should work for any communication domain (protocol family) where the OS supports it, typically the Unix Domain. Own Id: OTP-16550 Aux Id: ERIERL-476 Allow using custom IO devices in logger_std_h. Own Id: OTP-16563 Aux Id: PR-2523 Added file:del_dir_r/1 which deletes a directory together with all of its contents, similar to rm -rf on Unix systems. Own Id: OTP-16570 Aux Id: PR-2565 socket: By default the socket options rcvtimeo and sndtimeo are now disabled. To enable these, OTP now has to be built with the configure option --enable-esock-rcvsndtimeo Own Id: OTP-16620 The experimental gen_tcp compatibility code utilizing the socket module could loose buffered data when receiving a specified number of bytes. This bug has been fixed. Reported by Maksim Lapshin on bugs.erlang.org ERL-1234 Own Id: OTP-16632 Aux Id: ERL-1234 1.24 Kernel (336)487-6214 Fixed Bugs and Malfunctions By default global does not take any actions to restore a fully connected network when connections are lost due to network issues. This is problematic for all applications expecting a fully connected network to be provided, such as for example mnesia, but also for global itself. A network of overlapping partitions might cause the internal state of global to become inconsistent. Such an inconsistency can remain even after such partitions have been brought together to form a fully connected network again. The effect on other applications that expects that a fully connected network is maintained may vary, but they might misbehave in very subtle hard to detect ways during such a partitioning. In order to prevent such issues, we have introduced a prevent overlapping partitions fix which can be enabled using the prevent_overlapping_partitions kernel(6) parameter. When this fix has been enabled, global will actively disconnect from nodes that reports that they have lost connections to other nodes. This will cause fully connected partitions to form instead of leaving the network in a state with overlapping partitions. Note that this fix has to be enabled on all nodes in the network in order to work properly. Since this quite substantially changes the behavior, this fix is currently disabled by default. Since you might get hard to detect issues without this fix you are, however, strongly advised to enable this fix in order to avoid issues such as the ones described above. As of OTP 25 this fix will become enabled by default. Own Id: OTP-17843 Aux Id: ERIERL-732, PR-5611 Improvements and New Features A net_tickintensity kernel parameter has been introduced. It can be used to control the amount of ticks during a net_ticktime period. A new net_kernel:start/2 function has also been introduced in order to make it easier to add new options. The use of net_kernel:start/1 has been deprecated. Own Id: OTP-17905 Aux Id: ERIERL-732, PR-5740 1.25 Kernel (336)487-6214 Fixed Bugs and Malfunctions Fixed rare bug that could cause net_kernel process to hang for ever. Have seen to happen with massive number of TLS connections while remote nodes are restarting. Bug exists since OTP-22.0. Own Id: OTP-17476 Aux Id: GH-4931, PR-4934 1.26 Kernel (336)487-6214 Fixed Bugs and Malfunctions Fix a race condition in Global. Own Id: OTP-16033 Aux Id: ERIERL-329, ERL-1414, GH-4448, ERL-885, GH-3923 1.27 Kernel (336)487-6214 Fixed Bugs and Malfunctions When running Xref in the modules mode, the Debugger application would show up as a dependency for the Kernel applications. Own Id: OTP-17223 Aux Id: GH-4546, PR-4554 1.28 Kernel (336)487-6214 Fixed Bugs and Malfunctions Fix bug in application:loaded_applications/0 that could cause it to fail with badarg if for example a concurrent upgrade/downgrade is running. Own Id: OTP-16627 Aux Id: PR-2601 1.29 Kernel 6.5.2 Fixed Bugs and Malfunctions The DNS resolver `inet_res` has been fixed to return the last intermediate error when subsequent requests times out. Own Id: OTP-16414 Aux Id: ERIERL-452 The prim_net nif (net/kernel) made use of an undefined atom, notsup. This has now been corrected. Own Id: OTP-16440 Fix a crash when attempting to log faults when loading files during early boot. Own Id: OTP-16491 Fix crash in logger when logging to a remote node during boot. Own Id: OTP-16493 Aux Id: ERIERL-459 Improvements and New Features Improved net_kernel debug functionality. Own Id: OTP-16458 Aux Id: PR-2525 1.30 Kernel 6.5.1 Fixed Bugs and Malfunctions The 'socket state' info provided by the inet info function has been improved Own Id: OTP-16043 Aux Id: ERL-1036 Fix bug where logger would crash when starting when a very large log file needed to be rotated and compressed. Own Id: OTP-16145 Aux Id: ERL-1034 Fixed a bug causing actual nodedown reason reported by net_kernel:monitor_nodes(true, [nodedown_reason]) to be lost and replaced by the reason killed. Own Id: OTP-16216 The documentation for rpc:call/4,5/ has been updated to describe what happens when the called function throws or return an 'EXIT' tuple. Own Id: OTP-16279 Aux Id: ERL-1066 1.31 Kernel 6.5 Fixed Bugs and Malfunctions The type specification for gen_sctp:connect/4,5 has been corrected. Own Id: OTP-15344 Aux Id: ERL-947 Extra -mode flags given to erl are ignored with a warning. Own Id: OTP-15852 Fix type spec for seq_trace:set_token/2. Own Id: OTP-15858 Aux Id: ERL-700 logger:compare_levels/2 would fail with a badarg exception if given the values all or none as any of the parameters. This is now corrected. Own Id: OTP-15942 Aux Id: PR-2301 Fix bug where the log file in logger_std_h would not be closed when the inode of the file changed. This would in turn cause a file descriptor leak when tools like logrotate are used. Own Id: OTP-15997 Aux Id: PR-2331 Fix a race condition in the debugging function net_kernel:nodes_info/0. Own Id: OTP-16022 Fix race condition when closing a file opened in compressed or delayed_write mode. Own Id: OTP-16023 Improvements and New Features The possibility to send ancillary data, in particular the TOS field, has been added to gen_udp:send/4,5. Own Id: OTP-15747 Aux Id: ERIERL-294 If the log file was given with relative path, the standard logger handler (logger_std_h) would store the file name with relative path. If the current directory of the node was later changed, a new file would be created relative the new current directory, potentially failing with
{'path': 'public/docs/erlang~25/lib/kernel-8.4/doc/html/notes.html', 'source': 'DevDocs.IO'}