# Erts Release Notes

## Erts 5.3

### Fixed errors and malfunctions

- The start_erl example script passed parameters to erlexec in an incorrect way; this is now corrected.
  (Own Id: OTP-3004)

- Better error checking of invalid floating point numbers in list_to_float/1.
  (Own Id: OTP-4361)

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

- An unneccessary garbage collection at process exit for processes with heap fragments is removed.
  (Own Id: OTP-4603)
  (Aux Id: seq7783)

- The script 'start' now spawns off an run_erl that's completely disconnected from the controlling terminal and that ignores sighup (run_erl -daemon)
  (Own Id: OTP-4612)
  (Aux Id: seq7644)

- Some internal memory allocation routines (used in BIFs) would allocate more memory than necessary, especially if the default mininum heap size had been raised. Corrected.
  (Own Id: OTP-4625)

- A mixup of read buffers in the inet driver could cause unpredictable results when communicating over TCP and for distributed erlang.
  (Own Id: OTP-4626)
  (Aux Id: seq7746)

- Ets tables could show negative sizes in ets:info after a combination of safe_fixtable,delete and insert. The bug is removed.
  (Own Id: OTP-4690)
  (Aux Id: seq7871)

- process_info(Pid, garbage_collection) didn't return information about Pid; instead, it returned information about the calling process. This bug has now been corrected.
  (Own Id: OTP-4725)

- Repeated process_flag(Pid, save_calls, X) calls could cause erlang:memory() (and other memory information bifs) to return erroneous information. This bug has now been corrected.
  (Own Id: OTP-4731)
  (Aux Id: OTP-4637)

- ets:memory on set datatype could show wrong result after multiple inserts with same key. The error occurs after applying patch erl_487. The error is now corrected.
  (Own Id: OTP-4756)
  (Aux Id: OTP-4690, seq8001)

### Improvements and new features

- Support for the HW watchdog on the CP_blade board (PPC_LINUX)
  (Own Id: OTP-4520)

- 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 BIF erlang:hibernate/3 allows a process to shrink its memory consumption while waiting for messages.
  (Own Id: OTP-4727)

- A number of new memory allocators have been introduced in order to further reduce the memory consumption of the emulator. In order to resemble the Erlang/OTP R9B system, most of these allocators are disabled by default in the Erlang/OTP R9C release. By starting the emulator with the command-line argument "`+Mea r10b`", the emulator will use the default configuration we currently expect the Erlang/OTP R10B emulator to use. See the `erts_alloc(3)` documentation for further information.
  Also new functionality for inspection of memory usage has been introduced. See the `instrument(3)`, `erlang:system_info/1`, and `erts_alloc(3)` documentation for further information.
  NOTE: Some system flags (+ command line arguments passed to erl) have been changed. The `+m`, `+t`, and `+T` flags have been changed to, respectively, `+MYm`, `+MYtt`, and `+MYtp`. The `+d`, and `+S*` flags have been removed. See the `erts_alloc(3)`, and the `erl(1)` documentation for further information.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4534)
  (Aux Id: OTP-4761)

- A way to make ets:update_counter wrap at certain values is now available. See the documentation for details.
  (Own Id: OTP-4546)
  (Aux Id: seq4605 (body9066))

- The maximum number of ports can now be changed to an arbitrary value using the environment variable ERL_MAX_PORTS on windows, corresponding to the behaviour on other operating systems. The maximum number of simultaneously open i.e. sockets or port programs is now only limited by operating system imposed limits.
  (Own Id: OTP-4578)

- The beam files contain information about the source filenames unless stripped.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4611)
  (Aux Id: seq7627)

- A method of getting notifications of long garbage collections, large heaps and suspended processes due to busy ports is now available. See the documentation of erlang:system_monitor/0..2.
  (Own Id: OTP-4627)
  (Aux Id: seq7772)

- 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)

- 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)

- 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)

- In order to conform to the Erlang specification, comparison between two pids was changed in the R9B release. This change did however break a deadlock- prevention algorithm used by mnesia during release upgrade. Therefore, comparison between two pids has been changed back so that R9B nodes are compatible with Erlang nodes running pre-R9 releases.
  Pre-R9 comparison between two pids which now is used again: If t1 and t2 are both pids, t1 will precede t2 if and only if either * the node local id of t1 precedes the node local id of t2, or * the node local ids of t1 and t2 are equal, and node(t1) precedes node(t2), or * the node local ids of t1 and t2 are equal, and also node(t1) and node(t2) are equal, and node(t1) was created before node(t2).
  The node local id consist of two integers; serial which is most significant, and number.
  The Erlang specification states: If t1 and t2 are both refs, both PIDs, or both ports, then t1 precedes t2 if and only if either * node(t1) precedes node(t2), or * node(t1) equals node(t2) and t1 was created before t2.
  Note that comparisons between two refs, or two ports will still conform to the Erlang specification.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4715)
  (Aux Id: OTP-4511, OTP-4512)

- The `erlang:fun_info/2` function will now return the name of the local function that implements the fun. Also, the `arity` information returned has now been documented.
  (Own Id: OTP-4719)
  (Aux Id: OTP-4704)

- 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)

## Erts 5.2

### Fixed errors and malfunctions

- Bit syntax matching in the shell used to allow expressions for sizes; this is now disallowed just as it is in compiled code.
  (Own Id: OTP-3781)
  (Aux Id: Seq 5004)

