# Kernel Release Notes

## Kernel 2.9

### Fixed errors and malfunctions

- After a release upgrade, not all applications keys were updated. This has been corrected and all keys, as specified in the `.app` file, are now updated. This means `application:get_all_key/0,1` and `application:get_key/1,2` now returns up-to-date values also after a release upgrade.
  (Own Id: OTP-4330)
  (Aux Id: seq7346)

- The options 'append' is no longer allowed together with 'compressed' to file:open/2 (previously ignored). And directories can no longer be opened with file:open/2 by using the 'compressed' flag.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4536)

- Previously unexpected return values when calling gen_tcp:connect/3 with invalid Options values has been changed so the function exits when the option list contains invalid options, or is not a list.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4567)

- If the shell process terminated during a user session, the shell simply freezed. Now an error message is printed out and - for local shell sessions - the shell process is restarted.
  (Own Id: OTP-4615)
  (Aux Id: seq7725)

- Some more options for gen_tcp:connect/3,4, gen_tcp:listen/2, and gen_udp:open/3,4 are now documented.
  (Own Id: OTP-4634)

- A new class of error messages "warnings" are added. Warnings can be mapped to either error reports (the default), Info reports or a new class of reports, namely "warning reports". Non severe errors in OTP will be reported as warnings instead of forcing error reports.
  (Own Id: OTP-4638)
  (Aux Id: seq7788)

- The `gen_tcp:shutdown/2` function has been added. To handle shutdown from the other side, the option `{exit_on_close, true|false}` has been added to the `inet:setops/2` function.
  (Own Id: OTP-4664)

- A deadlock could occur if a disk log was opened and closed by two processes at the same time.
  (Own Id: OTP-4752)
  (Aux Id: seq7902)

- The BIF erlang:hibernate/3 allows a process to shrink its memory consumption while waiting for messages.
  (Own Id: OTP-4727)

- A code path cache has been implemented; it can be activated with code:rehash/0.
  (Own Id: OTP-4741)

### Improvements and new features

- A new function erlang:send/3 has been added to give more control to when to send if the sender risks being suspended or delayed due to automatic node connection. This function supersedes erlang:send_nosuspend/2,3, which is retained for backward compatibility, and has been upgraded to handle local processes and ports. See the documentation.

  The function gen_server:cast/2 (and hence gen_server:abcast/2) has been corrected to not get stuck waiting for automatic node connection; if a node has to be connected for the cast to be sent, a helper process is spawned to do the send so that execution flow can return to the sender immediately.
  (Own Id: OTP-3968)
  (Aux Id: Seq 4387)

- Support for zombies has been removed. `erlang:system_flag/2` will no longer accept the `keep_zombies` argument. `process_info/2` will no longer accept the `exit` option (which was used to retrieve the exit reason for a zombie process).
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4523)

- The `disk_log` module has been slightly changed for the purpose of reducing the risk of memory problems due to corrupt files. The `chunk` commands have been optimized by increasing the chunk size from 8 kilobytes to 64 kilobytes.
  (Own Id: OTP-4530)
  (Aux Id: seq7646)

- The '{active,once}' option for `inet:setopts/2` is now documented.
  (Own Id: OTP-4573)

- A variant of rpc:multicall with timeout is added, and gen_server:multi_call has been fixed to discard late answers.
  (Own Id: OTP-4586)

- The cursor keys of VT compatible terminals works like the emacs control sequences for cursor positioning in the erlang interactive shell.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4613)
  (Aux Id: seq7691)

- erlang:memory/0 and erlang:memory/1 have been added. erlang:memory/[0,1] return the same type of information as c:memory/[0,1] previously did. The erlang:memory/[0,1] functions operate in constant time. c:memory/[0,1] now use erlang:memory/[0,1] and do therefore now also operate in constant time (which they previously did not).
  erlang:memory/[0,1] return more accurate information than c:memory/[0,1] previously did.
  For more information about erlang:memory/[0,1] see the erlang(3) man page.
  (Own Id: OTP-4637)

- To give applications better control of conversion of local time to UTC with respect to daylight saving time, there are two new functions: erlang:localtime_to_universaltime/2 and calendar:local_time_to_uinversal_time_dst/1. See the documentation for details.
  (Own Id: OTP-4667)
  (Aux Id: seq7797)

- There is now a way to bind the erlang distribution socket to only one specific IP address on multihomed systems. Set the kernel variable 'inet_dist_use_interface' to a net address e.g '{127,0,0,1}' (bad example).
  (Own Id: OTP-4709)
  (Aux Id: seq7806)

