Age | Commit message (Collapse) | Author |
|
Bignums are artifically restricted in size. Arithmetic and logical
operations check the sizes of resulting bignums, and turn oversize
results into system_limit exceptions.
However, this check is not performed when bignums are constructed by
binary matching. The consequence is that such matchings can construct
oversize bignums that satisfy is_integer/1 yet don't work. Performing
arithmetic such as Term - 0 fails with a system_limit exception. Worse,
performing a logical operation such as Term band Term results in [].
The latter occurs because the size checking (e.g. in erts_band()) is
a simple ASSERT(is_not_nil(...)) on the result of the bignum operation,
which internally is [] (NIL) in the case of oversize results. However,
ASSERT is a no-op in release builds, so the error goes unnoticed and []
is returned as the result of the band/2.
This patch addresses this by preventing oversize bignums from entering
the VM via binary matching:
- the internal bytes_to_big() procedure is augmented to return NIL for
oversize results, just like big_norm()
- callers of bytes_to_big() are augmented to check for NIL returns and
signal errors in those cases
- erts_bs_get_integer_2() can only fail with badmatch, so that is the
Erlang-level result of oversize bignums from binary matches
- big_SUITE.erl is extended with a test case that fails without this
fix (no error signalled) and passes with it (badmatch occurs)
Credit goes to Nico Kruber for the initial bug report.
|
|
|
|
|
|
* egil/fix-getifaddrs-realloc/OTP-12445:
erts: Fix getifaddrs realloc ptr mismatch
|
|
* egil/fix-child_setup-close/OTP-12446:
erts: Use closefrom() if available when closing fds
erts: Don't close all fds twice in child_setup
|
|
When a buffer was exhausted and subsequently a realloc, we could get
an invalid pointer.
For this to occur we would need to have a realloc to lower adresses.
The symptom would be garbage returned from erlang:port_control(Port, 25, [])
(prim_inet:getifaddrs(Port) resulting in a badarg) or a segmentation fault.
|
|
closefrom() was only used in the vfork() case before, now also
used in the fork() case.
|
|
The commit c2b4eab25c907f453a394d382c04cd04e6c06b49 introduced an error
in which child_setup erroneously tried to close all file descriptors twice.
|
|
|
|
|
|
|
|
Closes all open socket before writing crashdump to file.
|
|
OTP-12405
* mikpe/hipe-arm-interworking:
hipe: fix ARM/Thumb interworking
|
|
* dotsimon/sctp_paddrinfo_state:
Fix inet:getopts involving #sctp_paddrinfo{}
|
|
The intention of this callback is to close all sockets associated to
a port. It is closed only on crashdumps.
This will currently only be used for the epmd port.
|
|
HiPE on ARM is currently severely broken if the rest of the VM is
compiled to run in Thumb mode -- calling native code quickly ends
up executing code in the wrong mode and crashing the VM. This is
a problem on e.g. Ubuntu which configures its system GCC to generate
Thumb by default. It can also be triggered by overriding CC or
CFLAGS when compiling the VM.
There were three issues that caused the breakage:
1. Assembly-coded functions in hipe_arm_glue.S weren't explicitly
tagged as functions, preventing the linker from generating the
correct mode-switching call instructions for calls from C to
these functions.
Fixed by tagging those symbols as functions.
2. A few BIF wrappers were so simple that they performed tailcalls
to the C BIFs. This fails to switch mode when C is in Thumb.
Fixed by performing ordinary recursive calls when C is in Thumb.
3. The assembly-coded source files weren't explicitly tagged as ARM.
Tested with the HiPE testsuite on ARMv7, with the VM built as ARM
and as Thumb. Also manually inspected the object code for the beam
executable and checked that call sites from C to HiPE's ARM runtime
code and vice versa used the correct mode-switching instructions.
|
|
|
|
* mikpe/fix-eacces-spelling:
fix eacces spelling
|
|
* haguenau/fix-endianness-speling:
Replaced "Endianess" with "Endianness" everywhere
|
|
|
|
The 64-bit atomic ops API is implemented by
* native word size atomic ops on 64-bit architectures, and
* native double word size atomic ops on 32-bit architectures
when available. When native double word size atomic is not
available, the fallback using modification counters is
used.
|
|
|
|
|
|
Handle peer addresses that are unconfirmed (i.e. in state SCTP_UNCONFIRMED).
Handle unknown states instead of using ASSERT
|
|
|
|
|
|
|
|
|
|
|
|
* lukas/erts/isfinite-fix/OTP-12268:
erts: Fix finite warning for clang
|
|
clang aka llvm claims to be __GNUC__ and thus we have to
explicitly check that it is not used.
|
|
* lukas/erts/bif_info_rebuild/OTP-12344:
Sort keys before generating
|
|
* vinoski/rm-foo-dtrace:
Clean up temporary dtrace file during config
|
|
* sverk/port_get_data-race/OTP-12208:
erts: Fix port data memory allocation bug
|
|
When configuring erts to support dynamic trace via dtrace, be sure to clean
up the temporary file "erts/foo-dtrace.h" used to help check for dtrace
support. Otherwise, it shows up as an untracked file in git.
|
|
This has to be done in order to consistently generate the same
file so that we do not get rebuilds all the time.
|
|
* rickard/maint-17/activate-runq/OTP-12287:
Do not let non-empty run-queue prevent activation of scheduler
|
|
* rickard/ppc32-atomic-opt/OTP-12250:
Optimize atomic ops with release barrier for 32-bit PowerPC
|
|
* rickard/libatomic_ops_improvements/OTP-12302:
Implement support for double word atomics using libatomic_ops
Improve usage of libatomic_ops for word size atomics
|
|
OTP-12323
* sverk/cpool-search-improvement:
erts: Add internal docs for super carrier and new cpool search.
erts: Fix bug causing mbc to be deleted from cpool before it was inserted
erts: Fix bug causing mbc removed from cpool to be used at pool entrance
erts: Add pooled_list and traitor_list
|
|
for non-immediate port data >= sizeof(Eterm)*2 words.
|
|
* sverk/with-ssl-rpath/OTP-12316:
erts,crypto: Add configure option --with-ssl-rpath
|
|
* lem/epmd_sd_notify/OTP-12321:
epmd: Unify systemd autoconf macros usage
epmd: Added systemd notify support to EPMD
|
|
Don't use both HAVE_SYSTEMD_DAEMON and HAVE_SYSTEMD_SD_DAEMON - use only
the former one and remove the latter one entirely.
Signed-off-by: Peter Lemenkov <[email protected]>
|
|
Signed-off-by: Peter Lemenkov <[email protected]>
|
|
* lukas/erts/isfinite-fix/OTP-12268:
erts: Use finite instead of isfinite with gcc
|
|
Turns out that isfinite emits a function call and not
an instruction in gcc, this makes estone float arith
about 50-75% slower. finite emits the instruction so
we use that instead.
|
|
|
|
* siri/no-unicode-atoms/OTP-12172:
Remove comments about unicode atoms in OTP 18
|
|
* s1n4/zlib_doc_typo:
Fix a typo in the zlib documentation
|