- spawn_opt/4 used 0 as default value for fullsweep_after instead of the default value used by spawn/3, and spawn_link/3. This caused all processes spawned by spawn_opt/4 (e.g. all gen_servers) to allways use fullsweep if the fullsweep_after option wasn't explicitly set. spawn_opt/4 has now been changed to use the same default value as spawn/3, and spawn_link/3.
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4179)

- 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)

- Negative field sizes in construction of binaries using the bit syntax would crash the emulator. Corrected.
  (Own Id: OTP-4301)

- System flags (+ command line arguments) taking values weren't handled correctly. If the value and the system flag were separated by whitespace some flags didn't work (e.g. +A 10). If multiple system flags with their corresponding values were passed, and the flags and the values were separated by whitespace, all of these flags were replaced by the last one passed. These bugs have now been corrected.
  (Own Id: OTP-4312)
  (Aux Id: OTP-4267, OTP-4313, OTP-4314)

- The emulator could deadlock on vfork() due to operations performed in the child process before exec() (only observed on multi-processor machines). This bug has now been fixed.
  (Own Id: OTP-4389)
  (Aux Id: seq7434)

- When running the instrumented emulator and sl_alloc release 1, sl_realloc could fail to preserve all information. This has now been fixed.
  (Own Id: OTP-4419)
  (Aux Id: OTP-4570)

- Harmless bug (which caused compilation warnings on some platforms) fixed in sl_alloc (release 2)
  (Own Id: OTP-4420)

- Documentation of obsolete system flag +s removed
  (Own Id: OTP-4421)

- A bug in `file` that failed to flush write buffers after write errors, for example device full, and caused subsequent writes (after repositioning to a still writable position in the file) to write invalid data, has been corrected.
  (Own Id: OTP-4505)
  (Aux Id: OTP-4500)

- A bug that causes `inet_drv.c` not to free prebound sockets has been corrected.

  A bug that caused `prim_inet:getiflist/1` to miss some interfaces has been corrected.
  (Own Id: OTP-4508)

- A bug in the emulator that caused a memory leak if there had been more than 1024 ports open, and a port driver called `driver_exit` (A link from process to port was lost), has been corrected.
  (Own Id: OTP-4509)

- A bug that caused a segfault in the emulator when decoding a bad distribution message has been corrected.
  (Own Id: OTP-4510)

### Improvements and new features

- The previous hard system limit of 255 known remote nodes has been removed. With the exception of node name atoms, all data regarding remote nodes are now garbage collected.
  (Own Id: OTP-4196)

- sl_alloc release 2 has been introduced in the emulator, see the sl_alloc(3) man page for more information.
  (Own Id: OTP-4267)
  (Aux Id: seq7276, OTP-4312, OTP-4313, OTP-4314)

- The format of the monitor messages has been changed. The `Object` field in the `{'DOWN', MonitorReference, Type, Object, Info}` messages is now always on the form `{RegisteredName, NodeName}` when `erlang:monitor/2` has been called with a registered name (see erlang(3)).
  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4311)
  (Aux Id: Seq7326)

- More memory block types (most of the existing ones) are now identified by the instrumented emulator.
  (Own Id: OTP-4313)
  (Aux Id: OTP-4267, OTP-4312, OTP-4314)

- Memory blocks in the emulator that are guaranteed never to be removed are placed in a special block at the beginning of the emulators heap segment if there are space left in it. This special block has been called the definite alloc block. The size of the definite alloc block can be set with the +d system flag (see the erl(1) manpage) (default size is 2 Mb).
  The tuple {definite_alloc, BlockSize, UsedSize} that is part of the list returned from erlang:system_info(allocated_areas) can be used to determine how much that is used of the definite alloc block.
  (Own Id: OTP-4314)
  (Aux Id: seq7276, OTP-4267, OTP-4312, OTP-4313)

- A number of sl_alloc improvements have been made. For example, the block header field have been shrunk, and some useless features have been removed.
  (Own Id: OTP-4343)
  (Aux Id: OTP-4267)

- There are now two new trace breakpoint types - meta trace and call count trace. See erlang:trace_pattern/3 and erlang:trace_info/2.
  (Own Id: OTP-4397)

- The possibility to use elib_malloc instead of the default (libc) malloc has been added. The +m command line switch is used in order to enable another malloc than the default (see the erl(1) man page). In order to enable elib_malloc use "+m elib".
  (Own Id: OTP-4398)
  (Aux Id: seq7437)

- There is a new portable hash function, `erlang:phash2`, that distributes small integers better than `erlang:phash`, and is faster for bignums and binaries.
  (Own Id: OTP-4399)

- The endianess specification 'native' has been added to the bit syntax. It will resolve to either big or little endian at load time. It is specially useful for communcating with linked-in drivers.
  (Own Id: OTP-4458)

- The control() routine in a driver called for a port that is set in binary mode (using set_port_control_flags()), is now allowed to return a NULL pointer instead of a pointer to a binary. A NULL pointer will be returned to the caller of port_control/3 as an empty list.
  (Own Id: OTP-4459)

- Comparisons between two `port`s or between two `reference`s were previously unstable and didn't conform to the Erlang specification. Comparisons between two `pid`s didn't previously conform to the Erlang specification. The comparison between two `pid`s, `port`s, or `reference`s has therefore been changed and is now stable, and does now conform to the Erlang specification.

  Cut from the Erlang specification:
  If `t1` and `t2` are both refs, both PIDs, or both ports, then `t1` precedes `t2` if and only if either
  * `node(t1)` precedes `node(t2)`, or
  * `node(t1)` equals `node(t2)` and `t1` was created before `t2`.

  (*** POTENTIAL INCOMPATIBILITY ***)
  (Own Id: OTP-4511)

There are also release notes for older versions.