- A http state bug in inet_drv (affecting gen_tcp) has been fixed. Patch from Claes Wikström.

  A bug in defining max number of ports has been fixed. Patch from Claes Wikström.

  A bug in erlang:port_call/3 when calling a driver with a NULL driver struct ->call field has been fixed. Patch from Luke Gorrie.

  There is a new function file:script/1,2 that does the same as file:eval/1 but gives a return value. For completness, file:path_script/2,3, file:eval/2 and file:path_eval/3 are also added. Suggestion from Ulf Wiger. See the documentation for details.

  `erlang:trace/3` did no clear trace flags on processes that were exiting. This bug has now been fixed.

  The gen_udp options `add_membership` and `drop_membership` are now allowed. Patch from Vance Shipley.

  `gen_udp:open/1,2` with service name instead of port number now works. Patch from carlos@lfcia.org.

  An unjustified compiler warning when using an explicit space character as pad character to `io:format/2` and similar has been removed.

  If an illegal node name is used to start a node, now `net_kernel` fails noisily instead of just letting the node start in non-distributed mode.

  Now `gen_server:format_status/2` also works with non-registered processes.

  There are two new functions `erlang:list_to_integer/2` and `erlang:integer_to_list/2` that takes a number base argument. See the documentataion for details.

  New format characters for `io:format/2` and similar are ~b, ~B, ~x, ~X, ~+ and ~#. See the documentaion for details.

  New format characters for `io:fread/2` and similar are ~u, ~- and ~#. See the documentation for details.

  The token scanner `erl_scan` has been rewritten to become twice as fast as before. Now, incomplete any-base numbers such as "16#" are regarded as errors instead of as zero. The allowed base number range has been extended to 2..36 instead of previously 2..16.

  There is a new function `lists:split/2`. See the documentation.

  For everyone that has written their own function to calculate the time difference between two `now()` calls there is now `timer:now_diff/2`. See the documentation.
  (Own Id: OTP-4747)

### Known problems

- `code:is_loaded/1` doesn't type check its arguments.
  (Own Id: OTP-2607)

- If more than 1024 bytes of text are pasted into the shell, and this text consists of more than one expression sequence (each ending with a period), text after the first 1024 bytes may be lost.
  (Own Id: OTP-3041)

## Kernel 2.8.0

### Fixed errors and malfunctions

- A race condition in dist_ac has been removed.
  The documentation didn't clearly state that all distributed applications depend on (at least) kernel and stdlib (kernel and stdlib should be part of "applications" in the .app file). This has now been added to the app(4) manual page.
  The following has also been changed in the system documentation (not shipped with patches): PREVIOUSLY: When distributed applications are specified, it is advised that the sync_nodes functionality in the kernel application is used. If not used, and several nodes are started at the same time, the node that comes up first will start all applications, and the other nodes will take over the applications when they come up.
  NOW: When distributed applications are specified, it is required that the sync_nodes functionality in the kernel application (see kernel(6)) is used to synchronize all involved nodes. If not used, the distribution mechanism for distributed applications will not function correctly.
  (Own Id: OTP-3509)
  (Aux Id: Seq 4408)

- The spawn bifs didn't fail with badarg as they should if the argument list wasn't a list; instead, the spawned process immediately exited. All spawn BIFs now fail with badarg if they are passed a bad argument as argument list.
  spawn BIFs which take funs as arguments and remote spawn BIFs could fail with other errors than badarg when passed bad arguments. All spawn BIFs now fail with badarg when they fail due to bad arguments.
  (Own Id: OTP-4185)

- A bug in `disk_log:unblock/1` that could cause messages to be processed in wrong order has been fixed. Write errors no longer terminate the disk log process.
  (Own Id: OTP-4191)

- The application module list is now properly updated after a code change.
  (Own Id: OTP-4342)

- A deadlock could occur if distributed disk logs were opened simultaneously on different nodes. This bug has been fixed.
  (Own Id: OTP-4405)
  (Aux Id: seq7275)

- os:find_executable/1 would return wrong return values ({ok,Name} or error) if given an absolute path name instead of the documented values (Name or false).
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4476)

### Improvements and new features

- The spawn_opt/[2,3,5] BIFs has been added. That is, spawn_opts that takes a fun as argument, and spawn_opts that spawn a process on a remote node.
  (Own Id: OTP-4180)

- The sasl application variable 'log_utc' can be set to 'true' to make ordinary sasl logs as well as report browser output appear with Universal Coordinated Time instead of local time.
  (Own Id: OTP-4245)
  (Aux Id: Seq7242)

- The set_net_ticktime/[1,2] and get_net_ticktime/0 functions has been added to the net_kernel module (see net_kernel(3)) which makes it possible to change the net_tick time during operation.
  (Own Id: OTP-4255)
  (Aux Id: SEQ-7249)

- There are new functions `bchunk/2,3` in the `disk_log` module that are to be used like `chunk/2,3` but return objects as binaries.
  (Own Id: OTP-4327)

- The loading of BEAM code at start-up of embedded systems has been optimized: if the thread pool is non-empty (see the system flag `+A` in `erl(3)`) and files are read from a file system (the default, see the value `efile` of the `-loader` flag in `erl(3)`) disk seek times have been reduced.
  (Own Id: OTP-4372)

- There is a new configuration parameter 'shutdown_func' to application kernel that allows you to register a function to be called when application_controller shuts down. See the man page for 'kernel'.
  (Own Id: OTP-4424)
  (Aux Id: seq7520)

- The module 'erlang' is now preloaded. Customized start scripts have to be rebuilt.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4433)

- The option `compressed` to `file:open/2` has now been documented.
  (Own Id: OTP-4513)

### Known problems

- `code:is_loaded/1` doesn't type check its arguments.
  (Own Id: OTP-2607)

- If more than 1024 bytes of text are pasted into the shell, and this text consists of more than one expression sequence (each ending with a period), text after the first 1024 bytes may be lost.
  (Own Id: OTP-3041)

There are also release notes for older versions.