aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
AgeCommit message (Collapse)Author
2016-02-04Fix bug causing run-queue mask to become inconsistentRickard Green
2015-12-04Remove ERTS_PRINT_INVALID from erts_print()Rickard Green
ERTS_PRINT_INVALID prevented file descriptor 0 to be used which could cause an empty crash dump.
2015-11-19Fix error propagate from setoptsRaimo Niskanen
2015-09-07Merge branch 'sverk/trace-process_dump-matchstate-17/OTP-12968' into maint-17Erlang/OTP
* sverk/trace-process_dump-matchstate-17/OTP-12968: erts: Add testcase for tracing whith 'process_dump' erts: Fix bug when tracing with 'process_dump'
2015-09-01erts: Add testcase for tracing whith 'process_dump'Sverker Eriksson
of a process with a matchstate on the stack.
2015-09-01erts: Fix bug when tracing with 'process_dump'Sverker Eriksson
If the process stack contained a match state the print function would crash the vm as it was not recognized by tag_val_def(). Add new MATCHSTATE_DEF returned by tag_val_def(). All other callers either ignore it or has a default clause to handle invalid terms.
2015-07-06Merge branch 'rickard/non-smp-trace-port-exit-bug/OTP-12889' into maint-17Erlang/OTP
* rickard/non-smp-trace-port-exit-bug/OTP-12889: Teach non-smp VM how to deal with trace port crash Test case testing crash in tracer port
2015-07-06Teach non-smp VM how to deal with trace port crashRickard Green
2015-07-06Test case testing crash in tracer portRickard Green
2015-06-25Merge branch 'sverk/poll-lost-wakeup/OTP-12859' into maint-17Erlang/OTP
* sverk/poll-lost-wakeup/OTP-12859: erts: Fix race in poller thread wake up
2015-06-22erts: Fix race in poller thread wake upSverker Eriksson
2015-05-25erts: Fix garbage collect literals in code purgeBjörn-Egil Dahlberg
During code purging and check_process_code, the checking of the binary reference embedded in the match binary state was omitted for the tracing tests. This would cause the binary match state to reference deallocated memory.
2015-03-27Merge branch 'sverk/large-list_to_integer-bug/OTP-12624' into maintSverker Eriksson
* sverk/large-list_to_integer-bug/OTP-12624: erts: Fix bug in list_to_integer for very large strings
2015-03-26Merge branch 'egil/maint/process_dictionary-initial-size/OTP-12535' into maintBjörn-Egil Dahlberg
* egil/maint/process_dictionary-initial-size/OTP-12535: erts: Document option 'hpds' erts: Enable command line argument for initial pd size
2015-03-25erts: Fix bug in list_to_integer for very large stringsSverker Eriksson
list_to_integer(lists:duplicate(10000000,$0)). crashed due to overflow when calculating nr heap words.
2015-03-25erts: Enable command line argument for initial pd sizeBjörn-Egil Dahlberg
Use '+hpds size' to set initial process dictionary size for spawned processes.
2015-03-24erts: Fix comparison of exact termsBjörn-Egil Dahlberg
Comparison of exact terms could cause faulty term tests. This was caused by a faulty (too small) internal type. Symptom: -1 = erts_internal:cmp_term(2147483648,0). %% wrong Correct: 1 = erts_internal:cmp_term(2147483648,0). Reported-by: Jesper Louis Andersen
2015-03-20Merge branch 'nox/fix-port_info-race' into maintZandra Hird
* nox/fix-port_info-race: Fix a race condition when calling port_info/1 OTP-12587
2015-03-18Merge branch 'nlmills/cleanup' into maintZandra Hird
* nlmills/cleanup: Remove unused time macros from efile_drv
2015-03-18Merge branch 'wmalik/minor-fixes' into maintZandra Hird
* wmalik/minor-fixes: Fix proc_lib doc Remove commented out code Fix make_hash description
2015-03-18Fix a race condition when calling port_info/1Anthony Ramine
This variable hold the values returned by erlang:port_info/1 and shouldn't be static. Reported-by: Heinz Nikolaus Gies
2015-03-17Merge branch 'rickard/port_control_flags_crash/OTP-12544' into maintRickard Green
* rickard/port_control_flags_crash/OTP-12544: Make access to control_flags safe in non-smp emulator
2015-03-14Remove unused time macros from efile_drvNick Mills
All uses of these macros were removed in commit c3a615aa2da09bc3a0575e973959f800460a63de.
2015-03-12Merge branch 'mikpe/hipe-mfait-rwlock' into maintHenrik Nord
* mikpe/hipe-mfait-rwlock: hipe: change mfa_info_table lock to rwmutex OTP-12557
2015-03-12Merge branch 'mikpe/avoid-oversize-bignums' into maintHenrik Nord
* mikpe/avoid-oversize-bignums: don't leave a heap hole in erts_bs_get_integer_2 don't create oversize bignums in binary matching OTP-12556
2015-03-06Merge branch 'leoliu/master' into maintZandra Hird
* leoliu/master: Two minor fixes OTP-12545
2015-03-06Make access to control_flags safe in non-smp emulatorRickard Green
2015-02-27Two minor fixesLeo Liu
* Fix documentation on $char for unicode * Remove duplicate declaration for erts_encode_ext_dist_header_size
2015-02-26hipe: change mfa_info_table lock to rwmutexMikael Pettersson
The hipe_mfa_info_table lock is currently a mutex, causing unnecessary contention and serialization of lookups for apply-like constructs. - change the lock from a mutex to an rwmutex - split hipe_get_na_nofail_locked into a "try" path which only needs a read lock, and a "slow" path which requires a write lock - reimplement hipe_get_na_nofail (used by apply ops etc) to first call the "try" path with a read lock, and if that fails the "slow" path with a write lock - reimplement hipe_get_na_nofail_locked (used by maintenance code) to call the "try" path and then optionally the "slow" path, but without taking locks since its caller already has the write lock - adjust remaining lock ops to take/release full write lock - use _rwlocked as suffix on functions requiring a write lock - change hipe_mfa_get_trampoline to call get_locked not put_locked, allowing it to take a read lock instead of a write lock - change hipe_find_mfa_from_ra() to only take a read lock
2015-02-21Fix make_hash descriptionWasif Malik
2015-02-20erts: Fix erroneous printout in crashdumpBjörn-Egil Dahlberg
An extra '}' were printed in remote links.
2015-02-14don't leave a heap hole in erts_bs_get_integer_2Mikael Pettersson
Reset p->htop in the oversize bignum error case to avoid leaving a hole in the heap, which would crash the debug emulator.
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-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-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-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