aboutsummaryrefslogtreecommitdiffstats
path: root/erts
AgeCommit message (Collapse)Author
2011-08-26Merge branch 'dev' into majorBjörn Gustavsson
* dev: code: Optimize purge/1 and soft_purge/1 using check_old_code/1 Add erlang:check_old_code/1 check_process_code/2: Quickly return 'false' if there is no old code
2011-08-25Merge branch 'bjorn/line-numbers-in-exceptions/OTP-9468' into majorBjörn Gustavsson
* bjorn/line-numbers-in-exceptions/OTP-9468: (51 commits) debugger: By default, only save non-tail-recursive calls debugger: Add line_number_SUITE debugger: Include line numbers in exceptions Update examples in the documentation to include line numbers Update documentation for erlang:raise/3 and erlang:get_stacktrace/0 beam_lib: Retain the "Line" chunk when stripping BEAM files erl: Add +L to suppress loading of line number information compiler: Add no_line_info for suppressing line/1 instructions exception_SUITE: Test line numbers in exceptions common_test: Use line numbers in exceptions common_test tests: Don't do detailed testing of the stack backtrace test_server: Refactor init_per_testcase/3 into two functions Implement process_info(Pid, current_{location,stacktrace}) beam_emu: Factor out saving of stack trace from save_stacktrace() compiler: Don't create filenames starting with "./" ops.tab: Remove line instructions before tail-recursive calls Lookup and include filenames and line numbers in exceptions Fix decrement of continuation pointers Refactor building of the exception stacktrace BEAM loader: Load the line table ...
2011-08-25Merge branch 'dev' into majorHenrik Nord
2011-08-25Add erlang:check_old_code/1Björn Gustavsson
Add erlang:check_old_code/1 to quickly check whether a module has old code. If there is no old code, there is no need to call erlang:check_process_code/2 for all processes, which will save some time if there are many processes.
2011-08-25check_process_code/2: Quickly return 'false' if there is no old codeBjörn Gustavsson
There is no need to suspend the process if the module has no old code. Measurements show that this change will make erlang:check_process_code/2 in an SMP emulator about four times faster if the module has no old code.
2011-08-24Merge branch 'rc/r14-gc-fix' into devHenrik Nord
* rc/r14-gc-fix: fix 64-bit issues in the garbage collection OTP-9488
2011-08-18Update documentation for erlang:raise/3 and erlang:get_stacktrace/0Björn Gustavsson
2011-08-18erl: Add +L to suppress loading of line number informationBjörn Gustavsson
2011-08-18exception_SUITE: Test line numbers in exceptionsBjörn Gustavsson
2011-08-18Implement process_info(Pid, current_{location,stacktrace})Björn Gustavsson
2011-08-16beam_emu: Factor out saving of stack trace from save_stacktrace()Björn Gustavsson
Put the actual saving of the continuation pointers on the stack in the new function erts_save_stacktrace() so that it can be reused. The code is too tricky and complicated to allow it to become duplicated.
2011-08-16ops.tab: Remove line instructions before tail-recursive callsBjörn Gustavsson
2011-08-16Lookup and include filenames and line numbers in exceptionsBjörn Gustavsson
2011-08-16Fix decrement of continuation pointersBjörn Gustavsson
2011-08-16Refactor building of the exception stacktraceBjörn Gustavsson
As a preparation for providing information about the source location for an MFA item in an exception stacktrace, refactor the code that builds the exception stacktrace. Basically we need two passes over the saved continuation counters: a first pass to calculate the needed heap space and a second pass to actually build the stacktrace.
2011-08-16BEAM loader: Load the line tableBjörn Gustavsson
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-16compiler, emulator: Introduce the line/1 instructionBjörn Gustavsson
Introduce the line/1 instruction in the compiler and the BEAM virtual machine. It will not yet be generated by the compiler and will not actually carry any information.
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-15erts: adapt matrix_nif to R14 erl_nif API changesTuncer Ayaz
2011-08-15fix 64-bit issues in the garbage collectionRichard Carlsson
We discovered that if a single Erlang process tried to grow above 32 GB (i.e., more 64-bit words than can be counted by a 32-bit number), the VM failed to find the next larger heap size, even though there were plenty more heap sizes left to pick from and even though we had a lot more memory available on the machine. (Obviously, this is only applicable on 64-bit Erlang.) It turned out to be due to some 'int' variables in the heap resizing parts of erl_gc.c not being properly updated to 'Uint' or 'Sint'. Once that was fixed, I got segfaults instead as soon as the heap got larger than 2^32 words, due to even more 'int' declarations in the same file, but now in the GC code. After fixing this as well, I successfully ran an Erlang node in which a single Erlang process had a heap so large that I'm not at liberty to divulge the exact size, but I think the scientific term is "humongous", and I'm confident that there are no further immediate problems with very very large individual process heaps.
2011-08-08Merge branch 'dev' into majorHenrik Nord
2011-08-08Merge branch 'ms/inet-socket-domain-error' into devHenrik Nord
* ms/inet-socket-domain-error: inet: error if fd does not match socket domain OTP-9455
2011-08-08Merge branch 'dev' into majorHenrik Nord
2011-08-08Merge branch 'cg/fix-constant-logical-operand' into devHenrik Nord
* cg/fix-constant-logical-operand: Fix use of logical operator && with constant operand instead of bitwise &. OTP-9454
2011-08-08Merge branch 'dev' into majorHenrik Nord
2011-08-08Merge branch 'pg/fix-freebsd-dualcore-detection' into devHenrik Nord
* pg/fix-freebsd-dualcore-detection: Fix bug in FreeBSD topology detection code OTP-9453
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-08Merge branch 'bjorn/parallel-make/OTP-9451' into majorBjörn Gustavsson
* bjorn/parallel-make/OTP-9451: (28 commits) erl_interface: Support parallel make dialyzer: Remove special-case build in the top Makefile pcre: Rename Makefile.in to pcre.mk and include it cos*/src/Makefile: Support parallel make ic: Support parallel make orber: Support parallel make .gitignore: Ignore IDL-GENERATED public_key: Support parallel make ssh: Support parallel make os_mon: Support parallel make diameter: Support parallel make snmp: Support parallel make megaco: Support parallel make megaco/src/flex/Makefile.in: Support parallel make */c_src/Makefile*: Support parallel make eunit: Support parallel make gs: Support parallel make common_test Makefile: Support parallel make erts/emulator/Makefile.in: Support parallel make erts: Fix dependency generation ...
2011-08-08pcre: Rename Makefile.in to pcre.mk and include itBjörn Gustavsson
To avoid issues with parallel make and to slightly speed up the build process, avoid a recursive make by replacing pcre/Makefile.in with pcre/pcre.mk and including it from the main emulator Makefile.
2011-08-08erts/emulator/Makefile.in: Support parallel makeBjörn Gustavsson
2011-08-08erts/Makefile.in: Suppress parallel makeBjörn Gustavsson
2011-08-08erts/emulator/Makefile.in: Remove clearmake supportBjörn Gustavsson
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-03beam_load.c: Add overflow check of tag valuesBjörn Gustavsson
The handling of large values for other tags than TAG_i (integer) is buggy. Any tag value equal to or greater than 2^40 (5 bytes) will abort loading. Tag values fitting in 5 bytes will be truncated to 4 bytes values. Those bugs cause real problems because the bs_init2/6 and bs_init_bits/6 instructions unfortunately use TAG_u to encode literal sizes (using TAG_i would have been a better choice, but it is too late to change that now). Any binary size that cannot fit in an Uint should cause a system_limit exception at run-time, but instead the buggy handling will either cause an emulator crash (for values in the range 2^32 to 2^40-1) or abort loading. In this commit, implement overflow checking of tag values as a preparation for fixing the binary construction instructions. If any tag value cannot fit in an Uint (except for TAG_i), change the tag to the special TAG_o overflow tag.
2011-08-03beam_makeops: Add some sanity checksBjörn Gustavsson
We want to make sure that a tag/type name is not defined more than once and that we don't define too many primitive tags. Primitive tags must be named with lowercase letters (or they will be confused with variable names in transformations in the ops.tab file).
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-27Merge branch 'dev' into majorSverker Eriksson
2011-07-27Merge branch 'sverker/epmd-vxworks-select-bug/OTP-9427' into devSverker Eriksson
* sverker/epmd-vxworks-select-bug/OTP-9427: Fix epmd crash on vxworks caused by faulty argument to select
2011-07-27Fix epmd crash on vxworks caused by faulty argument to selectSverker Eriksson
The first argument g->max_conn to select() in epmd_srv.c seems to be wrong as it excludes the listening socket(s). Instead we keep track of the highest fd seen. However I still don't understand why select() started to fail for vxworks with R14B03 when the feature of more than one listening socket was introduced. The default is still 1 listening socket (num_sockets=1), which would make the first argument to select() unchanged.
2011-07-26Merge branch 'dev' into majorSverker Eriksson
2011-07-26Merge branch 'sverker/testcase/OTP-9422' into devSverker Eriksson
* sverker/testcase/OTP-9422: Test case for OTP-9422
2011-07-26Merge branch 'dev' into majorSverker Eriksson