Age | Commit message (Collapse) | Author |
|
OTP-14202
* rickard/binary-refc:
Atomic reference count of binaries also in non-SMP
Conflicts:
erts/emulator/beam/beam_bp.c
|
|
NIF resources was not handled in a thread-safe manner in the runtime
system without SMP support.
As a consequence of this fix, the following driver functions are now
thread-safe also in the runtime system without SMP support:
- driver_free_binary()
- driver_realloc_binary()
- driver_binary_get_refc()
- driver_binary_inc_refc()
- driver_binary_dec_refc()
|
|
|
|
|
|
* margnus1/erts/fix-hipe-literal-gc/PR-1122/OTP-13777:
check_process_code: Sweep HiPE stack for literals
|
|
This type of statistics is now available through the microstate
accounting API.
|
|
Because check_process_code neglected checking the HiPE stack for
references to the literal area, such references would survive the purge
and subsequent deletion of a module and its literal area. These dangling
references would then cause incorrect behaviour or even hard crashes of
the VM.
By simply adding a scan of the HiPE stack to check_process_code and
erts_garbage_collect_literals, this problem is fixed.
In order to support full stack walks without deleting the graylimit
trap, a new stack walking interface function,
nstack_walk_init_sdesc_ignore_trap() was introduced.
|
|
The trap frame allocation wrappers occasionally call the garbage
collector, even though built-in functions are not supposed to.
On non-{x86,amd64} platforms, HiPE was optimising the BIF wrapper
interface on the basis that BIFs do not GC. So, when
hipe_reserve_beam_trap_frame called the garbage collector, the state in
the PCB was stale and corruption happened.
Now, these particular BIFs are reclassified as GC BIFs.
Unfortunately, in order to do that we needed to introduce a
gc_bif_interface_3 macro in every hipe_$ARCH_bifs.m4 file.
|
|
An easy source of tricky bugs is to start calling the garbage collector
from a built-in function without adding that bif to hipe_bif_list.m4.
With this change we, in the debug build, keep track of whether the
canonical stack and heap pointers are stored in the PCB or in
registers/stack, allowing us to catch this class of mistakes with an
assertion.
|
|
* rickard/mv-dirty-reds-count/OTP-13123:
Move dirty reduction count to erts_dirty_process_main()
|
|
|
|
|
|
|
|
by actually using the cached hash value.
|
|
Multiplying two atoms will always yield the same low 6 bits.
The most important tabke 'export' was saved by the
prime number table size which seemed to yield a decent uniform
distribution anyway.
|
|
|
|
Since 3.7, LLVM sometimes generates SSE constants in a special constant
section with the requisite alignment (".rodata.cst16"). This broke
hipe_llvm since it assumed that all constants that were linked from the
text section were constants generated by hipe_llvm.
As this is the first time alignments larger than 8 have been required,
some small changes were required to hipe_consttab and
hipe_bifs:alloc_data/2. Note that hipe_bifs:alloc_data/2 still assumes
that erl_alloc will provide the requisite alignment.
|
|
|
|
|
|
All 'EXIT' and monitor messages are sent from 'system'
Timeouts are "sent" from 'clock_service'
|
|
|
|
as is trips up my editor symbol tagging.
|
|
LLVM likes to use relocation addends on x86, which HiPE was ignoring,
causing crashes.
|
|
|
|
|
|
that uses its own super carrier (erts_exec_mmapper)
to guarantee low addressed and executable memory (PROT_EXEC).
Currently only used on x86_64 that needs low memory
for HiPE/AMD64's small code model.
By initializing erts_exec_mapper early we secure
its low memory area before erts_literal_mmapper might
steal it.
|
|
Add the possibility to use modules as trace data receivers. The functions
in the module have to be nifs as otherwise complex trace probes will be
very hard to handle (complex means trace probes for ports for example).
This commit changes the way that the ptab->tracer field works from always
being an immediate, to now be NIL if no tracer is present or else be
the tuple {TracerModule, TracerState} where TracerModule is an atom that
is later used to lookup the appropriate tracer callbacks to call and
TracerState is just passed to the tracer callback. The default process and
port tracers have been rewritten to use the new API.
This commit also changes the order which trace messages are delivered to the
potential tracer process. Any enif_send done in a tracer module may be delayed
indefinitely because of lock order issues. If a message is delayed any other
trace message send from that process is also delayed so that order is preserved
for each traced entity. This means that for some trace events (i.e. send/receive)
the events may come in an unintuitive order (receive before send) to the
trace receiver. Timestamps are taken when the trace message is generated so
trace messages from differented processes may arrive with the timestamp
out of order.
Both the erlang:trace and seq_trace:set_system_tracer accept the new tracer
module tracers and also the backwards compatible arguments.
OTP-10267
|
|
|
|
|
|
This is mostly a pure refactoring.
Except for the buggy cases when calling erlang:halt() with a positive
integer in the range -(INT_MIN+2) to -INT_MIN that got confused with
ERTS_ABORT_EXIT, ERTS_DUMP_EXIT and ERTS_INTR_EXIT.
Outcome OLD erl_exit(n, ) NEW erts_exit(n, )
------- ------------------- -------------------------------------------
exit(Status) n = -Status <= 0 n = Status >= 0
crashdump+abort n > 0, ignore n n = ERTS_ERROR_EXIT < 0
The outcome of the old ERTS_ABORT_EXIT, ERTS_INTR_EXIT and
ERTS_DUMP_EXIT are the same as before (even though their values have
changed).
|
|
OTP-13341
* sverk/erts-hipe_x86_signal-cleanups:
hipe_sigaltstack: correct initialization of ss.ss_flags
hipe_x86_signal: cleanups
hipe_x86_signal: cleanups
hipe_x86_signal: cleanups
hipe_x86_signal: cleanups
hipe_x86_signal: cleanups
hipe_x86_signal: cleanups
|
|
SS_ONSTACK may be set in oss, but it's not supposed to be set
in ss, and some systems correctly reject that; current Linux
kernels accept but ignore it in ss
|
|
Conflicts:
erts/emulator/beam/beam_emu.c
|
|
* margnus1/bs_unit_fix:
hipe: Fix signed compares of unsigned sizes
beam: Fix overflow bug in i_bs_add_jId
hipe: Add tests for bad bit syntax float sizes
Add a case testing the handling of guards involving binaries
Add some more binary syntax construction tests
hipe: Guard against enormous numbers in ranges
hipe: Fix constructing huge binaries
hipe: Fix binary constructions failing with badarith
Add missing corner-case to bs_construct_SUITE
hipe: Allow unsigned args in hipe_rtl_arith
hipe: test unit size match in bs_put_binary_all
hipe: test unit size match in bs_append
Fix hipe_rtl_binary_construct:floorlog2/1
OTP-13272
|
|
- replace system-specific #ifndef around sigaction() override with a test
for OVERRIDE_SIGACTION, #define or #undef that as appropriate in each
system-specific block
|
|
- move extern declarations of LIBC_SIGACTION() from system-specific
blocks to the common LIBC_SIGACTION block
|
|
- rename __next_sigaction to next_sigaction, to avoid defining _-prefixed symbols
- factor out common code for declaring and initializing next_sigaction,
system-specific code now only needs to #define NEXT_SIGACTION
|
|
- rename __SIGACTION to LIBC_SIGACTION, to avoid defining _-prefixed symbols
|
|
- add block for NetBSD, define dummy INIT() macro
- eliminate ifndef NetBSD around INIT() invocation
|
|
- remove glibc < 2.3 code
- move glibc-2.2 comment to glibc >= 2.3 block
- remove obsolete "only supports" comment
- remove support for broken sigaltstack() in pre-2.4 Linux kernels
|
|
Conflicts:
OTP_VERSION
erts/vsn.mk
|
|
* erts/emulator/hipe/hipe_x86_signal.c:
add FreeBSD sigaction code, based on the Darwin (OS X) code
|
|
* lukas/erts/forker: (28 commits)
erts: Never abort in the forked child
erts: Mend ASSERT makro for erl_child_setup
erts: Allow enomem failures in port_SUITE
erts: iter_port sleep longer on freebsd
erts: Allow one dangling fd if there is a gethost port
erts: Only use forker StackAck on freebsd
erts: It is not possible to exit the forker driver
erts: Add forker StartAck for port start flowcontrol
erts: Fix large open_port arg segfault for win32
erts: Fix memory leak at async open port
kernel: Remove cmd server for unix os:cmd
erts: Add testcase for huge port environment
erts: Move os_pid to port hash to child setup
erts: Handle all EINTR and EAGAIN cases in child setup
erts: Make child_setup work with large environments
erts: Fix forker driver ifdefs for win32
erts: Fix uds socket handling for os x
erts: Fix dereferencing of unaligned integer for sparc
erts: Flatten too long io vectors in uds write
erts: Add fd count test for spawn_driver
...
Conflicts:
erts/emulator/beam/erl_node_tables.c
erts/preloaded/src/erts_internal.erl
|
|
|
|
* rickard/ohmq-fixup/OTP-13047:
Replace off_heap_message_queue option with message_queue_data option
Always use literal_alloc
Distinguish between GC disabled by BIFs and other disabled GC
Fix process_info(_, off_heap_message_queue)
Off heap message queue test suite
Remove unused variable
Fix memory leaks
|
|
Processes remember heap fragments that are known to be fully
live due to creation in a just called BIF that yields in the
live_hf_end field. This field must not be used if we have not
disabled GC in a BIF. F_DELAY_GC has been introduced in order
to distinguish between to two different scenarios.
- F_DISABLE_GC should *only* be used by BIFs. This when
the BIF needs to yield while preventig a GC.
- F_DELAY_GC should only be used when GC is temporarily
disabled while the process is scheduled. A process must
not be scheduled out while F_DELAY_GC is set.
|
|
|
|
This feature was previously missing and expressions such as
<<<<1:1>>/binary>> would succeed construction when compiled with HiPE.
A primop is_divisible is introduced to handle the case when the unit
size is not a power of two.
|
|
- change #if tests at default Solaris case to explicitly check for __sun__
- add new default case, instantiate it for musl
|
|
* rickard/gc-bump-reds/OTP-13097:
Bump reductions on GC
|