Fixed Bugs and Malfunctions

The new predefined
Xref variable OL holds all functions with the
-on_load() attribute.

Own Id: OTP-14344

In fprof when sampling multiple processes and analyzing
with totals set to true, the output now sums together all
caller and callee entries which concerns the same
function. Previous behaviour was to report each
contributing entry separately.

Own Id: OTP-14500

Improvements and New Features

Lock counting can now be fully toggled at runtime in
the lock counting emulator (-emu_type lcnt).
Everything is enabled by default to match the old
behavior, but specific categories can be toggled at will
with minimal runtime overhead when disabled. Refer to the
documentation on lcnt:rt_mask/1 for details.

Own Id: OTP-13170

lcnt:collect and lcnt:clear will no
longer block all other threads in the runtime system.

Own Id: OTP-14412

General Unicode improvements.

Own Id: OTP-14462

Tools are updated to show Unicode atoms correctly.

Own Id: OTP-14464

Add erlang:iolist_to_iovec/1, which converts an
iolist() to an erlang:iovec(), which suitable for use
with enif_inspect_iovec.

Fixed Bugs and Malfunctions

In OTP-20.0, the behavior of c, make, and ct_make was
changed so that in some cases the beam files by default
would be written to the directory where the source files
were found. This is now changed back to the old behavior
so beam files are by default written to current
directory.

Fixed Bugs and Malfunctions

Fixed Bugs and Malfunctions

If a module includes eunit.hrl, a parse transform adds
the function test/0 on line 0 in the module. A bug in
OTP-18.0 caused cover:analyse_to_file/1 to fail to insert
cover data in the output file when line 0 existed in the
cover data table. This is now corrected.

The BIF highlighting in the emacs mode has been updated
to correspond with the correct BIFs.

Own Id: OTP-10774

Improvements and New Features

Support for Unicode has been implemented.

Own Id: OTP-10302

A new function, cover:flush(Nodes), is added which will
fetch data from remote nodes without stopping cover on
those nodes. This is used by test_server and common_test
when it is safe to assume that the node will be
terminated after the test anyway. The purpose is to avoid
processes crashing when re-loading the original beam if
the processes is still running old code.

Remote nodes will now continue to count code coverage if
the connection to the main node is broken. Earlier, a
broken connection would cause the cover_server on the
remote node to die and thus any still cover compiled
modules would cause process crash when trying to insert
cover data in ets tables that used to exist on the
cover_server. The new functionality also involves
synchronization with the main node if the nodes are
reconnected.

*** POTENTIAL INCOMPATIBILITY ***

Own Id: OTP-10523 Aux Id: OTP-10427

Where necessary a comment stating encoding has been
added to Erlang files. The comment is meant to be removed
in Erlang/OTP R17B when UTF-8 becomes the default
encoding.

Fixed Bugs and Malfunctions

Makefiles in erts, hipe and tools have been corrected to
enable parallel make, i.e MAKEFLAGS=-jX where X is the
parallelity number. As a result of this dependencies were
corrected since that is what is needed for parallel make
to work.

Fixed Bugs and Malfunctions

After stopping cover with cover:stop() there could still
be a {'DOWN',...} leftover message in the calling
process's message queue. This unexpected leftover could
be eliminated if erlang:demonitor/2 with option flush
would be used in certain points

Own Id: OTP-9694

Add deps as erlang-flymake include directory.

Update erlang-flymake to recognize the "deps" folder as
an include directory. This makes erlang-flymake
compatible with the rebar dependency management tool's
default folder structure, which puts included
dependencies in "deps".(Thanks to Kevin Albrecht)

Own Id: OTP-9791

Improvements and New Features

Variables are now now allowed in 'fun M:F/A' as
suggested by Richard O'Keefe in EEP-23.

The representation of 'fun M:F/A' in the
abstract format has been changed in an incompatible way.
Tools that directly read or manipulate the abstract
format (such as parse transforms) may need to be updated.
The compiler can handle both the new and the old format
(i.e. extracting the abstract format from a pre-R15 BEAM
file and compiling it using compile:forms/1,2 will work).
The syntax_tools application can also handle both
formats.

*** POTENTIAL INCOMPATIBILITY ***

Own Id: OTP-9643

Tuple funs (a two-element tuple with a module name and a
function) are now officially deprecated and will be
removed in R16. Use 'fun M:F/A' instead. To make
you aware that your system uses tuple funs, the very
first time a tuple fun is applied, a warning will be sent
to the error logger.

Fixed Bugs and Malfunctions

Teach the emacs mode to compile yecc and leex files

If visiting a .yrl or .xrl file in emacs with
erlang-mode, then the `erlang-compile' function (normally
bound to C-c C-k), now knows how to compile yecc and leex
files, and then, if that compilation succeeds, also
compiles the resulting .erl files.

Also introduce a `erlang-compile-command-function-alist'
to make it possible to hook in other functions for
computing compilation commands/expressions, depending on
file name. (Thanks to Tomas Abrahamsson )

Own Id: OTP-9503

Improvements and New Features

Fixed Bugs and Malfunctions

Change make:files to behave more like erlc

This change removes the unnecessary checks on the files
when make:files is called and allows the error checking
to be done in compile:file, where the error messages are
produced. It does not affect the return value.

(Thanks to Sam bobroff)

Own Id: OTP-9179

add user specified compiler options on form reloading

