aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
AgeCommit message (Collapse)Author
2011-08-16emulator: Add a fourth element in exception stacktracesBjörn Gustavsson
This commit is a preparation for introducing location information (filename/line number) in stacktraces in exceptions. Currently a stack trace looks like: [{Mod1,Function1,Arity1}, . . . {ModN,FunctionN,ArityN}] Add a forth element to each tuple that can be used indication the filename and line number of the source file: [{Mod1,Function1,Arity1,Location1}, . . . {ModN,FunctionN,ArityN,LocationN}] In this commit, the fourth element will just be an empty list, and we will change all code that look at or manipulate stacktraces.
2011-08-16Fix binary matching in the debuggerBjörn Gustavsson
'eval_bits' is a common utility module used for evaluting binary construction and matching. The functions that do matching (match_bits/{6,7} and bin_gen/6) are supposed to treat the bindings as an abstract data type, but they assume that the bindings have the same representation as in the erl_eval module. That may cause binary matching to fail in the debugger, because the debugger represents the bindings as an unordered list of two-tuples, while the erl_eval modules uses an ordered list of two-tuple (an ordset). One way to fix the problem would be to let the debugger to use ordered lists to represent the bindings. Unfortunately, that would also change how the bindings are presented in the user interface. Currently, the variable have most been recently assigned is shown first, which is convenient. Fix the matching problem by mending the leaky abstraction in eval_bits. The matching functions needs to be passed two additional operations: one for looking up a variable in the bindings and one for adding a binding. Those operations could be passed as two more funs (in addition to the evaluation and match fun already passed), but the functions already have too many arguments. Therefore, change the meaning of the match fun, so that the first argument is the operation to perform ('match', 'binding', or 'add_binding') and second argument is a tuple with arguments for the operation.
2011-08-15erts: use a union to avoid strict aliasing issuesTuncer Ayaz
Use a union for pointer type conversion to avoid compiler warnings about strict-aliasing violations with gcc-4.1. gcc >= 4.2 does not emit the warning. TODO: Reconsider use of union once gcc-4.1 is obsolete?
2011-08-08Merge branch 'dev' into majorHenrik Nord
2011-08-08Merge branch 'pg/fix-hibernate-scheduling-with-hipe' into devHenrik Nord
* pg/fix-hibernate-scheduling-with-hipe: Fix bug related to hibernate and HiPE (clear F_HIBERNATE_SCHED flag) OTP-9452
2011-08-05Merge branch 'dev' into majorBjörn Gustavsson
* dev: Fix binary construction with huge literal sizes beam_load.c: Add overflow check of tag values beam_makeops: Add some sanity checks Fix construction of <<0:((1 bsl 32)-1)>>
2011-08-03Fix binary construction with huge literal sizesBjörn Gustavsson
Constructing binaries using the bit syntax with literals sizes that would not fit in an Uint will either cause an emulator crash or the loading to be aborted. Use the new TAG_o tag introduced in the previous commit to make sure that the attempt to create huge binary literals will generate a system_limit exception at run-time.
2011-08-03Fix construction of <<0:((1 bsl 32)-1)>>Björn Gustavsson
Attempting to construct <<0:((1 bsl 32)-1)>>, the largest bitstring allowed in a 32 bit emulator, would cause an emulator crash because of integer overflow. Fix the problem by using an Uint64 to avoid integer overflow. Do not attempt to handle construction of <<0:((1 bsl 64)-1>> in a 64-bit emulator, because that will certainly cause the emulator to terminate anyway because of insufficient memory.
2011-07-29Merge branch 'dev' into majorSverker Eriksson
2011-07-29Merge branch 'sverker/allocator-aoff/OTP-9424' into devSverker Eriksson
* sverker/allocator-aoff/OTP-9424: New allocator: Address order first fit (aoff)
2011-07-28Merge branch 'dev' into majorSverker Eriksson
2011-07-27Merge branch 'sverker/fun_SUITE-refc_dist-gcfix' into devSverker Eriksson
* sverker/fun_SUITE-refc_dist-gcfix: Fix test case fun_SUITE:refc_dist
2011-07-26Merge branch 'dev' into majorSverker Eriksson
2011-07-26Fix test case fun_SUITE:refc_distSverker Eriksson
It failed sometimes depending on GC invocation.
2011-07-22Test case for OTP-9422Sverker Eriksson
2011-07-18New allocator: Address order first fit (aoff)Sverker Eriksson
2011-07-13Correct merge conflict mistake in parentSverker Eriksson
2011-07-13Merge branch 'dev' into majorSverker Eriksson
Conflicts: erts/emulator/test/nif_SUITE.erl erts/emulator/test/nif_SUITE_data/nif_SUITE.c sverker/enif_make_int64-halfword/OTP-9394
2011-07-13Merge branch 'sverker/enif_make_int64-halfword/OTP-9394' into devSverker Eriksson
* sverker/enif_make_int64-halfword/OTP-9394: Fix halfword bug in enif_make_int64
2011-07-12Merge branch 'dev' into majorSverker Eriksson
2011-07-08Use separate memory carriers for small blocksRickard Green
2011-07-08Merge branch 'lukas/erts/enif_make_reverse_list/OTP-9392' into majorLukas Larsson
* lukas/erts/enif_make_reverse_list/OTP-9392: Add version comment Rename enif_get_reverse_list to enif_make_reverse_list Remove extra allocated heap fragment Added enif_get_reverse_list to nif API
2011-07-06Remove deprecated concat_binary/1Björn Gustavsson
concat_binary/1 was deprecated in R13B04, but already in the R10B-2 release, the documentation recommends using list_to_binary/1 instead.
2011-07-01Rename enif_get_reverse_list to enif_make_reverse_listLukas Larsson
2011-06-30Fix halfword bug in enif_make_int64Sverker Eriksson
The bug was creating an invalid bignum instead of a small integer, causing strange comparing behavior (=:= failed but == succeeded).
2011-06-30Added enif_get_reverse_list to nif APILukas Larsson
2011-06-08Add NIF function enif_is_numberFilipe David Manana
This function allows for easily determining if a term represents or not a number (integer, float, small or big).
2011-05-21Fix bug related to hibernate and HiPE (clear F_HIBERNATE_SCHED flag)Paul Guyot
F_HIBERNATE_SCHED flag that was introduced in b7ecdcd1ae9e11b8f75e must be cleared in hipe_mode_switch as well. Otherwise, processes running HiPE code that hibernate, wake up and then trap into a BIF will not be rescheduled.
2011-05-20Update copyright yearsBjörn-Egil Dahlberg
2011-05-20Merge branch 'rickard/driver_async_cancel/OTP-9302' into devRickard Green
* rickard/driver_async_cancel/OTP-9302: Fix testcase
2011-05-20Fix testcaseRickard Green
2011-05-19Merge branch 'rickard/driver_async_cancel/OTP-9302' into devRikard Green
* rickard/driver_async_cancel/OTP-9302: Fix driver_async_cancel()
2011-05-18Fix driver_async_cancel()Rickard Green
2011-05-13Merge branch 'sverker/hipe-misc-fixing/OTP-9298' into devBjörn-Egil Dahlberg
* sverker/hipe-misc-fixing/OTP-9298: hipe_mkliterals print argv[0] in generated files Fix code:is_module_native segv on deleted module lock checking fix in hipe_bif2.c
2011-05-13Merge branch 'bjorn/fix-binary-overflow/OTP-9118' into devBjörn Gustavsson
* bjorn/fix-binary-overflow/OTP-9118: Fix overflow in list_to_bitstring/1 Replace io_list_len() with erts_iolist_size() Make port_command/2 reject non-byte sized bitstrings io.c: Make io_list_vec_len() less general iolist_size/1: Fix truncation of result Test iolist_size/1 with bad arguments binary_SUITE: Remove workaround for avoiding stack overflow
2011-05-11Fix code:is_module_native segv on deleted moduleSverker Eriksson
2011-05-11Merge branch 'rickard/gc-other/OTP-9211' into devRickard Green
* rickard/gc-other/OTP-9211: Fix bad assertions Avoid scheduling of processes being garbage collected by others
2011-05-10Fix overflow in list_to_bitstring/1Björn Gustavsson
Noticed-by: Jon Meredith
2011-05-10Replace io_list_len() with erts_iolist_size()Björn Gustavsson
The io_list_len() function returns an int, where a negative return value indicates a type error. One problem is that an int only consists of 32 bits in a 64-bit emulator. Changing the return type to Sint will solve that problem, but in the 32-bit emulator, a large iolist and a iolist with a type error will both return a negative number. (Noticed by Jon Meredith.) Another problem is that for iolists whose total size exceed the word size, the result would be truncated, leading to a subsequent buffer overflow and emulator crash. Therefore, introduce the new erts_iolist_size() function which returns a status indication and writes the result size through a passed pointer. If the result size does not fit in a word, return an overflow indication.
2011-05-06Make port_command/2 reject non-byte sized bitstringsBjörn Gustavsson
Also rename the fun_to_port/1 test case to outputv_errors/1 and test sending more kinds of bad data to an outputv-enabled driver.
2011-05-04iolist_size/1: Fix truncation of resultBjörn Gustavsson
iolist_size/1 would silently return a truncated result for iolists whose size exceeded the word size. For example: iolist(lists:duplicate(256, <<0:(1 bsl 24)/unit:8>>)). would return 0 (instead of 4294967296 or 1 bsl 32). Rewrite iolist_size/1 to accumulate the size in a bignum if necessary and result the correct result.
2011-05-04Test iolist_size/1 with bad argumentsBjörn Gustavsson
2011-05-04binary_SUITE: Remove workaround for avoiding stack overflowBjörn Gustavsson
In older releases of Erlang/OTP, the '=:=' operator could run out of stack if used to compare very deep lists. Since that problem has been fixed, we can remove the workaround used in the deep/1 test case.
2011-04-27Merge branch 'sverker/code_SUITE-false_dependency-bug' into devSverker Eriksson
* sverker/code_SUITE-false_dependency-bug: Fix bug in test case code_SUITE:false_dependency
2011-04-27Merge branch 'sverker/enif_is_exception/OTP-9150' into devSverker Eriksson
* sverker/enif_is_exception/OTP-9150: add support for checking if an ERL_NIF_TERM is an exception
2011-04-14Merge branch 'maint-r14' into devSverker Eriksson
Conflicts: erts/vsn.mk
2011-04-11Avoid scheduling of processes being garbage collected by othersRickard Green
2011-04-07Add testcase for process_info() badarg bugRickard Green
2011-04-06Fix bug in test case code_SUITE:false_dependencySverker Eriksson
Causing out-of-memory on halfword emulator.
2011-04-04Fix unexported function in estone testcaseBjörn-Egil Dahlberg