# Erts Release Notes

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

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

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

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

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

There are also release notes for older versions.