In order to be able to test non-exported functions from
another (test) module it is necessary to compile the
specific module (at least during the test phase) with the
export_all compiler option. This allows complete
separation of testing and productive code. At the moment
it is not possible to combine this with a test code
coverage using the cover module. The problem is that when
cover compiling a module using cover:compile_* the code
is reloaded into the emulator omitting/filtering the
passed user options. In my example above the export_all
option would be removed and the non-exported functions
cannot be called any more. (Thanks to Tobias Schlager)

Own Id: OTP-9204

Inhibit electric newline after "->" when inside a type
spec

The Erlang mode for Emacs inserts a newline after every
"->", which saves you one keystroke when writing a
function, but that is inappropriate when writing a type
spec, as you'd normally keep the spec on one line. This
change inhibits the automatic insertion when the current
line starts with "-spec" or "-type".(Thanks to Magnus
Henoch)

Own Id: OTP-9255

Add a check logic to prevent file descriptor leak

cover module handle files as raw in export and import.
Assert counts of ports are the same at the beginning and
at the end of the test case.(Thanks to Shunichi
Shinohara)

Fixed Bugs and Malfunctions

Declare indentation options as "safe" in erlang-mode for
Emacs

Emacs has a facility for setting options on a per-file
basis based on comments in the source file. By default,
all options are considered "unsafe", and the user is
queried before the variable is set. This patch declares
the variables erlang-indent-level, erlang-indent-guard
and erlang-argument-indent to be safe, if the value
specified in the source file is valid.

Such declarations usually look like this:

%% -*- erlang-indent-level: 2 -*-

and appear on the first line of the file. (thanks to
Magnus Henoch)

Own Id: OTP-9122

Improvements and New Features

Cover has been improved to take less memory and allow
parallel analysis of cover data. Data collection from
nodes is now done in parallel and it is now possible to
issue multiple analyse and analyse_to_file requests at
the same time. A new function call async_analyse_to_file
has also been introduced, see the documentation for more
details.

Improvements and New Features

Xref has been updated to use the re module
instead of the deprecated regexp module.

*** POTENTIAL INCOMPATIBILITY ***

Own Id: OTP-8472

When given the option {builtins,true} Xref now
adds calls to operators.

Own Id: OTP-8647

eprof has been reimplemented with support in
the Erlang virtual machine and is now both faster (i.e.
slows down the code being measured less) and scales much
better. In measurements we saw speed-ups compared to the
old eprof ranging from 6 times (for sequential code that
only uses one scheduler/core) up to 84 times (for
parallel code that uses 8 cores).

Note: The API for the eprof has been cleaned up
and extended. See the documentation.

Fixed Bugs and Malfunctions

The coverage analysis tool cover has been
improved when it comes to handling list and bit string
comprehensions (a counter for each qualifier), bit syntax
expressions (the Value and Size expressions), and try
expressions (the body called Exprs in the Reference
Manual). A few (not all) situations where several
expressions are put on the same line are also handled
better than before.

Own Id: OTP-8188 Aux Id: seq11397

When loading Cover compiled code on remote nodes
running code in the loaded module, a badarg
failure was sometimes the result. This bug has been fixed.

Own Id: OTP-8270 Aux Id: seq11423

The short-circuit operators andalso and
orelse are now handled correctly by the coverage
analysis tool cover (it is no longer checked
that the second argument returns a Boolean value.)

Fixed Bugs and Malfunctions

Fixed Bugs and Malfunctions

make:files/1,2 can now handle a file in another
directory as argument, similar to make:all/0,1.

When specifying a file name including the .erl
extension in Emakefile, make:all/0,1 looked
for the object code in the wrong place.

When specifying a file name including the .erl
extension in Emakefile and some compile options
for the file, make:files/0,1 did not use the
options as it should do.

Own Id: OTP-6057 Aux Id: seq10299

cover: When cover:stop() was called,
the cover compiled code was not unloaded (as stated in
the documentation) but simply marked as 'old'. This
meant that processes lingering in (or with funs
referencing to) the cover compiled code would survive
even when the cover server and its ETS tables was
terminated.

Now the cover compiled code is unloaded, meaning that
processes lingering in/with references to it will be
killed when cover:stop is called, instead of
later crashing with badarg when trying to bump
counters in ETS tables no longer existing.

Improvements and New Features

Replaced call to deprecated function
file:file_info/1 with call to
filelib:is_dir/1 and filelib:is_regular/1
in tags.erl.

Fixed Bugs and Malfunctions

Fixed Bugs and Malfunctions

Emacs: erlang-man-function and
erlang-man-module used a pattern matching to find
the requested module that sometimes yielded unexpected
results. For example, erlang-man-module file would
display the man page for CosFileTransfer_File.

Own Id: OTP-5746 Aux Id: seq10096

Some compiler warnings and Dialyzer warnings were
eliminated in the Tools application.

When tracing to a port (which fprof does),
there could be fake schedule out/schedule in messages
sent for a process that had exited.

Fixed Bugs and Malfunctions

Improvements and New Features

It is now possible to encrypt the debug information in
beam files, to help keep the source code secret. See
compile(3) for how to provide the key for encrypting,
and beam_lib(3) for how to provide the key for
decryption so that tools such as Debugger, xref, or
cover can be used.

The beam_lib:chunks/2 functions now accepts an
additional chunk type 'compile_info' to retrieve
the compilation information directly as a term. (Thanks
to Tobias Lindahl.)