aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
AgeCommit message (Collapse)Author
2017-11-15erts: Put pending DistrEntry in separate listSverker Eriksson
2017-11-15Refactor auto_connect into an outline functionSverker Eriksson
and abort_pending_connection into own utility function.
2017-11-15Remove unused ERTS_DSP_RWLOCKSverker Eriksson
2017-11-15erts: Keep magic ref to DistEntry in net_kernelSverker Eriksson
to make sure it's kept alive.
2017-11-15Allow DistEntries in ETSSverker Eriksson
2017-11-15Remove faulty assertSverker Eriksson
Send may have failed, port exit with dist_entry cleaned up and then new pending connection with queued messages.
2017-11-15erts: Transcode tuple fallbacksSverker Eriksson
When finalizing outgoing distribution messages we transcode them into using tuple fallbacks if the receiver does not support bitstrings and export-funs. This can only happen if the message was first encoded toward a pending connection when the receiver was unknown. It's an optimistic approach optmimized for modern beam nodes, that expect real bitstrings and funs (since <R13). Only erl_interface/jinterface lack this support.
2017-11-15erts: Ensure enc_term_int() always do progressSverker Eriksson
even when reds <= 1 Removed micro optimization for first fun variable to make things simpler.
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: Fix auto-connect toward erl_interface/jinterfaceSverker Eriksson
2017-11-15erts: Let send(_,_,[noconnect]) enqueue msg on pending connection.Sverker Eriksson
The least bad behavior I think: * We cannot return 'noconnect' as caller might already have enqueued monitor/link that never triggers. * We cannot block waiting for connection as that can ruin latency when 'noconnect' is used to avoid blocking auto-connect (see gen_server and gen_statem). But there might be users getting more cases of bad latency waiting for a pendig connection, instead of a fast 'noconnect'.
2017-11-15Remove obsolete erlang:dgroup_leaderSverker Eriksson
2017-11-15Remove obsolete erlang:dexit/2Sverker Eriksson
2017-11-15Remove obsolete erlang:dlink/1, dunlink/1 and dist_exit/3Sverker Eriksson
2017-11-15Remove obsolete erlang:dsendSverker Eriksson
2017-11-15erts: Async auto-connect for monitor/2Sverker Eriksson
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: Introduce asynchronous auto-connectSverker Eriksson
2017-11-15erts: Refactor connection_id in ErtsDistExternalSverker Eriksson
Break out from 'flags' into new dedicated 'connection_id' just for simplicity. Also changed flags to low bits and that affected enif_binary_to_term.
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: Change to #ifndef from #if !definedSverker Eriksson
2017-11-15erts: Remove some dead codeSverker Eriksson
2017-11-15erts: Remove obsolete code for latin1 in atom cacheSverker Eriksson
Distribution flag DFLAG_UTF8_ATOMS is supported since R16 and mandatory since 20.0.
2017-11-15erts TEST: Add missing ref to DistEntry from send contextSverker Eriksson
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 PR-1621 from margnus1/hipe-literal-tagSverker Eriksson
HiPE: Support for literal tag, tests and bugfixes
2017-11-13Merge pull request #1624 from bjorng/bjorn/add-beam-internal-docBjörn Gustavsson
Add internal documentation for the beam_makeops script OTP-14626
2017-11-13Refuse to load "literals" that can be confused with registersBjörn Gustavsson
The 's' operand overloads the tags for pids and ports to represent X and Y registers, respectively. At load time, refuse to load the module if the "literal" term is not a pid or port, as it would be interpreted as a register. This does not happen with normally compiled code, but it can happen if the compiler (or beam_asm) is abused like in the following example: make_bad() -> Pid = self(), Forms = [{attribute, 0, module, bad_s_operand}, {attribute, 0, export, [{test, 0}]}, {function, 0, test, 0, [{clause, 0, [], [], [{call,0,{atom,0,tuple_size},[{integer, 0, Pid}]}]}]}], {ok, Module, Bin} = compile:forms(Forms, [no_copt,no_postopt,report_errors]), code:load_binary(Module, "bad_s_operand.erl", Bin). With this commit applied, the following message will be printed when make_bad() is run: =ERROR REPORT==== 10-Nov-2017::14:47:59 === Loading of bad_s_operand.erl failed: badfile =ERROR REPORT==== 10-Nov-2017::14:47:59 === beam/beam_load.c(2396): Error loading function bad_s_operand:test/0: op bif1_body: bsd: the term '<0.60.0>' would be confused with a register
2017-11-10Merge branch 'maint'Ingela Anderton Andin
* maint: Updated OTP version Update release notes Update version numbers inets: Prepare for release inets: Add missing guard Avoid WindowBits=8 as per the manual Fix deflateParams on zlib 1.2.11 Ignore empty binaries in enif_inspect_iovec Emasculate writable binaries on entering an iovec Only apply EOS behaviors if there's pending data Conflicts: OTP_VERSION
2017-11-10Merge branch 'maint-20' into maintIngela Anderton Andin
* maint-20: Updated OTP version Update release notes Update version numbers inets: Prepare for release inets: Add missing guard Avoid WindowBits=8 as per the manual Fix deflateParams on zlib 1.2.11 Ignore empty binaries in enif_inspect_iovec Emasculate writable binaries on entering an iovec Only apply EOS behaviors if there's pending data Stop assuming that all schedulers are managed when updating msacc
2017-11-09Merge branch 'john/erts/msacc-dirty-schedulers/OTP-14707' into maint-20Erlang/OTP
* john/erts/msacc-dirty-schedulers/OTP-14707: Stop assuming that all schedulers are managed when updating msacc
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-07Ignore empty binaries in enif_inspect_iovecJohn Högberg
2017-11-07Emasculate writable binaries on entering an iovecJohn Högberg
The lack of this caused serious data corruption when a binary was altered after entering the queue. This went unnoticed because it was never used without erlang:iolist_to_iovec, which always emasculates binaries.
2017-11-07Strengthen tests of definition of specific instructionsBjörn Gustavsson
Don't allow defining an specific operation more than once with the exact same operands. Don't allow a specific operation to be defined with different arities.
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-11-06Warn when $REFRESH_GEN_DEST() is not used after a GCBjörn Gustavsson
It is easy to to forget to use $REFRESH_GEN_DEST() in an instruction that has a general destionation ('d'). Add a heuristic that should catch most if not all such problems.
2017-11-06Consistently use the "erts_gc_" prefix for functions that do GCBjörn Gustavsson
In beam_emu, use "erts_gc_" for any function that does garbage collection, as preparation for adding more sanity checks.
2017-11-05HiPE: Support literal tagsMagnus Lång
Literal tags are used by the VM as an alternative to reserving a large virtual memory space in order to be able to quickly identify which terms are literals. The use of literal tags harms performance, but is useful to support systems where allocating a large amount of virtual memory is not an option.
2017-11-03erts: Fix lock checking in do_call_traceSverker Eriksson
which was lost in merge 3ec66701f91eba6a7a12a813b2283c2e733f62c1
2017-11-02Merge branch 'john/erts/msacc-dirty-schedulers/OTP-14707'John Högberg
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-30erts: Fix a bunch of compiler warningsLukas Larsson
2017-10-30Merge pull request #1610 from bjorng/bjorn/erts/is_builtin/ERL-500/OTP-14713Björn Gustavsson
Correct erlang:is_builtin/3 for apply/2 and yield/0
2017-10-30Merge branch 'maint'Björn Gustavsson
* maint: erl_process_dump: Don't assume that literals can be found Remove one superfluous closing parenthesis in oam_intro.xml
2017-10-30erl_process_dump: Don't assume that literals can be foundBjörn Gustavsson
Native code does not register its literals in the code header for the loaded code. Therefore, a literal created by native code can not be found by mark_literal(). Ignore literals that can't be found instead of crashing (the crasdump_viewer will report such literals as incomplete heap data, but will not crash).
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