aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
AgeCommit message (Collapse)Author
2017-11-17Merge branch 'sverker/async-auto-connect/OTP-14370'Sverker Eriksson
* sverker/async-auto-connect/OTP-14370: (37 commits) Move new|abort_connection_id to erts_internal Refactor erts_dsig_prepare argument dep(p) Cleanup net_kernel Improve connection aborting Abort all pending connections if net_kernel terminates erts: Put pending DistrEntry in separate list Refactor auto_connect into an outline function Remove unused ERTS_DSP_RWLOCK fix erlang specs and preloaded erts: Keep magic ref to DistEntry in net_kernel Allow DistEntries in ETS Remove faulty assert erts: Transcode tuple fallbacks erts: Ensure enc_term_int() always do progress erl_interface: Add tuple fallback tests erl_interface: Refactor ei_accept_SUITE Add optimistic DFLAG_DIST_HOPEFULLY for pending connections erts: Fix auto-connect toward erl_interface/jinterface erts: Let send(_,_,[noconnect]) enqueue msg on pending connection. Remove obsolete erlang:dgroup_leader ...
2017-11-16Merge pull request #1626 from bjorng/bjorn/erts/fix-receive-opt/ERL-511Björn Gustavsson
Fix broken receive mark after an exception OTP-14782
2017-11-15Add optimistic DFLAG_DIST_HOPEFULLY for pending connectionsSverker Eriksson
to avoid tuple fallbacks for export funs and bitstrings. ToDo: Re-encode if receiver turn out to be erl_interface/jinterface.
2017-11-15erts: Async auto-connect for group_leader/2Sverker Eriksson
2017-11-15erts: Async auto-connect for monitor_nodeSverker Eriksson
Removed distribution_SUITE:applied_monitor_node as it seems to test apply of trapping BIF and monitor_node does not trap anymore.
2017-11-15erts: Make DFLAGS_NEW_FUN_TAGS mandatorySverker Eriksson
and remove ugly encoding fallback as {fun, ...} DFLAGS_NEW_FUN_TAGS has been supported by vm/erl_interface/jinterface since R13 or even older. Renamed test case obsolete_funs to term2bin_tuple_fallbacks and removed test for {fun,...} fallback and added missing test for bitstring fallback {Binary, Bits}.
2017-11-15erts: Refactoring in distribution_SUITESverker Eriksson
for set/get_internal_state calls.
2017-11-15erts: Fix bug in DistEntry refc danceSverker Eriksson
to handle "lookup without refc++" correctly which was introduced in 4dcb2ae7810a507b701a30072b2f514cab7ebbdb. When decrementing refc to zero (in try_delete or prepare_try_delete) we must always wait thread progress to make sure no thread has done lookup without refc++ and is just about to do refc++ and thereby revive the DistEntry. That is, we wait for a potential other thread to either do refc++ or drop its pointer to the DistEntry. And if that other thread does refc++ (in erts_ref_dist_entry) it must also do the extra refc++ for the scheduled pending delete.
2017-11-15Merge PR-1605 from sverker/sverker/binary_to_term-used OTP-14780Sverker Eriksson
Add 'used' option for binary_to_term/2
2017-11-15Merge branch 'maint'Sverker Eriksson
2017-11-15Merge branch 'sverker/test-cuddle' into maintSverker Eriksson
2017-11-14Fix broken receive optimizationBjörn Gustavsson
When a ref is created before performing a receive that will only receive message containing that ref, there is a compiler optimization to avoid scanning messages that can't possible contain the newly created ref. Magnus Lång pointed out that the implementation of the optimization is flawed. Exceptions or recursive calls could cause the receive operation to scan the receive queue from a position beyond the expected message (that is, the message containing the ref would never be matched out). See the receive_opt_exception/1 and receive_opt_recursion/1 test cases in receive_SUITE. It turns out that we can simplify the implementation of the optimization while fixing the bug (suggested by Magnus Lång). We actually don't need the c_p->msg.mark field. It is enough to have c_p->msg.saved_pos; if it is non-zero, it is a valid position in the message qeueue. All we need to do is to ensure that we clear c_p->msg.saved_pos when a receive is exited normally or abnormally. We can clear c_p->msg.saved_pos in JOIN_MESSAGE(), since it is called both when leaving a receive because a message matched and because there was a timeout and the 'after' clause was executed. In addition, we need to clear c_p->msg.saved_pos when an exception is caught. https://bugs.erlang.org/browse/ERL-511
2017-11-09erts: Fix race in distribution_SUITE:bad_dist_structSverker Eriksson
Symptom: random rpc net_adm:ping returned pang Use monitor_node to wait for failed connection before we try to connect again.
2017-11-09erts: Fix distribution_SUITE:bad_dist_ext_sizeSverker Eriksson
for "+hmqd off_heap"
2017-11-07Merge branch 'sverker/systask-reqid-bug/OTP-14752' into maintSverker Eriksson
* sverker/systask-reqid-bug: erts: Fix bug in systask scheduling
2017-11-07Merge branch 'sverker/systask-reqid-bug'Sverker Eriksson
* sverker/systask-reqid-bug: erts: Fix bug in systask scheduling
2017-11-06erts: Fix bug in systask schedulingSverker Eriksson
when request id is an immediate. Ex: erlang:garbage_collect(P, [{async,Immediate}]). may crash the VM.
2017-10-30Merge branch 'lukas/erts/misc_fixes'Lukas Larsson
* lukas/erts/misc_fixes: erts: Fix a bunch of compiler warnings kernel: Fix gen_tcp_misc indentation erts: Fail port_SUITE:huge_env if error code > 127 erts: Add lcnt prototype for dist locks update
2017-10-27Correct erlang:is_builtin/3 for apply/2 and yield/0Björn Gustavsson
erlang:is_builtin(erlang, M, F) returns false for apply/2 and yield/0. The documentation for erlang:is_builtin/3 says that it returns true for BIFs that are implemented in C. apply/2 and yield/0 are implemented in C (as BEAM instructions), and therefore the correct return value is true. Also see a similar argument that was made for apply/3 in the past: http://erlang.org/pipermail/erlang-bugs/2015-October/005101.html https://bugs.erlang.org/browse/ERL-500
2017-10-18erts: Fail port_SUITE:huge_env if error code > 127Lukas Larsson
This can happen for instance if erl_child_setup segfaults before it can do the execv.
2017-10-18Merge branch 'bjorn/erts/cuddle-with-tests'Björn Gustavsson
* bjorn/erts/cuddle-with-tests: Eliminate use of deprecated functions in string Eliminate warnings for ignoring the result of an expression
2017-10-17erts: Add 'used' option to binary_to_term/2Sverker Eriksson
2017-10-16erts: Cleanup binary_SUITE:termsSverker Eriksson
Remove try-catch which must be for some old bitstring limitation.
2017-10-13Eliminate use of deprecated functions in stringBjörn Gustavsson
2017-10-13Merge pull request #1599 from kostis/exception_SUITEBjörn Gustavsson
Explicitly disable HiPE's range analysis
2017-10-12Merge branch 'lukas/erts/use_SIGRTMIN_for_sys_suspend/OTP-14682'Lukas Larsson
* lukas/erts/use_SIGRTMIN_for_sys_suspend/OTP-14682: erts: Use SIGRTMIN on linux for sys_suspend
2017-10-12erts: Use SIGRTMIN on linux for sys_suspendLukas Larsson
The Linux real-time signal is better used on Linux for suspending schedulers during shutdown as it doesn't collide with SIGUSR2 usage of other applications.
2017-10-12Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/beam/beam_bp.c erts/emulator/beam/erl_process.c
2017-10-12Merge branch 'lukas/erts/tracing/recv_exit_signal_deadlock/OTP-14678' into maintLukas Larsson
* lukas/erts/tracing/recv_exit_signal_deadlock/OTP-14678: erts: Fix lock order when recv tracing trapped exit signal
2017-10-12Merge branch 'lukas/erts/fix_caller_trace_for_apply_bifs/OTP-14677' into maintLukas Larsson
* lukas/erts/fix_caller_trace_for_apply_bifs/OTP-14677: erts: Fix caller trace for apply bifs
2017-10-12erts: Fix lock order when recv tracing trapped exit signalLukas Larsson
2017-10-11Eliminate warnings for ignoring the result of an expressionBjörn Gustavsson
2017-10-10Explicitly disable HiPE's range analysisKostis Sagonas
when/if compiling this file to native code to check its exception behaiour. Related to the discussion in #1586.
2017-10-09Merge branch 'sverker/bad-dist-msg-bug/ERIERL-80/OTP-14661' into maint-20Erlang/OTP
* sverker/bad-dist-msg-bug/ERIERL-80/OTP-14661: erts: Fix bug when detecting bad dist message Add distribution_SUITE:bad_dist_ext_size
2017-10-09erts: Fix caller trace for apply bifsLukas Larsson
Bifs that are called through the export entry using i_call_last could have their cp set to return_trace, just like any other call. So we have to unwind the trace stack to get the correct cp. Not doing this creates a lot of issues for fprof.
2017-10-02Merge branch 'maint'Sverker Eriksson
2017-10-02Merge branch 'sverker/bad-dist-msg-bug/ERIERL-80/OTP-14661' into maintSverker Eriksson
2017-10-02Add distribution_SUITE:bad_dist_ext_sizeSverker Eriksson
2017-10-02Merge branch 'bjorn/erts/improve-beam-ops'Björn Gustavsson
* bjorn/erts/improve-beam-ops: Move out variables from the head of combined instructions Change operand from 'P' to 'Q' for i_apply_last and i_apply_fun_last Add CHECK_ALIGNED() for testing storage destinations instrs.tab: Add missing -no_next directives beam_load.c: Generalize the 'P' operator in the packing engine Break out most of the initialization from process_main() Eliminate the OpCode() macro Eliminate unnecessary and inconsistent casts Refactor macros for accessing Beam instructions beam_emu: Make order of macros consistent beam_SUITE: Strengthen test of packed registers
2017-10-02Merge pull request #1589 from bjorng/bjorn/erts/instruction-offsetsBjörn Gustavsson
Point out the correct line number in stack traces
2017-10-02Merge branch 'lukas/erts/poll-thread/OTP-14346'Lukas Larsson
* lukas/erts/poll-thread/OTP-14346: (25 commits) erts: Trigger ready events when erts_io_control fails erts: enif_select steal test kernel: Rewrite gen_udp_SUITE:read_packet tc erts: disable kernel-poll on OS X vsn < 16 erts: Fix msacc testcase with new poll-thread erts: Add testcases to test IOp and IOt options erts: get_internal_state(check_io_debug) now prints to error_logger erts: Remove eager check io erts: Move all I/O polling to a seperate thread erts: Fix smp_select testcase to use ERL_DRV_USE erts: Fix msacc unmanaged state counter erts: Optimize port_task quick allocator erts: Add ERTS_THR_PREF_QUICK_ALLOC_IMPL erts: Update suspend of scheduler to handle multiple pollsets erts: Add multiple poll sets erts: Some code cleanup for gdb to work better erts: temp_alloc can no longer be disabled erts: Refactor check_io to use one static struct erts: Replace check_io spinlock with lock-less list insertion erts: Add number of enif_select's to check_io_debug ...
2017-10-02erts: enif_select steal testDmytro Lytovchenko
2017-10-02erts: Fix msacc testcase with new poll-threadLukas Larsson
2017-10-02erts: Add testcases to test IOp and IOt optionsLukas Larsson
2017-10-02erts: Move all I/O polling to a seperate threadLukas Larsson
2017-10-02erts: Fix smp_select testcase to use ERL_DRV_USELukas Larsson
This is needed with the new poll-thread implementation as now closed fd's in the pollset will be triggered much faster than before.
2017-10-02erts: Add multiple poll setsSverker Eriksson
2017-10-01beam_SUITE: Strengthen test of packed registersBjörn Gustavsson
Test more instructions and use register numbers >= 512.
2017-09-30Point out the correct line number in stack tracesBjörn Gustavsson
Sometimes the line number in a stack trace could be wrong, for example for this code: t() -> Res = id(x), %<== Wrong line number. Res + 1. id(I) -> I. The line number pointed out in the stack trace would be the line before the line where the exception occurred. The reason is the way the increment instruction instruction is implemented: OpCase(i_increment_rWtd): { increment_reg_val = r(0); } I -= 1; goto increment__execute; OpCase(i_increment_xWtd): { increment_reg_val = xb(I[1]); } goto increment__execute; increment__execute: /* Common code for increment */ . . . (The implementation in OTP 20 is similar, but hand-coded directly in beam_emu.c instead of generated.) The instruction i_increment_rWtd decrements the instruction pointer (I) before jumping to the common code. That means that I points *before* the 'increment' instruction. If there is a 'line' instruction directly before the 'increment' instruction (as there is in this example), the instruction pointer will point before that line. Thus the previous line will be picked up instead. To eliminate this bug, we must never decrement the instruction pointer. Instead, we can increment the other (longer) instructions in the same group of combined instructions: OpCase(i_increment_rWtd): { increment_reg_val = r(0); } goto increment__execute; OpCase(i_increment_xWtd): { increment_reg_val = xb(I[1]); } I += 1; goto increment__execute; increment__execute: /* Common code for increment */ . . . Also fix a bug that was only a potential bug when ddaed7774eb0a introduced relative jumps, but is now a real bug. See the added comment for SET_I_REL() in macros.tab.
2017-09-27Merge branch 'kvakvs/zero-size-read_file/ERL-327/PR-1524/OTP-14637'Lukas Larsson
* kvakvs/zero-size-read_file/ERL-327/PR-1524/OTP-14637: erts: On zero-size files attempt to read until EOF