aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
AgeCommit message (Collapse)Author
2013-12-02Merge branch 'maint'Henrik Nord
2013-12-02Compile in_heapfrag() only in debug modeAnthony Ramine
2013-12-02Fix erts_check_off_heap2 assertionAnthony Ramine
The test needs to be false to fail, not true. This was noticed with the following warning, where marking erl_assert_error as non-returning didn't help: beam/erl_gc.c:2772:2: warning: variable 'refc' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ beam/erl_gc.c:2775:26: note: uninitialized use occurs here ERTS_CHK_OFFHEAP_ASSERT(refc >= 1); ^~~~ beam/erl_gc.c:2738:11: note: expanded from macro 'ERTS_CHK_OFFHEAP_ASSERT' if (!(EXP)) \ ^ beam/erl_gc.c:2759:18: note: initialize the variable 'refc' to silence this warning erts_aint_t refc; ^ = 0
2013-12-02Properly mark erl_assert_error as non-returningAnthony Ramine
2013-12-02Remove uninitialized use of new_crr in erl_alloc_utilAnthony Ramine
When the offending code is reached, new_crr is either uninitalized or have been set to NULL. This patch removes the following warning: beam/erl_alloc_util.c:3510:6: warning: variable 'new_crr' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (!(flags & CFLG_FORCE_MSEG)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ beam/erl_alloc_util.c:3567:23: note: uninitialized use occurs here DEBUG_SAVE_ALIGNMENT(new_crr); ^~~~~~~ beam/erl_alloc_util.c:674:51: note: expanded from macro 'DEBUG_SAVE_ALIGNMENT' UWord algnmnt__ = sizeof(Unit_t) - (((UWord) (C)) % sizeof(Unit_t));\ ^ beam/erl_alloc_util.c:3510:2: note: remove the 'if' if its condition is always true if (!(flags & CFLG_FORCE_MSEG)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ beam/erl_alloc_util.c:3438:23: note: initialize the variable 'new_crr' to silence this warning Carrier_t *new_crr, *old_crr; ^ = NULL
2013-11-29Merge branch 'maint'Sverker Eriksson
2013-11-29Merge branch 'sverk/bit-cmp-bug/OTP-11501' into maintSverker Eriksson
* sverk/bit-cmp-bug/OTP-11501: erts: Fix invalid read when appending binaries during call trace erts: Optimize comparison for bitstrings with byte aligned start erts: Fix invalid read in bitstring comparison
2013-11-28Merge branch 'maint'Rickard Green
* maint: Fix prim_inet:close/1 Ensure exit signal due to link precede port BIF return Conflicts: erts/preloaded/ebin/prim_inet.beam
2013-11-28Merge branch 'rickard/port_bifs_fix/OTP-11489' into maintRickard Green
* rickard/port_bifs_fix/OTP-11489: Ensure exit signal due to link precede port BIF return
2013-11-28Merge branch 'maint'Lukas Larsson
* maint: Improve error info when main carrier creation fails
2013-11-28Merge branch 'lukas/erts/supercarrier_fix/OTP-11149' into maintLukas Larsson
* lukas/erts/supercarrier_fix/OTP-11149: Improve error info when main carrier creation fails Conflicts: erts/emulator/test/alloc_SUITE.erl
2013-11-27Merge branch 'maint'Sverker Eriksson
2013-11-27Merge branch 'sverk/bin2term-bitstr-bugs/OTP-11479' into maintSverker Eriksson
* sverk/bin2term-bitstr-bugs/OTP-11479: erts: Fix bug in binary_to_term for binaries larger than 2^31 erts: Fix bugs in binary_to_term for invalid bitstrings
2013-11-27Merge branch 'maint'Sverker Eriksson
2013-11-27Merge branch 'sverk/allctr-4byte-align-bug' into maintSverker Eriksson
* sverk/allctr-4byte-align-bug: erts: Fix alignment bug in allocator start code OTP-11496
2013-11-27erts: Fix invalid read when appending binaries during call traceSverker Eriksson
Found by valgrind. Probably safe on opt-VM due to CHICKEN_PAD.
2013-11-26erts: Optimize comparison for bitstrings with byte aligned startSverker Eriksson
2013-11-26erts: Fix invalid read in bitstring comparisonSverker Eriksson
Valgrind complained that erts_cmp_bits sometimes read one byte too much from bitstrings. The byte was never used and the invalid read is safe in opt-VM due to padding in binary allocation (CHICKED_PAD).
2013-11-26Ensure exit signal due to link precede port BIF returnRickard Green
2013-11-26Merge branch 'maint'Raimo Niskanen
Conflicts: erts/preloaded/ebin/prim_inet.beam lib/kernel/test/gen_sctp_SUITE.erl
2013-11-26Merge branch 'maint-r16' into maintRaimo Niskanen
2013-11-25Improve error info when main carrier creation failsLukas Larsson
Also fix testcase that failed due to main carrier creation failure.
2013-11-25Merge branch 'maint'Rickard Green
* maint: Ensure carrier pool only accessed by schedulers
2013-11-25Merge branch 'rickard/acul-bug/OTP-11456' into maintRickard Green
* rickard/acul-bug/OTP-11456: Ensure carrier pool only accessed by schedulers
2013-11-25Merge branch 'maint'Rickard Green
* maint: Fix observer retrieval of alloc info Fix documentation of the +MMsco switch Replace the +MMscmgc switch with +MMscrfsd Add switch for disabling sys_alloc carriers Add support for locking mappings to physical memory
2013-11-25Merge branch 'rickard/supercarrier-fix/OTP-11149' into maintRickard Green
* rickard/supercarrier-fix/OTP-11149: Fix observer retrieval of alloc info Fix documentation of the +MMsco switch Replace the +MMscmgc switch with +MMscrfsd Add switch for disabling sys_alloc carriers Add support for locking mappings to physical memory
2013-11-21erts: Adjust term_to_binary reduction factorsR16B02_yielding_binary_to_termSverker Eriksson
Made them powers of 2 for faster calculations. 500 encoded terms per reductions seemed a bit much, lowered to 32. TERM_TO_BINARY_SIZE_FACTOR was not used in practice as it was only applied to small binaries. Lowered from 500kb to 256kb compressed bytes per trap call.
2013-11-21erts: Yield after trapping term_to_binary if gc has been orderedSverker Eriksson
or if "too much" offheap binaries has been built
2013-11-21erts: Let term_to_binary disable gc while trappingSverker Eriksson
as an attempt to improve performance
2013-11-20erts: Fix alignment bug in allocator start codeSverker Eriksson
Bug never released.
2013-11-20Merge branch 'maint'Björn Gustavsson
* maint: Fix truncated pointers in erl_crash.dump
2013-11-20Merge branch 'bjorn/erts/fix-erl_crash_dump/OTP-11450' into maintBjörn Gustavsson
* bjorn/erts/fix-erl_crash_dump/OTP-11450: Fix truncated pointers in erl_crash.dump
2013-11-18erts: Fix bug in binary_to_term for compressed on halfwordSverker Eriksson
2013-11-18erts: Fix crash when binary_to_term throws badargSverker Eriksson
after it has built off_heap data and then done at least one trap call. The undo mechanism in dec_term does not work if we build the magic binary after any other off_heap data.
2013-11-18erts: Trapping memcpy in binary_to_termSverker Eriksson
2013-11-18erts: Cleanup code for trapping binary_to_termSverker Eriksson
2013-11-18erts: Add erlang wrappers to binary_to_termSverker Eriksson
to not expose the trapping BIF in the stacktrace when it throws badarg.
2013-11-18trapping uncompressSverker Eriksson
2013-11-18trapping size calculationSverker Eriksson
2013-11-18trapping binary_to_term/2Sverker Eriksson
2013-11-18trapping STRING_EXTSverker Eriksson
2013-11-18trapping lists and tuplesSverker Eriksson
2013-11-18trapping binary_to_term passing binary_SUITESverker Eriksson
2013-11-18Functionality for disabling garbage collectionRickard Green
Being able to disable garbage collection over context switches vastly simplifies implementation of yielding native code that builds large or complex data structures on the heap. This since the heap can be left in an inconsistent state over the context switch.
2013-11-18Execution of system tasks in context of another processRickard 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.
2013-11-18erts: Fix bug in binary_to_term for binaries larger than 2^31Sverker Eriksson
2013-11-18erts: Fix bugs in binary_to_term for invalid bitstringsSverker Eriksson
<<131, 77, Len:32, Bits:8, Data/binary>> badarg if Bits > 8 Used to return internally inconsistent bitstring badarg if Len==0 and Bits > 0 Used to return invalid *huge* binary (size = (Uint)-1) badarg if Bits==0 and Len > 0 Used to return valid binary as if Bits was 8
2013-11-18Merge branch 'maint'Fredrik Gustafsson
Conflicts: bootstrap/lib/kernel/ebin/os.beam
2013-11-18Merge branch 'mhssler/add-os-unsetenv/OTP-11446' into maintFredrik Gustafsson
* mhssler/add-os-unsetenv/OTP-11446: erts: remove ?line macro in testcases Update primary bootstrap Add os:unsetenv/1
2013-11-11Merge branch 'maint'Sverker Eriksson