aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-08-31Enumerate AVPs in diameter_avp.index (again)Anders Svensson
Commit 96cd627a changed the way the index field was used, but the enumeration is used in at least one known application (as a pointer from elements of diameter_packet.errors to elements of diameter_packet.avps) and the motivation for the change is questionable: the lookup that was avoided was unnecessary given that it was already performed in incrementing a counter. Revert to enumerating as before in the non-relay case, but not in the relay case since there's no corresponding usecase.
2017-08-31Eliminate unnecessary 'move' instructionsBjörn Gustavsson
The compiler could sometimes emit unnecessary 'move' instructions in the code for binary matching, for example for this function: escape(<<Byte, Rest/bits>>, Pos) when Byte >= 127 -> escape(Rest, Pos + 1); escape(<<Byte, Rest/bits>>, Pos) -> escape(Rest, Pos + Byte); escape(<<_Rest/bits>>, Pos) -> Pos. The generated code would look like this: {function, escape, 2, 2}. {label,1}. {line,[{location,"t.erl",17}]}. {func_info,{atom,t},{atom,escape},2}. {label,2}. {test,bs_start_match2,{f,1},2,[{x,0},0],{x,0}}. {test,bs_get_integer2, {f,4}, 2, [{x,0}, {integer,8}, 1, {field_flags,[{anno,[17,{file,"t.erl"}]},unsigned,big]}], {x,2}}. {'%',{bin_opt,[17,{file,"t.erl"}]}}. {move,{x,0},{x,3}}. %% UNECESSARY! {test,is_ge,{f,3},[{x,2},{integer,127}]}. {line,[{location,"t.erl",18}]}. {gc_bif,'+',{f,0},4,[{x,1},{integer,1}],{x,1}}. {move,{x,3},{x,0}}. %% UNECESSARY! {call_only,2,{f,2}}. {label,3}. {line,[{location,"t.erl",20}]}. {gc_bif,'+',{f,0},4,[{x,1},{x,2}],{x,1}}. {move,{x,3},{x,0}}. %% UNECESSARY! {call_only,2,{f,2}}. {label,4}. {move,{x,1},{x,0}}. return. The redundant 'move' instructions have been marked. To avoid the 'move' instructions, we can extend the existing function is_context_unused/1 in v3_codegen. If v3_codegen can know that the match context will not be used again, it can reuse the register for the match context and avoid the extra 'move' instructions. https://bugs.erlang.org/browse/ERL-444
2017-08-31Merge branch 'maint'Björn Gustavsson
* maint: Make handling of match contexts stricter
2017-08-31Merge pull request #1553 from bjorng/bjorn/compiler/fix-beam_validatorBjörn Gustavsson
Make handling of match contexts stricter OTP-14591
2017-08-31Merge branch 'maint'Lukas Larsson
2017-08-31Merge branch 'lukas/erts/port_SUITE_dropped_commands_fix' into maintLukas Larsson
* lukas/erts/port_SUITE_dropped_commands_fix: erts: Fix port_SUITE:dropped_commands tc
2017-08-31Merge branch 'dszoboszlay/run-dropped_commands-test' into maintLukas Larsson
* dszoboszlay/run-dropped_commands-test: Execute the dropped_commands test case in port_SUITE
2017-08-30Merge tag 'OTP-20.0' into sverker/20/binary_to_atom-utf8-crash/ERL-474/OTP-14590Sverker Eriksson
2017-08-30Merge tag 'OTP-19.0' into sverker/19/binary_to_atom-utf8-crash/ERL-474/OTP-14590Sverker Eriksson
2017-08-30erts: Fix crash in binary_to_atom/term for invalid utf8Sverker Eriksson
such as a sub-binary, of a correct utf8 string, that ends in the middle of a character.
2017-08-30Merge branch 'maint'Dan Gudmundsson
* maint: Always reply to sync requests
2017-08-30Merge branch 'dgud/kernel/fix-hanging-io/OTP-14571' into maintDan Gudmundsson
* dgud/kernel/fix-hanging-io/OTP-14571: Always reply to sync requests
2017-08-30Merge pull request #1530 from michalmuskala/beam-peep-optBjörn Gustavsson
Enhance optimisations in beam_peep
2017-08-30Merge pull request #1548 from bjorng/bjorn/erts/remove-float-constant-bcBjörn Gustavsson
Remove backward compatibility support for float literals OTP-14575
2017-08-30Make handling of match contexts stricterBjörn Gustavsson
beam_validator could fail issue a diagnostic when a register that was supposed to be a match context was not guaranteed to be a match context. The bug was in merging of types. Merging of a match context with another term would result in a match context. That is wrong. Merging should produce a more general type, not a narrower type. Also, the valid slots in two match contexts should be combined with 'band', not 'bor'.
2017-08-29Send unordered on all outbound diameter_sctp streamsAnders Svensson
There's no reason for sending ordered since request handling is concurrent: different processes handling incoming requests can't know in which order they were received on the transport, and different processes sending requests can't know the order in which they're sent.
2017-08-29Delay rotation of diameter_sctp outbound streamsAnders Svensson
For the same reason as unordered delivery is delayed in the grandparent commit. Delivery is ordered only within a stream, so until a second message is received from the peer, there's no guarantee that a second outgoing request won't be received before the initial capablities exchange message. Rotation begins upon reception of a second message from the peer, messages being sent on stream 0 until then.
2017-08-29Upgrade to PCRE 8.41 from PCRE 8.40Rickard Green
2017-08-29Merge branch 'maint'Anders Svensson
2017-08-29Merge branch 'anders/diameter/config_consistency/OTP-14555' into maintAnders Svensson
* anders/diameter/config_consistency/OTP-14555: Let strict_mbit and incoming_maxlen be configured per transport Let a service configure default transport options Rename type evaluable -> eval
2017-08-29Merge branch 'anders/diameter/upgrade/OTP-14552' into maintAnders Svensson
* anders/diameter/upgrade/OTP-14552: Fix compatibility of remote send
2017-08-29Merge branch 'anders/diameter/strict_capx/OTP-14546' into maintAnders Svensson
* anders/diameter/strict_capx/OTP-14546: Document transport_opt() strict_capx Rename transport_opt() capx_strictness to strict_capx
2017-08-29Merge branch 'anders/diameter/performance/OTP-14521' into maintAnders Svensson
* anders/diameter/performance/OTP-14521: Fix influence of decode_format on service events Work around more common_test woe
2017-08-29Merge branch 'anders/diameter/loopback_any/OTP-14544' into maintAnders Svensson
* anders/diameter/loopback_any/OTP-14544: Use loopback/any config in examples suite Handle loopback/any as local address in diameter_tcp/sctp
2017-08-29Merge branch 'anders/diameter/codec/OTP-14511' into maintAnders Svensson
* anders/diameter/codec/OTP-14511: Use map decoding in example client
2017-08-29Merge branch 'anders/diameter/caseless/OTP-14535' into maintAnders Svensson
* anders/diameter/caseless/OTP-14535: Replace calls to inet_parse(3) Fix regexp match of accept tuple in diameter_tcp/sctp
2017-08-29Exercise unordered delivery in traffic suiteAnders Svensson
By randomly setting the number of outbound streams on associations.
2017-08-29Use unordered delivery on a lone outbound stream in diameter_sctpAnders Svensson
RFC 6733 say the below about head-of-line blocking and SCTP, the suggestion of unordered sending being new compared to the RFC 3588. Until now, all delivery in diameter_sctp has been ordered, and roundrobin over available streams unless the user passes a stream identifier in an outgoing diameter_packet record. This commit changes this to use unordered delivery when there's only a single outbound stream to choose from. The special case at capabilities exchange is handled by only starting to send unordered after the second message from the peer has been received. (First message after capabilities exchange, as the RFC probably means.) The special case at DPR isn't handled, since there's no knowing the order in which a peer will answer: a node that sends DPR while it has other requests outstanding can't expect that the latter will be answered before DPR, even if delivery is ordered since incoming requests are handled concurrently. If it wants a guarantee then it simply has to wait for answers before sending DPR. A user can force all delivery to be unordered by specifying {sctp_default_send_params, #sctp_sndrcvinfo{flags = [unordered]}} as a config option to diameter_sctp, but in this case there's no handling of a request being sent directly after CEA since there's no ordered flag to override the default. RFC 6733: 2.1.1. SCTP Guidelines Diameter messages SHOULD be mapped into SCTP streams in a way that avoids head-of-the-line (HOL) blocking. Among different ways of performing the mapping that fulfill this requirement it is RECOMMENDED that a Diameter node send every Diameter message (request or response) over stream zero with the unordered flag set. However, Diameter nodes MAY select and implement other design alternatives for avoiding HOL blocking such as using multiple streams with the unordered flag cleared (as originally instructed in RFC 3588). On the receiving side, a Diameter entity MUST be ready to receive Diameter messages over any stream, and it is free to return responses over a different stream. This way, both sides manage the available streams in the sending direction, independently of the streams chosen by the other side to send a particular Diameter message. These messages can be out-of-order and belong to different Diameter sessions. Out-of-order delivery has special concerns during a connection establishment and termination. When a connection is established, the responder side sends a CEA message and moves to R-Open state as specified in Section 5.6. If an application message is sent shortly after the CEA and delivered out-of-order, the initiator side, still in Wait-I-CEA state, will discard the application message and close the connection. In order to avoid this race condition, the receiver side SHOULD NOT use out-of-order delivery methods until the first message has been received from the initiator, proving that it has moved to I-Open state. To trigger such a message, the receiver side could send a DWR immediately after sending a CEA. Upon reception of the corresponding DWA, the receiver side should start using out-of- order delivery methods to counter the HOL blocking. Another race condition may occur when DPR and DPA messages are used. Both DPR and DPA are small in size; thus, they may be delivered to the peer faster than application messages when an out-of-order delivery mechanism is used. Therefore, it is possible that a DPR/DPA exchange completes while application messages are still in transit, resulting in a loss of these messages. An implementation could mitigate this race condition, for example, using timers, and wait for a short period of time for pending application level messages to arrive before proceeding to disconnect the transport connection. Eventually, lost messages are handled by the retransmission mechanism described in Section 5.5.4.
2017-08-29erts: Fix port_SUITE:dropped_commands tcLukas Larsson
We start the port in the started process in order to get the messages in the correct place and also so that unloading the port driver does not kill the test process.
2017-08-29Merge pull request #1525 from bitnitdit/remove-query-keyword-residuesHans Bolinder
Remove query keyword residues
2017-08-29De-duplicate bignums in the literal poolBjörn Gustavsson
Duplicate literals in the literal pool is a waste of memory. Also, having unique literals can simplify some loader optimizations, because we can known that if two literal indices are distinct, the values must be distcint too.
2017-08-28Always reply to sync requestsDan Gudmundsson
Otherwise processes doing io could get stuck. See ERL-472.
2017-08-28Fix influence of decode_format on service eventsAnders Svensson
Decoded CER/CEA messages are passed in events messages that can be subscribed to using diameter:subscribe/1. A configured decode_format was not reflected in these, messages always being passed as records. Clarify that strict_arities only applies to message callbacks.
2017-08-28Merge branch 'rickard/dist/OTP-14459' into rickard/dist/master/OTP-14459Rickard Green
Conflicts: erts/emulator/beam/bif.c erts/emulator/beam/dist.c erts/emulator/beam/dist.h erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_node_tables.c erts/emulator/beam/erl_node_tables.h erts/emulator/beam/external.c
2017-08-28Introduce sender in distributed signals and dflag configurationRickard Green
2017-08-28Optimize dist entry managementRickard Green
2017-08-28Support for running test suites with gen_tcp_distRickard Green
2017-08-28Example of using distribution controller processesRickard Green
2017-08-28Support for distribution controller processesRickard Green
2017-08-28Remove backward compatibility support for float literalsBjörn Gustavsson
Starting from R16B, floating point constants are stored in the literal pool. The backward compatibility support for the old representation of floats has been kept long enough. Also, we might want to ensure that all literals are unique in the future, and we certainly don't want to update this code to ensure uniqueness.
2017-08-28Merge branch 'maint'Björn Gustavsson
* maint: Remove time-consuming ethread_SUITE from smoke tests
2017-08-28Merge pull request #1547 from bjorng/bjorn/fix-smoke-testBjörn Gustavsson
Remove time-consuming ethread_SUITE from smoke tests
2017-08-28Remove time-consuming ethread_SUITE from smoke testsBjörn Gustavsson
The ethread_SUITE is unlikely to ever find a real bug introduced in a pull request, but it frequently times out when run by Travis CI.
2017-08-26Enhance optimisations in beam_peepMichał Muskała
When cleaning selects, it might happen we're left with only one pair. In such case convert to a regular test + jump.
2017-08-25Changes confusing example of a bad guard in ets:fun2msSasan Hezarkhani
2017-08-25Switch query back to be normal atombitnitdit
query was no longer a keyword since the commit 0dc3a29744bed0b7f483ad72e19773dc0982ea50 2012-11-19. So the quotes around query, when it used as atom, no needed.
2017-08-25Merge branch 'maint'Henrik Nord
2017-08-25Merge branch 'maint-20' into maintHenrik Nord
* maint-20: Updated OTP version Prepare release dialyzer: Fix a bug where merging PLT:s could lose info
2017-08-25Let strict_mbit and incoming_maxlen be configured per transportAnders Svensson
Since these can make sense per peer. The remaining service-only options either belong there or make little sense being configured per transport.
2017-08-25Let a service configure default transport optionsAnders Svensson
Only a default spawn_opt has been possible to configure, but there's no reason why most others should need to be configured per transport. Those options that still only make sense on a transport are transport_module/config (because of the semantics of multiple values), applications/capabilities (since these override service options), and private (since it's only to allow user-specific options in a backwards compatible way).