Age | Commit message (Collapse) | Author |
|
Assigning the result of a BIF call to a variable used to be
sufficient to prevent the call from being optimized away. With
the more aggressive optimization that will be introduced in
a future commit it will not be sufficient.
Matching the return value will prevent the compiler from doing
the optimization.
|
|
This commit improves crash dumps in several ways:
* Suspends schedulers to get a current snapshot
* Dumps information about scheduler
* Dumps stack trace of current running process
(including Garbing processes)
|
|
|
|
* sverk/port_get_data-race/OTP-12208:
erts: Fix port data memory allocation bug
|
|
for non-immediate port data >= sizeof(Eterm)*2 words.
|
|
|
|
OTP-12300
* vinoski/dirty-nif-return-gc:
Fix gc-related problem with dirty NIFs
|
|
|
|
Ensure that the return value from a dirty NIF call is made part of the GC
rootset. Add a new regression test to nif_SUITE.
Thanks to Daniel Goertzen for reporting the error and providing a test
case, and to Sverker Eriksson for making test case reproducible and finding
the fix.
|
|
This patch allows checking for NIF API version in a way similar to
driver version. E.g. by calling erlang:system_info(nif_version).
Signed-off-by: Peter Lemenkov <[email protected]>
|
|
* egil/nox/maps-match_specs/OTP-12270:
erts: Fix return value from erts_maps_get to be const
Properly support maps in match_specs
Support maps in ms_transform
Return pointer to value in erts_maps_get()
|
|
* maint:
Use isfinite() instead of finite() when available
|
|
* sv/isfinite/OTP-12268:
Use isfinite() instead of finite() when available
|
|
OS X Mavericks builds result in a number of warnings about finite() being
deprecated, like these:
beam/erl_arith.c:451:7: warning: 'finite' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
ERTS_FP_ERROR(p, f1.fd, goto badarith);
^
sys/unix/erl_unix_sys.h:319:33: note: expanded from macro 'ERTS_FP_ERROR'
^
sys/unix/erl_unix_sys.h:244:51: note: expanded from macro '__ERTS_FP_ERROR'
^
/usr/include/math.h:718:12: note: 'finite' has been explicitly marked deprecated here
extern int finite(double) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
Add checks to use isfinite() instead of finite() where available. Verified
on OS X Mavericks 10.9.5 and Ubuntu 12.04.
|
|
* rickard/master/eager-check-io/OTP-12117:
No eager check I/O on OSE
Introduce support for eager check I/O scheduling
|
|
* rickard/maint-17/eager-check-io/OTP-12117:
No eager check I/O on OSE
Introduce support for eager check I/O scheduling
|
|
|
|
|
|
rickard/master/eager-check-io/OTP-12117
* rickard/maint-17/eager-check-io/OTP-12117:
No eager check I/O on OSE
Introduce support for eager check I/O scheduling
Conflicts:
erts/preloaded/ebin/erlang.beam
|
|
rickard/maint-17/eager-check-io/OTP-12117
* rickard/eager-check-io/OTP-12117:
Introduce support for eager check I/O scheduling
Conflicts:
erts/emulator/beam/erl_bif_info.c
erts/emulator/beam/erl_init.c
erts/emulator/beam/erl_process.c
erts/preloaded/ebin/erlang.beam
|
|
|
|
|
|
and add 'dirty_scheduler_support' to ErlNifSysInfo
|
|
* maint:
Only run upper boundry tuple test with lots of memory
|
|
* rickard/memory_consuming_tuple_tests:
Only run upper boundry tuple test with lots of memory
|
|
|
|
|
|
* sverk/MIN_SMALL-to-integer:
erts: Correct conversion of MIN_SMALL numeral to fixnum
OTP-12140
|
|
list_to_integer and binary_to_integer returned un-normalized bignum for
-134217728 on 32-bit and -576460752303423488 on 64-bit.
Thanks to Jesper Louis Andersen, Mikael Pettersson
and Anthony Ramine for report, initial patch and optimization suggestion.
|
|
|
|
* sverk/nif-inspect-copy-bug/OTP-9828:
erts: Fix bug with enif_make_copy reallocating writable binary
Conflicts:
erts/emulator/test/nif_SUITE.erl
|
|
that could invalidate a pointer received from an earlier
call to enif_inspect_binary.
Solution: Emasculate writable binary at enif_inspect_binary. There are
room for optimizations here as we now do an unconditional emasculation
even though enif_make_copy is not called later in the NIF.
|
|
* maint:
Fix busy_port_SUITE:io_to_busy test-case
Ensure "runnable port" trace messages are not sent out of order
Ensure "runnable proc" trace messages are not sent out of order
|
|
* rickard/runnable-trace-ooo-bug/OTP-12105:
Fix busy_port_SUITE:io_to_busy test-case
Ensure "runnable port" trace messages are not sent out of order
Ensure "runnable proc" trace messages are not sent out of order
|
|
* maint:
add enif_schedule_nif() to NIF API
|
|
In the #erlang IRC channel Anthony Ramine once mentioned the idea of
allowing a NIF to use an emulator trap, similar to a BIF trap, to schedule
another NIF for execution. This is exactly how dirty NIFs were implemented
for Erlang/OTP 17.0, so this commit refactors and generalizes that dirty
NIF code to support a new enif_schedule_nif() API function.
The enif_schedule_nif() function allows a long-running NIF to be broken
into separate NIF invocations. The NIF first executes part of the
long-running task, then calls enif_schedule_nif() to schedule a NIF for
later execution to continue the task. Any number of NIFs can be scheduled
in this manner, one after another. Since the emulator regains control
between invocations, this helps avoid problems caused by native code tying
up scheduler threads for too long.
The enif_schedule_nif() function also replaces the original experimental
dirty NIF API. The function takes a flags parameter that a caller can use
to indicate the NIF should be scheduled onto either a dirty CPU scheduler
thread, a dirty I/O scheduler thread, or scheduled as a regular NIF on a
regular scheduler thread. With this change, the original experimental
enif_schedule_dirty_nif(), enif_schedule_dirty_nif_finalizer() and
enif_dirty_nif_finalizer() API functions are no longer needed and have been
removed. Explicit scheduling of a dirty NIF finalization function is no
longer necessary; if an application wants similar functionality, it can
have a dirty NIF just invoke enif_schedule_nif() to schedule a non-dirty
NIF to complete its task.
Lift the restriction that dirty NIFs can't call enif_make_badarg() to raise
an exception. This was a problem with the original dirty NIF API because it
forced developers to get and check all incoming arguments in a regular NIF,
and then schedule the dirty NIF which then had to get all the arguments
again. Now, the argument checking can be done in the dirty NIF and it can
call enif_make_badarg() itself to flag incorrect arguments.
Extend the ErlNifFunc struct with a new flags field that allows NIFs to be
declared as dirty. The default value for this field is 0, indicating a
regular NIF, so it's backwards compatible with all existing statically
initialized ErlNifFunc struct instances, and so such instances require no
code changes. Defining the flags field with a value of
ERL_NIF_DIRTY_JOB_CPU_BOUND indicates that the NIF should execute on a
dirty CPU scheduler thread, or defining it with a value of
ERL_NIF_DIRTY_JOB_IO_BOUND indicates that the NIF should execute on a dirty
I/O scheduler thread. Any other flags field value causes a NIF library
loading error.
Extend the ErlNifEntry struct with a new options field that indicates
whether a NIF library was built with support for optional features such as
dirty NIFs. When a NIF library is loaded, the runtime checks the options
field to ensure compatibility. If a NIF library built with dirty NIF
support is loaded into a runtime that does not support dirty NIFs, and the
library defines one or more ErlNifFunc entries with non-zero flags fields
indicating dirty NIFs, a NIF library loading error results. There is no
error if a NIF library built with dirty NIF support is loaded into a
runtime that does not support dirty NIFs but the library does not have any
dirty NIFs. It is also not an error if a library without dirty NIF support
is loaded into a runtime built with dirty NIF support.
Add documentation and tests for enif_schedule_nif().
|
|
|
|
|
|
* egil/proc_lib-optimizations/OTP-12060:
stdlib: Update dependencies to erts-6.2
erts: Update preloaded erlang.beam
stdlib: Use erlang:fun_info_mfa/1 in proc_lib:init_p/3
erts: Test erlang:fun_info_mfa/1
erts: Introduce erlang:fun_info_mfa/1
|
|
|
|
* maint:
Fix build of test port program
Update Makefile.src
Add async_ports test
Fix abort of nosuspend-tasks in erts_port_task_schedule()
|
|
* rickard/nosuspend-bug/OTP-12082:
Fix build of test port program
Update Makefile.src
Add async_ports test
Fix abort of nosuspend-tasks in erts_port_task_schedule()
|
|
|
|
* maint:
erts: Fix tc and docs after {fd,FD} bind change
|
|
The sha of the original change is 52810718b
|
|
|
|
|
|
|
|
|
|
* rickard/binary_to_term_error/OTP-11931:
Replace erlang:binary_to_term() Erlang wrappers
Conflicts:
erts/preloaded/ebin/erts_internal.beam
|