Age | Commit message (Collapse) | Author | |
---|---|---|---|
2017-11-30 | Add syntax in try/catch to retrieve the stacktrace directly | Björn Gustavsson | |
This commit adds a new syntax for retrieving the stacktrace without calling erlang:get_stacktrace/0. That allow us to deprecate erlang:get_stacktrace/0 and ultimately remove it. The problem with erlang:get_stacktrace/0 is that it can keep huge terms in a process for an indefinite time after an exception. The stacktrace can be huge after a 'function_clause' exception or a failed call to a BIF or operator, because the arguments for the call will be included in the stacktrace. For example: 1> catch abs(lists:seq(1, 1000)). {'EXIT',{badarg,[{erlang,abs, [[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20|...]], []}, {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,674}]}, {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,431}]}, {shell,exprs,7,[{file,"shell.erl"},{line,687}]}, {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]}, {shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}]}} 2> erlang:get_stacktrace(). [{erlang,abs, [[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22, 23,24|...]], []}, {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,674}]}, {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,431}]}, {shell,exprs,7,[{file,"shell.erl"},{line,687}]}, {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]}, {shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}] 3> We can extend the syntax for clauses in try/catch to optionally bind the stacktrace to a variable. Here is an example using the current syntax: try Expr catch C:E -> Stk = erlang:get_stacktrace(), . . . In the new syntax, it would look like: try Expr catch C:E:Stk -> . . . Only a variable (not a pattern) is allowed in the stacktrace position, to discourage matching of the stacktrace. (Matching would also be expensive, because the raw format of the stacktrace would have to be converted to the cooked form before matching.) Note that: try Expr catch E -> . . . is a shorthand for: try Expr catch throw:E -> . . . If the stacktrace is to be retrieved for a throw, the 'throw:' prefix must be explicitly included: try Expr catch throw:E:Stk -> . . . | |||
2017-11-15 | Merge PR-1621 from margnus1/hipe-literal-tag | Sverker Eriksson | |
HiPE: Support for literal tag, tests and bugfixes | |||
2017-11-06 | erts: Remove obsolete hipe primop bs_validate_unicode | Sverker Eriksson | |
which was replaced by 'is_unicode' in 5369e34a892bfd8ab5aa98df330e3bbf19497b71 but kept for ABI compatibility in OTP-20.*. | |||
2017-11-05 | HiPE: Make is_divisible a primop | Magnus Lång | |
Since gcunsafe values are live over is_divisible calls (although only the happy path, which never GCd), it should be a primop so there cannot be any GCs. | |||
2017-11-03 | Merge branch 'maint' | Sverker Eriksson | |
2017-11-03 | Fix bug in hipe for <<X/utf32>> | Sverker Eriksson | |
by introducing new primop 'is_unicode' with no exception (ab)use and no GC. Replaces bs_validate_unicode which is kept for backward compat for now. | |||
2017-11-03 | Prevent hipe_bs_validate_unicode from doing GC | Sverker Eriksson | |
Fix for x86_64 only. The calling native code can not handle a GC as it has a raw pointer where to write the binary data. If a GC happens the data (utf32) will be written to the old deallocated heap. | |||
2017-07-17 | erts: Cleanup configure and makefiles after non-smp removal | Lukas Larsson | |
2017-01-12 | Perform potentially long GC on dirty schedulers if available | Rickard Green | |
2017-01-12 | Support for dirty BIFs | Rickard Green | |
2016-08-31 | Remove old purge strategy | Rickard Green | |
2016-06-30 | hipe: Fix bug in trap frame allocation wrappers | Magnus Lång | |
The trap frame allocation wrappers occasionally call the garbage collector, even though built-in functions are not supposed to. On non-{x86,amd64} platforms, HiPE was optimising the BIF wrapper interface on the basis that BIFs do not GC. So, when hipe_reserve_beam_trap_frame called the garbage collector, the state in the PCB was stale and corruption happened. Now, these particular BIFs are reclassified as GC BIFs. Unfortunately, in order to do that we needed to introduce a gc_bif_interface_3 macro in every hipe_$ARCH_bifs.m4 file. | |||
2016-03-15 | update copyright-year | Henrik Nord | |
2015-11-27 | hipe: test unit size match in bs_append | Magnus Lång | |
This feature was previously missing and expressions such as <<<<1:1>>/binary>> would succeed construction when compiled with HiPE. A primop is_divisible is introduced to handle the case when the unit size is not a power of two. | |||
2015-08-28 | erts: Fix hipe bug for maps:merge/2 | Sverker Eriksson | |
Add forgotten HIPE_WRAPPER_BIF_DISABLE_GC which could lead to stack-heap overrun if unlucky with the yielding during maps:merge when called by native hipe code. | |||
2015-08-28 | erts: Beautify hipe wrapper macro | Sverker Eriksson | |
2015-06-18 | Change license text to APLv2 | Bruce Yinhe | |
2015-05-06 | Merge branch 'sverk/hipe_match_wbin/OTP-12667' | Sverker Eriksson | |
* sverk/hipe_match_wbin/OTP-12667: erts: Add debug assertions for match state sanity hipe: Add test for matching of writable binary erts,hipe: Optimize away calls to emasculate_binary erts,hipe: Fix bug in binary matching of writable binary Conflicts: erts/emulator/hipe/hipe_bif0.c | |||
2015-04-20 | erts,hipe: Fix bug in binary matching of writable binary | Sverker Eriksson | |
Seen symptom: Hipe compiled code with <<C/utf8, ...>> = Bin does sometimes not match even though Bin contains a valid utf8 character. There might be other possible binary matching symptoms, as the problem is not utf8 specific. Problem: A writable binary was not "emasculated" when the matching started (as it should) by the hipe compiled code. Fix: Add a new primop emasculate_binary(Bin) that is called when a matchstate is created. ToDo: There are probably room for optimization. For example only call emasculate_binary if ProcBin.flags is set. | |||
2014-08-29 | erts: Implement yielding for distributed send of large messages | Sverker Eriksson | |
Use same mechanism as term_to_binary to yield while encoding large messages for distributed send. | |||
2014-06-05 | Replace erlang:binary_to_term() Erlang wrappers | Rickard Green | |
Replace the 'erlang:binary_to_term/1' and 'erlang:binary_to_term/2' Erlang wrappers taking care of failure after yield with management of this in the hidden yield BIF. | |||
2014-05-22 | Make binary BIFs converting from lists yield on large input | Rickard Green | |
- erlang:list_to_binary/1 - erlang:iolist_to_binary/1 - erlang:list_to_bitstring/1 - binary:list_to_bin/1 | |||
2014-05-22 | Make binary BIFs converting to lists yield on large input | Rickard Green | |
- erlang:binary_to_list/1 - erlang:binary_to_list/3 - erlang:bitstring_to_list/1 | |||
2014-02-25 | erts: Fix heap overwrite by hipe "trap frames" when GC is disabled | Sverker Eriksson | |
by trapping BIFs like term_to_binary and binary_to_term. | |||
2013-11-18 | Execution of system tasks in context of another process | Rickard Green | |
A process requesting a system task to be executed in the context of another process will be notified by a message when the task has executed. This message will be on the form: {RequestType, RequestId, Pid, Result}. A process requesting a system task to be executed can set priority on the system task. The requester typically set the same priority on the task as its own process priority, and by this avoiding priority inversion. A request for execution of a system task is made by calling the statically linked in NIF erts_internal:request_system_task(Pid, Prio, Request). This is an undocumented ERTS internal function that should remain so. It should *only* be called from BIF implementations. Currently defined system tasks are: * garbage_collect * check_process_code Further system tasks can and will be implemented in the future. The erlang:garbage_collect/[1,2] and erlang:check_process_code/[2,3] BIFs are now implemented using system tasks. Both the 'garbage_collect' and the 'check_process_code' operations perform or may perform garbage_collections. By doing these via the system task functionality all garbage collect operations in the system will be performed solely in the context of the process being garbage collected. This makes it possible to later implement functionality for disabling garbage collection of a process over context switches. Newly introduced BIFs: * erlang:garbage_collect/2 - The new second argument is an option list. Introduced option: * {async, RequestId} - making it possible for users to issue asynchronous garbage collect requests. * erlang:check_process_code/3 - The new third argument is an option list. Introduced options: * {async, RequestId} - making it possible for users to issue asynchronous check process code requests. * {allow_gc, boolean()} - making it possible to issue requests that aren't allowed to garbage collect (operation will abort if gc should be needed). These options have been introduced as a preparation for parallelization of check_process_code operations when the code_server is about to purge a module. | |||
2012-12-07 | Merge branch 'rickard/port-optimizations/OTP-10336' into ↵ | Rickard Green | |
rickard/r16/port-optimizations/OTP-10336 * rickard/port-optimizations/OTP-10336: Change annotate level for emacs-22 in cerl Update etp-commands Add documentation on communication in Erlang Add support for busy port message queue Add driver callback epilogue Implement true asynchronous signaling between processes and ports Add erl_drv_[send|output]_term Move busy port flag Use rwlock for driver list Optimize management of port tasks Improve configuration of process and port tables Remove R9 compatibility features Use ptab functionality also for ports Prepare for use of ptab functionality also for ports Atomic port state Generalize process table implementation Implement functionality for delaying thread progress from unmanaged threads Conflicts: erts/doc/src/erl_driver.xml erts/doc/src/erlang.xml erts/emulator/beam/beam_bif_load.c erts/emulator/beam/beam_bp.c erts/emulator/beam/beam_emu.c erts/emulator/beam/bif.c erts/emulator/beam/copy.c erts/emulator/beam/erl_alloc.c erts/emulator/beam/erl_alloc.types erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_bif_port.c erts/emulator/beam/erl_bif_trace.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_message.c erts/emulator/beam/erl_port_task.c erts/emulator/beam/erl_process.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_process_lock.c erts/emulator/beam/erl_trace.c erts/emulator/beam/export.h erts/emulator/beam/global.h erts/emulator/beam/io.c erts/emulator/sys/unix/sys.c erts/emulator/sys/vxworks/sys.c erts/emulator/test/port_SUITE.erl erts/etc/unix/cerl.src erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/prim_inet.beam erts/preloaded/src/prim_inet.erl lib/hipe/cerl/erl_bif_types.erl lib/kernel/doc/src/inet.xml lib/kernel/src/inet.erl | |||
2012-12-03 | Use ptab functionality also for ports | Rickard Green | |
2012-11-23 | Merge branch 'maint' | Björn-Egil Dahlberg | |
2012-11-23 | Update copyright years | Björn-Egil Dahlberg | |
2012-11-14 | Merge remote branch 'upstream/maint' | Ingela Anderton Andin | |
Conflicts: lib/ssl/src/ssl_connection.erl | |||
2012-11-13 | erts: Fix compile error on solaris in generated hipe_amd64_bifs.S | Sverker Eriksson | |
2012-02-09 | hipe,erts: Debug support for native call trace | Sverker Eriksson | |
2011-11-17 | hipe,erts: Allow hipe without floating point exceptions | Sverker Eriksson | |
2011-11-13 | Merge branch 'rickard/alloc-opt/OTP-7775' | Rickard Green | |
* rickard/alloc-opt/OTP-7775: Optimize memory allocation Conflicts: erts/aclocal.m4 erts/emulator/hipe/hipe_bif_list.m4 erts/preloaded/ebin/erl_prim_loader.beam erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/init.beam erts/preloaded/ebin/otp_ring0.beam erts/preloaded/ebin/prim_file.beam erts/preloaded/ebin/prim_inet.beam erts/preloaded/ebin/prim_zip.beam erts/preloaded/ebin/zlib.beam | |||
2011-11-13 | Optimize memory allocation | Rickard Green | |
A number of memory allocation optimizations have been implemented. Most optimizations reduce contention caused by synchronization between threads during allocation and deallocation of memory. Most notably: * Synchronization of memory management in scheduler specific allocator instances has been rewritten to use lock-free synchronization. * Synchronization of memory management in scheduler specific pre-allocators has been rewritten to use lock-free synchronization. * The 'mseg_alloc' memory segment allocator now use scheduler specific instances instead of one instance. Apart from reducing contention this also ensures that memory allocators always create memory segments on the local NUMA node on a NUMA system. | |||
2011-10-26 | erts-hipe: Rename fail_bif_interface_0 to standard_bif_interface_0 | Sverker Eriksson | |
2011-10-26 | erts-hipe: Make some primops use new BIF calling convention | Sverker Eriksson | |
These primops use the standard_bif_interface_X macros in hipe_bif_list.m4 and must therefor be implemented as bifs for things to work. Maybe there is room for optimization here to call the primops more directly with arguments in registers without having to push them on stack to emulate bif calls. | |||
2011-02-14 | Cleanup tags | Kostis Sagonas | |
2009-11-20 | The R13B03 release.OTP_R13B03 | Erlang/OTP | |