| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| | |
Don't lose original failure reason,
instead amend "Leaked connections".
|
|/ |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
rickard/global-fixes/25.0/OTP-17934
* rickard/global-fixes/24.3.3/OTP-17934:
[kernel] Introduce connect_all kernel parameter
[kernel] global fixes
[kernel] Monitor nodeup/nodedown directly from global
[kernel] Fix global group configuration
[erts,kernel] Connection ID information
kernel: Fix test case monitor_nodess_down_up
Guarantee nodedown before nodeup messages
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
rickard/global-fixes/24.3.3/OTP-17934
* rickard/global-fixes/23.3.4/OTP-17934:
[kernel] Introduce connect_all kernel parameter
[kernel] global fixes
[kernel] Monitor nodeup/nodedown directly from global
[kernel] Fix global group configuration
[erts,kernel] Connection ID information
kernel: Fix test case monitor_nodess_down_up
Guarantee nodedown before nodeup messages
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When a record operation fails, a `{badrecord,Tag}` error exception
is raised, where `Tag` is the name of the record. For example, if
we have this function:
-record(foo, {a,b,c,d}).
bar(R) ->
R#foo.a.
we will get the following exception if we call `bar/1` with something
else than a #foo{} record:
1> t:bar({x,y,z}).
** exception error: {badrecord,foo}
in function t:bar/1 (t.erl, line 7)
When records were first introduced, there were no line numbers in
exceptions, so if a record operation failed in a large function
knowing the record name could be useful.
Nowadays, the line number usually makes it obvious which kind of
record the failed operation expected. It would be more useful to
know the actual value passed to the record operation.
This commit changes the exception for a failed record operation to
`{badrecord,ActualValue}`. For example:
1> t:bar({x,y,z}).
** exception error: {badrecord,{x,y,z}}
in function t:bar/1 (t.erl, line 7)
2> t:bar(lists:seq(1, 1000)).
** exception error: {badrecord,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,
20,21,22,23,24,25,26,27|...]}
in function t:bar/1 (t.erl, line 7)
Note that it is not documented what the exception for a failed record
operation is supposed to look like. Furthermore, it is unlikely that
there is exisiting code that catches expressions involving records
operations and tries to match the exact error reason. Therefore, we
don't consider this an incompatible change.
|
| | | |
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* maint:
Fix test case that started to fail because of bf115ee06a90a7d9a
|
| | | |
|
|\ \ \
| |/ / |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Before this fix the error reason would be "invalid port name",
which is true but not as helpfull as it could be. So now it returns
"must be spawn_executable".
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Cleanup emulator application, sweep duplicate code that
was adding code path to the test suite module, make peer
node naming uniform, protect from rogue nodes left when
test case fails.
|
|\ \ \
| | | |
| | | | |
Implement extended error information for binary construction
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Implement the bs_create_bin instruction for the JITs and the emulator.
Consider this example module:
-module(foo).
-export([bin/2, int/2, float/2, var_int/2]).
bin(A, B) -> <<A/binary, B/binary>>.
int(A, B) -> <<A/integer, B/integer>>.
float(A, B) -> <<A/float, B/float>>.
var_int(A, Size) -> <<A:Size>>.
With the extended error information introduced in this commit, failures to build
binaries will be reported like this:
1> c(foo).
{ok,foo}
2> foo:bin(2, <<>>).
** exception error: construction of binary failed
in function foo:bin/2 (foo.erl, line 4)
*** segment 1 of type 'binary': expected a binary but got: 2
3> foo:bin(<<>>, 42).
** exception error: construction of binary failed
in function foo:bin/2 (foo.erl, line 4)
*** segment 2 of type 'binary': expected a binary but got: 42
4> foo:bin(<<>>, <<1:1>>).
** exception error: construction of binary failed
in function foo:bin/2 (foo.erl, line 4)
*** segment 2 of type 'binary': the size of the value <<1:1>> is not a multiple of the unit for the segment
5> foo:int(a, 42).
** exception error: construction of binary failed
in function foo:int/2 (foo.erl, line 5)
*** segment 1 of type 'integer': expected an integer but got: a
6> foo:float(<<>>, <<>>).
** exception error: construction of binary failed
in function foo:float/2 (foo.erl, line 6)
*** segment 1 of type 'float': expected a float or an integer but got: <<>>
7> foo:var_int(42, -1).
** exception error: construction of binary failed
in function foo:var_int/2 (foo.erl, line 7)
*** segment 1 of type 'integer': expected a non-negative integer as size but got: -1
8> foo:var_int(42, a).
** exception error: construction of binary failed
in function foo:var_int/2 (foo.erl, line 7)
*** segment 1 of type 'integer': expected a non-negative integer as size but got: a
9> foo:var_int(42, 1 bsl 64).
** exception error: construction of binary failed
in function foo:var_int/2 (foo.erl, line 7)
*** segment 1 of type 'integer': the size 18446744073709551616 is too large
Closes #4971.
|
|\ \ \ \
| | |/ /
| |/| |
| | | |
| | | | |
* maint:
erts: Fix testcase in previous commit
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The test could not be loaded on 32-bit machines because the line
number wouldn't fit a signed word, so we'll lower it to a point
where it can be loaded.
We'll settle for this instead of fixing loading on 32-bit since
trying to load files with absurd line numbers is extremely
contrived.
|
|\ \ \ \
| |/ / /
| | / /
| |/ /
|/| | |
* maint:
erts: Fix crash on exceptions with huge line numbers
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Unrepresentable locations should be ignored, but I forgot to bring
that over when rewriting the loader in OTP 24.
To prevent something like this from happening again, ignore them in
the MAKE_LOCATION macro rather than around each use.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* maint:
Correct extended error for binary_to_term/2
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When `binary_to_term/2` failed with a `badarg` exception, the extended error
information would always blame the second argument even if the error was
in the first argument:
1> binary_to_term(<<"">>, []).
** exception error: bad argument
in function binary_to_term/2
called as binary_to_term(<<>>,[])
*** argument 2: invalid option in list
2> binary_to_term(<<131,100,0,10,97,95,110,101,119,95,97,116,111,109>>, [safe]).
** exception error: bad argument
in function binary_to_term/2
called as binary_to_term(<<131,100,0,10,97,95,110,101,119,95,97,116,111,109>>,
[safe])
*** argument 2: invalid option in list
Correct the extended error information like this:
1> binary_to_term(<<"">>, []).
** exception error: bad argument
in function binary_to_term/2
called as binary_to_term(<<>>,[])
*** argument 1: invalid external representation of a term
2> binary_to_term(<<131,100,0,10,97,95,110,101,119,95,97,116,111,109>>, [safe]).
** exception error: bad argument
in function binary_to_term/2
called as binary_to_term(<<131,100,0,10,97,95,110,101,119,95,97,116,111,109>>,
[safe])
*** argument 1: invalid or unsafe external representation of a term
Closes #5171.
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* maint:
Update preloaded
Test differing cookies with dynamic node names
Implement set_cookie/1 and get_cookie/1
Clarify documentation of cookie handling
Clean up handshake Cookie handling
Test command line -setcookie Node Cookie
Read other nodes' cookies from command line
Read other nodes' cookies from command line
Test differing cookies
|
| | |
| | |
| | |
| | | |
Clarify the documentation further regarding to these functions.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* maint:
Correct error messages for timer BIFs
|
| |\ \
| | | |
| | | | |
Correct error messages for timer BIFs
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The extended error information for timer BIFs would be incorrect if a
time value that exceeded the maximum allowed value was given:
1> erlang:send_after(1 bsl 50, self(), whatever).
** exception error: bad argument
in function erlang:send_after/3
called as erlang:send_after(1125899906842624,<0.83.0>,whatever)
2> erlang:send_after(1 bsl 50, self(), whatever, []).
** exception error: bad argument
in function erlang:send_after/4
called as erlang:send_after(1125899906842624,<0.85.0>,whatever,[])
*** argument 4: invalid option in list
For the call to `erlang:send_after/3`, no extended errors information would be
reported, while for the call to `erlang:send_after/4` there would be an incorrect
error message for the fourth argument.
This commit correct the messages, producing:
1> erlang:send_after(1 bsl 50, self(), whatever).
** exception error: bad argument
in function erlang:send_after/3
called as erlang:send_after(1125899906842624,<0.83.0>,whatever)
*** argument 1: exceeds the maximum supported time value
2> erlang:send_after(1 bsl 50, self(), whatever, []).
** exception error: bad argument
in function erlang:send_after/4
called as erlang:send_after(1125899906842624,<0.85.0>,whatever,[])
*** argument 1: exceeds the maximum supported time value
|
|\ \ \ \
| |/ / /
| | | |
| | | |
| | | |
| | | | |
* maint:
Correct error message for binary_to_existing_atom/2
Eliminate incorrect warning for useless building
|
| |\ \ \
| | |/ /
| |/| | |
Correct error message for binary_to_existing_atom/2
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The extended error information for `binary_to_existing_atom/2` was wrong
when the encoding was `utf8` or `unicode`:
1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8).
** exception error: bad argument
in function binary_to_existing_atom/2
called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8)
*** argument 1: invalid UTF8 encoding
Corrected:
1> binary_to_existing_atom(<<"oops doesnt_really_exist">>, utf8).
** exception error: bad argument
in function binary_to_existing_atom/2
called as binary_to_existing_atom(<<"oops doesnt_really_exist">>,utf8)
*** argument 1: not an already existing atom
Also fixed a similar problem for `list_to_existing_atom/1`.
Closes #4900.
|
|\ \ \ \
| |/ / / |
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
This has always been possible, we just document that it
should work this way if you want to raise an error using
the arity of the calling function.
|
|/ /
| |
| |
| |
| |
| |
| | |
The JIT for ARM will give a more detailed stacktrace for operators
such as '+'/2 (the top stacktrace entry will be for the operator
including its arguments). Update test cases that test for exceptions
to allow for this variation.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For BIFs that only accept a local pid, the extended error information would
state that the argument was not a pid. For example:
(arne@seldon)1> RemotePid = rpc:call(kalle@seldon, erlang, whereis, [code_server]).
<9325.50.0>
(arne@seldon)2> process_info(RemotePid).
** exception error: bad argument
in function process_info/1
called as process_info(<9325.50.0>)
*** argument 1: not a pid
Correct the extended error information for those BIFs to report the argument as
"not a local pid". For example:
(arne@seldon)1> RemotePid = rpc:call(kalle@seldon, erlang, whereis, [code_server]).
<9325.50.0>
(arne@seldon)2> process_info(RemotePid).
** exception error: bad argument
in function process_info/1
called as process_info(<9325.50.0>)
*** argument 1: not a local pid
Similarly, the extended error information for BIFs that operate on ports (such as
`port_control/3`) would state that a remote port was not a port.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit is the reference implementation for EEP-54, which proposes a mechanism
for providing more informational messages than simply "bad argument" when a call
to a BIF fails. Here is an example:
1> element(a, b).
** exception error: bad argument
in function element/2
called as element(a,b)
*** argument 1: not an integer
*** argument 2: not a tuple
All the details are found in EEP-54, but here are the main points:
* An extension of the format of the call-stack back trace (**stacktrace**) format
to indicate that there exists extended error information for that call, and
a convention for how extended error information can be provided.
* A new `erlang:error/3` BIF to allow libraries and applications to
raise an exception with extended error information.
* New functions `erl_error:format_exception/3` and
`erl_error:format_exception/4` to allow libraries and application to
format stacktraces in the same style as the shell.
This implementation of EEP-54 implements extended error information for all
C-implemented BIFs in the `erlang` and `ets` modules.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Co-authored-by: Lukas Larsson <lukas@erlang.org>
Co-authored-by: John Högberg <john@erlang.org>
Co-authored-by: Dan Gudmundsson <dgud@erlang.org>
|
|\ \
| |/
| |
| |
| |
| |
| | |
* maint:
Fix filelib:wildcard/1,2 for "not-a-directory/.."
Eliminate compiler crash for repeated is_map_key/2 calls
Fix line number for failing map update
|
| |
| |
| |
| |
| |
| |
| | |
If the update of a map using the syntax `Map#{Key := Value}` failed,
the line number in the stack backtrace could be wrong.
https://bugs.erlang.org/browse/ERL-1271
|
|/
|
|
| |
`erlang:get_stacktrace/0` was deprecated in OTP 20.
|
|\
| |
| |
| |
| | |
* maint:
Update copyright year
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `erlang:get_stacktrace/0` BIF retrieves the stacktrace from
the previous error in the process. The problem is that the very
existence of `erlang:get_stacktrace/0` means that the stacktrace
and potentially function arguments must be kept indefinitely.
Therefore, in OTP 21, the `erlang:get_stacktrace/0` BIF was deprecated
and the syntax of try/catch extended to allow matching out the
stacktrace directly.
This commit changes `erlang:get_stacktrace/0` for OTP 23 to always
return an empty list (`[]`) and eliminates the need to keep the
stacktrace forever.
`erlang:get_stacktrace/0` is scheduled for removal in OTP 24.
|
|\
| |
| |
| |
| | |
* bjorn/erts/fix-wrong-class/ERIERL-367/OTP-15834:
Fix sticky class in exception
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When catching an exception re-throwing with a changed
class, the class could be changed to the original class
if the exception got caught and rethrown in (for example)
an after block:
sticky_class() ->
try
try
throw(reason)
catch
throw:Reason:Stack ->
erlang:raise(error, Reason, Stack)
end
after
ok
end.
|
|/
|
|
|
| |
This commit lets the type optimization pass work across functions,
tracking return and argument types to eliminate redundant tests.
|