| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]).
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: bad argument
in function foo:bin/2 (foo.erl, line 4)
*** failed constructing binary: segment 1, type 'binary': not a binary
3> foo:bin(<<>>, 42).
** exception error: bad argument
in function foo:bin/2 (foo.erl, line 4)
*** failed constructing binary: segment 2, type 'binary': not a binary
4> foo:bin(<<>>, <<1:1>>).
** exception error: bad argument
in function foo:bin/2 (foo.erl, line 4)
*** failed constructing binary: segment 2, type 'binary': the size of the given binary/bitstring is not a multiple of the unit for the segment
5> foo:int(a, 42).
** exception error: bad argument
in function foo:int/2 (foo.erl, line 5)
*** failed constructing binary: segment 1, type 'integer': not an integer
6> foo:float(<<>>, <<>>).
** exception error: bad argument
in function foo:float/2 (foo.erl, line 6)
*** failed constructing binary: segment 1, type 'float': not a float or an integer
7> foo:var_int(42, -1).
** exception error: bad argument
in function foo:var_int/2 (foo.erl, line 6)
*** failed constructing binary: segment 1, type 'integer': the size is negative
8> foo:var_int(42, a).
** exception error: bad argument
in function foo:var_int/2 (foo.erl, line 6)
*** failed constructing binary: segment 1, type 'integer': the size is not an integer
9> foo:var_int(42, 1 bsl 64).
** exception error: a system limit has been reached
in function foo:var_int/2 (foo.erl, line 6)
*** failed constructing binary: segment 1, type 'integer': the size is too large
Closes #4971.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Binary construction using the binary syntax currently uses multiple
instructions. That makes it hard to provide good information in the
exception if construction fails. It also makes it harder to optimize
construction in the JIT.
Therefore, introduce the instruction `bs_create_bin` that constructs
a binary in one go.
To be able to test the new instruction before implementing it in the
runtime system, force translation back to the old-style instructions
in the `beam_clean` pass.
|
|
|
|
|
|
| |
Eliminate uncessary gotos. Always test the virtual binary heap when
deciding whether a GC is needed (it is currently only done for
binaries whose size are given in bytes).
|
|
|
|
|
| |
Generate a shorter instruction for unsigned immediate values that
fit in 32 bits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Keep warnings for binary construction that will fail, but don't
replace the construction with an `error(badarg)` call to allow the
runtime system to add extended information to the exception.
For example, `sys_core_fold` will no longer replace the following
code:
<<F:7/float>>
with a call to `error(badarg)`.
However, note that v3_core still replaces obviously bad types and
sizes with a call to `error(badarg)`. For example, `v3_core` will
replace the following construction with a call to `error(badarg)`:
<<atom:32>>
|
|
|
|
|
| |
OTP 25 will refuse to load ancient BEAM files (OTP R11B or earlier)
that would need this type test.
|
|\
| |
| | |
Fix race related to precompiled header during compilation
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Files matching `erts/emulator/beam/jit/$(JIT_ARCH)/%.cpp` are compiled
with the command line flag `-include $(ASMJIT_PCH_SRC)`, but as there
is no dependency on `$(ASMJIT_PCH_OBJ)` the compilation of the C++
module will race with the precompilation of `$(ASMJIT_PCH_SRC)`. The
missing dependency leads to intermittent build failures as g++ will,
when reading an incomplete precompiled header, abort with `cc1plus:
error: while reading precompiled header: No such file or directory`.
Avoid this race by adding a dependency on `$(ASMJIT_PCH_OBJ)` just as
for files matching `erts/emulator/beam/jit/%.cpp` and
`erts/emulator/asmjit/%.cpp`.
|
|\ \ |
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fix issues where incorrect arguments might result in a function_clause
exception and potential information leakage in a stack trace.
* Add tests with incorrectly typed arguments and verify that an
informative error is returned rather than an exception.
* Add error detection of arguments to connect/2,3,4.
* Add better abstraction and collection of errors.
|
|\ \ \ \
| |/ / / |
|
| |\ \ \
| | |/ /
| |/| | |
|
| | | |
| | | |
| | | |
| | | | |
when a file ends with an ErrorReport.
|
|\ \ \ \
| |/ / / |
|
| |\ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
lisztspace/cons/httpc-accept-binary-headers/GH-5074/OTP-17579
Cons/httpc accept binary headers/gh 5074/otp 17579
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Fix a bug where using a binary() in a header value to request/5 would
cause the application to hang. Now allow a binary() as a header
value. Extend error checking of arguments to request/5 and be more
precise with returned errors when arguments have an invalid type.
* Add tests
* Catch test problem earlier
* Add new tests for header types and other arguments to request/5
* Be more precise when checking the error returned
* Code
* Abstract construction of header-value string for consistency
* Make checking of headers values and arguments consistent and
more precise.
* Update documentation
* Correct types in documentation
* Use http_string() instead of string() to avoid possible confusion
due to using a well defined system wide type.
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | | |
* maint:
ssh: Exclude LibreSSL 2.1.* from Engine tests
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* hans/crypto/cuddle_tests:
ssh: Exclude LibreSSL 2.1.* from Engine tests
|
| |/ / / /
| | | | |
| | | | |
| | | | | |
It does not work well for some of the tests
|
|\ \ \ \ \
| |/ / / /
| | | | |
| | | | |
| | | | | |
* maint:
crypto: Silence CodeChecker
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* hans/crypto/error_refactor/OTP-17241:
crypto: Silence CodeChecker
|
| | | | | | |
|
|\ \ \ \ \ \
| |/ / / / /
| | | | | |
| | | | | |
| | | | | | |
* maint:
Improve argument testing in the bs_add instruction
|
| |\ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
* bjorn/erts/fortify-bs_add/OTP-17686:
Improve argument testing in the bs_add instruction
|
| | | |/ / /
| | |/| | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Immediate non-integer values (such as atoms) would not be rejected
by bs_add (in the x86 JIT). Therefore, a binary would be allocated,
before failing the operation when attempting to fill in the contents
of the binary.
|
|\ \ \ \ \ \
| |/ / / / / |
|
| |\ \ \ \ \ |
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| |/ / / / / / |
|
| |\ \ \ \ \ \ |
|
| | |/ / / / / |
|
|\ \ \ \ \ \ \
| |/ / / / / / |
|