aboutsummaryrefslogtreecommitdiffstats
path: root/erts
AgeCommit message (Collapse)Author
2015-02-04don't create oversize bignums in binary matchingMikael Pettersson
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.
2015-02-03Merge branch 'maint-17' into maintZandra Hird
2015-01-30Prepare releaseErlang/OTP
2015-01-30Merge branch 'egil/fix-getifaddrs-realloc/OTP-12445' into maint-17Erlang/OTP
* egil/fix-getifaddrs-realloc/OTP-12445: erts: Fix getifaddrs realloc ptr mismatch
2015-01-30Merge branch 'egil/fix-child_setup-close/OTP-12446' into maint-17Erlang/OTP
* 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
2015-01-29erts: Fix getifaddrs realloc ptr mismatchBjörn-Egil Dahlberg
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.
2015-01-27erts: Use closefrom() if available when closing fdsBjörn-Egil Dahlberg
closefrom() was only used in the vfork() case before, now also used in the fork() case.
2015-01-27erts: Don't close all fds twice in child_setupBjörn-Egil Dahlberg
The commit c2b4eab25c907f453a394d382c04cd04e6c06b49 introduced an error in which child_setup erroneously tried to close all file descriptors twice.
2015-01-23erts: Check driver version before assigning callbackBjörn-Egil Dahlberg
2015-01-23erts: Don't lookup invalid port for crashdump handlingBjörn-Egil Dahlberg
2015-01-23erts: Reserve a file descriptor for the crashdump fileBjörn-Egil Dahlberg
2015-01-23erts: Use emergency close to close epmdBjörn-Egil Dahlberg
Closes all open socket before writing crashdump to file.
2015-01-15Merge branch 'mikpe/hipe-arm-interworking' into maintBruce Yinhe
OTP-12405 * mikpe/hipe-arm-interworking: hipe: fix ARM/Thumb interworking
2015-01-14Merge branch 'dotsimon/sctp_paddrinfo_state' into maintMarcus Arendt
* dotsimon/sctp_paddrinfo_state: Fix inet:getopts involving #sctp_paddrinfo{}
2015-01-13erts: Extend driver interface with emergency_closeBjörn-Egil Dahlberg
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.
2015-01-11hipe: fix ARM/Thumb interworkingMikael Pettersson
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.
2014-12-22Merge branch 'mikpe/fix-eacces-spelling' into maintBruce Yinhe
* mikpe/fix-eacces-spelling: fix eacces spelling
2014-12-18Merge branch 'haguenau/fix-endianness-speling' into maintBruce Yinhe
* haguenau/fix-endianness-speling: Replaced "Endianess" with "Endianness" everywhere
2014-12-10Use the new 64-bit atomic ops APIRickard Green
2014-12-10Introduce a 64-bit atomic ops APIRickard Green
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.
2014-12-09Prepare releaseErlang/OTP
2014-12-09Update preloaded modulesMarcus Arendt
2014-12-08Fix inet:getopts involving #sctp_paddrinfo{}Simon Cornish
Handle peer addresses that are unconfirmed (i.e. in state SCTP_UNCONFIRMED). Handle unknown states instead of using ASSERT
2014-12-08Add .appup fileRickard Green
2014-12-03Fix function "defined but not used" warningRickard Green
2014-12-03erts: Fix some spelling in internal docsSverker Eriksson
2014-12-02fix eacces spellingMikael Pettersson
2014-12-02Replaced "Endianess" with "Endianness" everywhereDavid Haguenauer
2014-12-02Merge branch 'lukas/erts/isfinite-fix/OTP-12268' into maintLukas Larsson
* lukas/erts/isfinite-fix/OTP-12268: erts: Fix finite warning for clang
2014-12-02erts: Fix finite warning for clangLukas Larsson
clang aka llvm claims to be __GNUC__ and thus we have to explicitly check that it is not used.
2014-12-02Merge branch 'lukas/erts/bif_info_rebuild/OTP-12344' into maintLukas Larsson
* lukas/erts/bif_info_rebuild/OTP-12344: Sort keys before generating
2014-12-01Merge branch 'vinoski/rm-foo-dtrace' into maintMarcus Arendt
* vinoski/rm-foo-dtrace: Clean up temporary dtrace file during config
2014-11-26Merge branch 'sverk/port_get_data-race/OTP-12208' into maintSverker Eriksson
* sverk/port_get_data-race/OTP-12208: erts: Fix port data memory allocation bug
2014-11-26Clean up temporary dtrace file during configSteve Vinoski
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.
2014-11-26Sort keys before generatingLukas Larsson
This has to be done in order to consistently generate the same file so that we do not get rebuilds all the time.
2014-11-25Merge branch 'rickard/maint-17/activate-runq/OTP-12287' into maintRickard Green
* rickard/maint-17/activate-runq/OTP-12287: Do not let non-empty run-queue prevent activation of scheduler
2014-11-25Merge branch 'rickard/ppc32-atomic-opt/OTP-12250' into maintRickard Green
* rickard/ppc32-atomic-opt/OTP-12250: Optimize atomic ops with release barrier for 32-bit PowerPC
2014-11-25Merge branch 'rickard/libatomic_ops_improvements/OTP-12302' into maintRickard Green
* rickard/libatomic_ops_improvements/OTP-12302: Implement support for double word atomics using libatomic_ops Improve usage of libatomic_ops for word size atomics
2014-11-25Merge branch 'sverk/cpool-search-improvement' into maintSverker Eriksson
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
2014-11-25erts: Fix port data memory allocation bugSverker Eriksson
for non-immediate port data >= sizeof(Eterm)*2 words.
2014-11-25Merge branch 'sverk/with-ssl-rpath/OTP-12316' into maintSverker Eriksson
* sverk/with-ssl-rpath/OTP-12316: erts,crypto: Add configure option --with-ssl-rpath
2014-11-25Merge branch 'lem/epmd_sd_notify/OTP-12321' into maintLukas Larsson
* lem/epmd_sd_notify/OTP-12321: epmd: Unify systemd autoconf macros usage epmd: Added systemd notify support to EPMD
2014-11-24epmd: Unify systemd autoconf macros usagePeter Lemenkov
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]>
2014-11-24epmd: Added systemd notify support to EPMDPeter Lemenkov
Signed-off-by: Peter Lemenkov <[email protected]>
2014-11-24Merge branch 'lukas/erts/isfinite-fix/OTP-12268' into maintLukas Larsson
* lukas/erts/isfinite-fix/OTP-12268: erts: Use finite instead of isfinite with gcc
2014-11-24erts: Use finite instead of isfinite with gccLukas Larsson
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.
2014-11-20erts,crypto: Add configure option --with-ssl-rpathSverker Eriksson
2014-11-18Merge branch 'siri/no-unicode-atoms/OTP-12172' into maintSiri Hansen
* siri/no-unicode-atoms/OTP-12172: Remove comments about unicode atoms in OTP 18
2014-11-12Merge branch 's1n4/zlib_doc_typo' into maintBruce Yinhe
* s1n4/zlib_doc_typo: Fix a typo in the zlib documentation
2014-11-11Remove comments about unicode atoms in OTP 18Siri Hansen
There was once a plan to implement support for unicode atoms in OTP 18. This plan has been stopped until further notice, and the information about this is now removed from the documentation.