# Kernel Release Notes

## Kernel 2.7

### Fixed errors and malfunctions

- The undocumented and obsolete code:add_uc/1 and code:uc_dir/0 have been removed.
  (Own Id: OTP-2933)

- Bugs in `wrap_log_reader` have been fixed.
  (Own Id: OTP-3736)
  (Aux Id: OTP-3716)

- `global:whereis_name/1` was unnecessarily inefficient.
  (Own Id: OTP-3737)
  (Aux Id: Seq 4935)

- When making rpc:call to a function that in its turn spawn_linked some child process, the rpc server killed the child process when the called function returned. This is now corrected.
  (Own Id: OTP-3769)
  (Aux Id: OTP-3766)

- When many nodes contacted each other at the same time, there could be long delays until for example names registered using `global` were consistent on all nodes. This has been improved substantially.
  (Own Id: OTP-3801)
  (Aux Id: Seq 5028, OTP-3947)

- A close of a tcp socket could be delayed up to 5 seconds after all pending output had been sent. Now the socket is closed immediately after all pending output has been sent.
  (Own Id: OTP-3924)
  (Aux Id: seq 5182, OTP-3963)

- `unlink(Pid)` used to crash when performed on a non-distributed Erlang system, when `Pid` referred to a different node (obtained via terms stored in the file system, for example). Now it returns `true`.
  (Own Id: OTP-3964)
  (Aux Id: Seq 5232)

- If a directory belonging to Erlang's code path was removed, `code:which/1` could crash.
  (Own Id: OTP-3977)
  (Aux Id: Seq 5253)

- When resolving a clash between registered names during the connection of two partitions, a name would be removed if one of the nodes defining the name went down during the resolution. Now the name defined by the remaining node is kept.
  (Own Id: OTP-3999)

- dist_ac expects that all participating nodes have the same distribution specifications, but this wasn't clearly stated anywhere in the documentation. This has now been added to the system documentation.

  Previously when dist_ac got an "application stopped" message about an application that it didn't know of, it crashed with a badmatch. Now dist_ac stores this information instead and assumes that the distribution specification for this application will be set later (trough application:load/2).

  A stop of a distributed application has been changed to behave in the same way on all nodes in the distributed case. An application:stop/1 followed by an application:start/1 on any node will resume operation locally.

  Documentation for application:stop/1 has been updated to describe it's behaviour in the distributed case.
  (Own Id: OTP-4066)
  (Aux Id: seq7093)

- A documentation error for the bif nodes/1 has been fixed. Under "Some equalities" it was stated that "node() = nodes(this)" which is not correct. It has now been corrected to "[node()] = nodes(this)".
  (Own Id: OTP-4131)
  (Aux Id: Seq7152)

### Improvements and new features

- `disk_log` handles huge terms better when reading log files using `chunk/2`. Bugs in `chunk/2` and `chunk_step/3` as well as in `wrap_log_reader` have been fixed.
  (Own Id: OTP-3716)

- A number of bug fixes and improvements have been done to applications `runtime_tools`, `kernel` and `erts`:
  - A read timeout no longer resets the sequential trace token. This is an incompatibility towards the previous behaviour. Use `seq_trace:set_token([])` to reset the sequential trace token.
  - `seq_trace:get_token/0` and `seq_trace:set_token/1` now have compatible token formats.
  - `dbg:trace_port/2` and `dbg:trace_client/2,3` now supports trace to and read from a size limited "wrap file set".
  - `dbg:trace_port_control/1` now supports operation `get_listen_port` for the ip trace driver.
  - New match spec functions `{is_seq_trace}` and `{get_seq_trace}` has been added to test and read the sequential trace token in match specs.
  - New match spec functions `{get_tcw}` and `{set_tcw Value}` that reads and sets a "trace control word" in the node has been added. The "trace control word" is a word in each Erlang node of at least 24 bits. There are also enhancements of BIFs: `erlang:system_info(trace_control_word)` and `erlang:system_flag(trace_control_word, Value)` for the same purpose.
  - A new match spec function `{silent, TrueOrFalse}` for setting a silent call trace flag per process that inhibits call trace messages, both local and global, has been added. The BIF `erlang:trace/3` has been extended to recognize the flag 'silent' to start a call trace in silent mode.
  - Some bugs in the `dbg` module has been fixed, e.g the 'old_trace_call' flag has been removed from the 'all' flags list, and the dbg server no longer hangs if the supplied tracer fails to start.
  - A bug in the emulator that made 'EXIT' messages from a process involved in a sequential call trace get overwritten by the sequential trace token itself has been fixed.
  - The documentation regarding the above has been updated. Especially, the fact that the match spec function `{return_trace}` destroys the tail recursiveness of the traced function has been pointed out.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-3747)
  (Aux Id: OTP-3592, OTP-3744)

- `code:interpret/1`, `code:interpret_binary/3`, `code:delete_interpet/1` `code:interpeted/0` and `code:interpeted/1` have been removed since the debugger no longer needs them.
  (Own Id: OTP-3783)

- Hidden nodes and hidden global groups have been introduced. This makes it possible to establish hidden connections between Erlang nodes. See global_group(3), and erl(1).
  (Own Id: OTP-3916)
  (Aux Id: OTP-3963)

- The flag 'procs' to erlang:trace/3 has got a slightly new behaviour: Trace tag 'spawn' has a new element, and trace tags 'register', 'unregister', and 'getting_unlinked' are new. Therefore, new and/or different trace messages will arrive to the tracer when the 'procs' trace flag is used.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-3934)
  (Aux Id: seq5193)

- `disk_log` caches written terms. This implies that the `close`, `lclose` and `sync` functions can return file errors. `pid2name/1` is a new debug function that given a disk log process (a pid) returns the name of the log.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-3952)

- A new command line argument `-extra` has been introduced, which causes all following arguments to remain uninterpreted by Erlang; the arguments are included in the list returned by `init:get_plain_arguments/0`.
  (Own Id: OTP-3955)
  (Aux Id: OTP-3030, Seq 5203)

- Ports can now be registered in the same way as processes.
  (Own Id: OTP-3989)
  (Aux Id: Seq5263)

- It is now possible to have the compiler check user-defined behaviours and not only the pre-defined OTP behaviours (gen_server etc.).
  This is done by adding a function `behaviour_info/1` to the behaviour module. `behaviour_info(callbacks)` should return a list of `{FunctionName,Arity}` which defines the callback functions the behaviour uses.
  When a callback module with the attribute `-behaviour(Behaviour)` is compiled, its exported functions will be compared with the list returned by `Behaviour:behaviour_info(callbacks)` and a warning will be issued if any callback function is missing.
  Note that the user must ensure that the module `Behaviour` is present at compile-time and can be found in the current code path.
  (Own Id: OTP-4125)

- When the emulator runs without the async thread pool, large file read and write operations are now segmented into smaller, so that other Erlang processes can run in parallel. Still, a sync or a close operation on a large file may block the emulator as before. Using the async thread pool is the only cure for that.
  (Own Id: OTP-4144)

### 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.