This document describes the changes made to the ERTS application.
Input driver gone away without
deselecting!
" error reports could sometimes occur
when a driver instance terminated in the ready_output()
callback of the driver. This bug was only present in
emulators that used poll(). Note, that this bug was
harmless, the only effect it had was the erroneous error
report.
erlang:trace_delivered/1
has been introduced in
order to make it easier to know when the trace has been
delivered. See the erlang(3) man page for more
information.
/dev/poll
, epoll
, and kqueue
. Linux
kpoll
has been replaced with epoll
. Some
time in the future there will also be a kernel poll
version using Solaris event ports.
epoll
or kqueue
is used either
poll
or select
is used as fallback.
Previously only poll
could be used as fallback.
Since select
now can be used as fallback, kernel
poll support is now also available on newer MacOSX. Note
however, when select
is used as fallback, the
maximum number of file descriptors is limited to
FD_SETSIZE
.
/dev/poll
, epoll
, or kqueue
is found
when building OTP, i.e. you do not have to pass the
--enable-kernel-poll
argument to configure
.
As before, kernel poll is disabled by default in the
runtime system. In order to enable it, pass the
+Ktrue
command line argument to erl
.
configure
will refuse to enable kernel poll
support on FreeBSD since kqueue
have problems with
(at least) pipes on all version of FreeBSD that we have
tested.
erl_ddll
module and the code in the emulator
have been completely rewritten; several bugs were fixed.
atom_to_list/1
, atom comparision, atom
hashing, erlang:apply/3
.
erlang:spawn_monitor/1,3
,
and the new option monitor
for
spawn_opt/2,3,4,5
.observer_backend
module has been updated to
handle the new BIFs.
-134217728 div 134217728
and -134217728 rem
134217728
would be calculated incorrectly.
abs(-2147483648)
could in unlucky circumstances
cause a heap overflow, as could size(Binary) when size of
the binary was larger than 128Mb.
receive after
with a larger timeout than 10 minutes.
-smp
command line argument now take the
following options: enable
, auto
, or
disable
.
-smpauto
argument is useful since
it starts the Erlang runtime system with SMP support if
it is available and more than one logical processor are
detected; otherwise, it starts the Erlang runtime system
without SMP support. For more information see the
erl(1)
man page.
driver_unloaded
. Previously the port exited
with exit reason -1
.
erlang:system_info/1
argument
scheduler
to scheduler_id
. This since the
scheduler
argument so easily could be mixed up
with the schedulers
argument (both returning
integers).
unlink/1
and erlang:demonitor/2
behaved completely asynchronous. This had one undesirable
effect, though. You could never know when you were
guaranteed not to be affected by a link that you
had unlinked or a monitor that you had demonitored.unlink/1
and
erlang:demonitor/2
can be viewed as two operations
performed atomically. Asynchronously send an unlink
signal or a demonitor signal, and ignore any future
results of the link or monitor.Mon = erlang:monitor(process, Pid), %% ... exit(Pid, bang), erlang:demonitor(Mon), receive {'DOWN', Mon , process, Pid, _} -> ok %% We were previously guaranteed to get a down message %% (since we exited the process ourself), so we could %% in this case leave out: %% after 0 -> ok end,*** POTENTIAL INCOMPATIBILITY ***
ERL_FLAGS
was set, its contents would be appended to the end of the
command line even if the command line had an -extra
options. Changed to place the options from ERL_FLAGS
just before -extra
. Also, the -smp
and
-hybrid
flags no longer have any effect if placed
after -extra
.
andalso
and orelse
operators are
now allowed to be used in guards. That also applies to
match specifications.{exception_trace}
and a corresponding trace
message exception_from
that can be used to trace
on any exit from a function, both normal function return
and exception return. See the documentation for
details.return_to
trace message is now also
generated when the execution returns to a function due to
catching an exception.-smp
command line argument is passed to
the erl
command. In order to make use of more than
one processor core, multiple scheduler threads are used. By
default, the number of scheduler threads will equal
the number of processor cores. The number of scheduler
threads can be set with the +S
command line argument.
For more information see the erl(1)
man page.--enable-smp-support
command line
argument to configure. Note, however, that it is not enough
that it builds. The underlying thread library and operating
system has to provide SMP support as well. If the thread
library does not distribute scheduler threads over multiple
processor cores then the runtime system will only seemingly
provide SMP support. If the runtime system is not built by
default on a specific platform, we have not tested
it on that platform.erlang:yield()
could be used to provide some
kind of temporary mutual exclusion (also bad programming
style). erlang:yield()
cannot be used to provide
any kind of mutual exclusion.refc
field in the ErlDrvBinary
type
has been removed. The reference count can be accessed
via API functions. For more information see
the erl_driver(1)
man page.
badarg
).binary_to_term(<<131,109,255,255,255,255)
and
similar expressions used to crash the emulator instead of
causing a badarg
exception. (Thanks to Matthias
Lang.)erlang:hibernate/3
could sometimes crash the emulator
when no heap was needed.erlang:trace_info/2
when getting info for a
function in a deleted module resulting in an emulator
crash, has been corrected.config.guess
files in the
ERTS and Erl_Interface applications would cause build
problems on the new Intel-based iMacs.
(Thanks to Sebastion Strollo.)
{packet,http}
option (for the
gen_tcp
module) did not not work correctly when
there were multiple continuation lines. (Thanks to Per
Hedeland.)char
type as unsigned.
(Thanks to Magnus Henoch.)
delay_send
option for gen_tcp
was
broken on Windows.-boot_var
option, the emulator would refuse to
start with a confusing error message. Corrected to show a
clear, understandable message.prim_file
module was modified to not depend
on the lists
module, to make it possible to start
the emulator using a user-defined loader. (Thanks to
Martin Bjorklund.)
erlang:send_after(Time,pid(),Msg)
and
erlang:start_timer(Time,pid(),Msg)
has been
introduced. Timers created with the receiver specified by a
pid, will automatically be cancelled when the receiver
exits. For more information see the erlang(3)
man
page.erlang:monitor(process,Pid)
hanged if Pid
referred to a process on a non-existing node with the same
nodename as the nodename of node on which the call was made.
This bug has now been fixed.
erl
in the ERTS application.
(Also, a few other previously undocumented environment
variables are now documented.)erlang:link/1
corrected-code_path_cache
addederl
command line flags clarificationsnet_kernel(3)
clarifications
fprof
does),
there could be fake schedule out/schedule in messages
sent for a process that had exited.
iolist_size/1
and iolist_to_binary/1
has been added.list_to_existing_atom/1
has been added.error
inside nested try/catch constructs if the
erlang:raise/3
BIF was called with an empty
stacktrace. (Calling erlang:raise/3
with an empty
stacktrace is NOT recommended.)file:open/2
will now
return the documented error reason {error,eisdir}
if the filename refers to a directory (it used to return
{error,eacces}
).erlang:system_monitor/2
, description of
busy_dist_port
, was corrected.zlib
module has been updated in an incompatible way and many
bugs have been corrected. It is now also documented.priority
and tos
for
platforms that support them (currently only Linux).
inet_gethost_native:control(Control)
Control = {debug_level,Level} | soft_restart
Level = integer() in the range 0-4
.
erlang:demonitor/1
when
distributed monitors were removed.
c:i/0
function will now run in a paged mode if
there are more than 100 processes in the system. (Thanks
to Ulf Wiger.)erlang:system_info(process_count)
has
been optimized and does now return exactly the same value
as length(processes())
. Previously
erlang:system_info(process_count)
did not include
exiting processes which are included in
length(processes())
.+P
flag for erl
, which sets the maximum
number of processes allowed to exist at the same, no longer
accepts values higher than 134217727. (You will still
probably run out of memory before you'll be able to reach
that limit.)driver_output_term()
and driver_send_term()
have been updated:
ets:delete/1
now allows other Erlang process to run
when a large table is being deleted.gen_tcp:send/2
has been corrected. To encounter
this bug you needed one process that read from a socket,
one that wrote more date than the reader read out so the
sender got suspended, and then the reader closed the
socket. (Reported and diagnosed by Alexey Shchepin.){packet,http}
for gen_tcp.
(Thanks to Claes Wikstrom and Luke Gorrie.)gen_tcp:recv/2
, the Length
to receive.file:read/2
to return
{error,ebadf}
, has been corrected.
M:F/A
construct creates a fun that
refers to the latest version of M:F/A.
This syntax is
meant to replace tuple funs {M,F}
which have many
problems.is_function(Fun,A)
(which may be
used in guards) test whether Fun
is a fun that can be
applied with A
arguments. (Currently, Fun
can also be a tuple fun.)+H
emulator option.
to_erl
could close unexpectedly on Linux systems.
Also, output from the emulator could be lost. Corrected.
cpu_timestamp
option for erlang:trace/3
is now also supported on Linux.werl
window size/position is now saved
correctly when werl
is stopped with the window
minimized. A problem with the placement not being saved if
the emulator is halted or stopped from the JCL menu has also
been fixed.
errno
was sometimes clobbered which caused erroneous
error reports about poll()
errors.{packet,http}
for gen_tcp
.
(Thanks to Claes Wikstrom and Luke Gorrie.)
binary_to_term/1
could cause the emulator to crash
when given invalid pids or funs.werl
was closed with the window minimized, it
was not possible to restart werl
with an open
window. A temporary solution has so far been implemented
that restores the initial window settings every time
werl
is started.
monitor_node/2
), excuting
process_info(Pid,memory)
for that process would
crash the emulator.erlc
-help
. The documentation for erlc
was also
slightly updated.is_boolean(42.5)
failed to load if optimization was
explicitly turned off.Module:foo/X
from any loaded
module, the returned by M:module_info(exports)
would
always include {foo,X}
(even though
Module:foo/X
if was not defined).
c
option for the +B
flag has been
introduced which makes it possible to use Ctrl-C
(Ctrl-Break on Windows) to interrupt the shell process
rather than to invoke the emulator break handler. All new
+B
options are also supported on Windows
(werl
) as of now. Furthermore, Ctrl-C on Windows has
now been reserved for copying text (what Ctrl-Ins was used
for previously). Ctrl-Break should be used for break
handling. Lastly, the documentation of the system flags has
been updated.
erlang:float/1
can now be used in
match specifications and is recognized by
dbg:fun2ms/1
and ets:fun2ms/1
. This
addition is part of the work to "harmonize" match
specification guards with Erlang guards.register/2
BIF would return true
even if
the second argument was not a pid for living process.
Corrected to cause an exception.-D_THREAD_SAFE
and
-D_REENTRANT
switches on unix when the emulator has
thread support enabled.-lbundle1.o
switch anymore. Thanks to
Sean Hinde who sent us a patch.erlang:raise/3
has been added. See the manual
for details. It is intended for internal system programming
only, advanced error handling.
epmd
protocol.epmd
has now been registered at
IANA:
http://www.iana.org/assignments/port-numbers.run_erl.c
now works on Mac OS X and FreeBSD.
werl.exe
now can be
saved even after the first time you run werl.exe
.
The window position and size is also saved. Patch from
James Hague who did all the hard work.erl_interface
library, on MacOSX could not be used without first
rerunning ranlib
on them. This bug has now been
fixed.erlang:hash/2
and erlang:phash/2
on
64-bit platforms have been fixed.
C:\Program\erl5.4.2
, the emulator would not
start.
select/3
and select/1
on a
non-fixed ETS table and deleted objects simultaneously,
the emulator could crash. Note that the result of such
simultaneous operations on tables that are not in a fixed
state is still undefined, but the emulator crash is,
needless to say, fixed.
erts_alloc(3)
documentation. It was stated that
some of the memory allocators present were by default
disabled. This is true for Erlang/OTP R9C, but is not true
for Erlang/OTP R10B. In R10B all memory allocators present
are enabled by default.
epmd
as early as
possible.