summaryrefslogtreecommitdiff
path: root/erts
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'rickard/memory_consuming_tuple_tests' into maintRickard Green2014-09-051-20/+75
|\ | | | | | | | | * rickard/memory_consuming_tuple_tests: Only run upper boundry tuple test with lots of memory
| * Only run upper boundry tuple test with lots of memoryRickard Green2014-09-051-20/+75
| |
* | Merge branch 'vinoski/enif-schedule-nif' into maintRickard Green2014-09-054-6/+26
|\ \ | | | | | | | | | | | | | | | | | | | | | OTP-12128 * vinoski/enif-schedule-nif: Fix leak of NIF exports Use separate allocation type for NIF export
| * | Fix leak of NIF exportsRickard Green2014-09-051-0/+5
| | |
| * | Use separate allocation type for NIF exportRickard Green2014-09-053-6/+21
| | |
* | | Merge branch 'sverk/term_to_binary-realloc-size/OTP-12141' into maintSverker Eriksson2014-09-041-0/+2
|\ \ \ | | | | | | | | | | | | | | | | * sverk/term_to_binary-realloc-size/OTP-12141: erts: Fix bug in term_to_binary that reallocates binary with wrong size
| * | | erts: Fix bug in term_to_binary that reallocates binary with wrong sizeSverker Eriksson2014-09-031-0/+2
| | | |
* | | | Merge branch 'sverk/MIN_SMALL-to-integer' into maintSverker Eriksson2014-09-043-28/+28
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sverk/MIN_SMALL-to-integer: erts: Correct conversion of MIN_SMALL numeral to fixnum OTP-12140
| * | | | erts: Correct conversion of MIN_SMALL numeral to fixnumSverker Eriksson2014-09-043-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | list_to_integer and binary_to_integer returned un-normalized bignum for -134217728 on 32-bit and -576460752303423488 on 64-bit. Thanks to Jesper Louis Andersen, Mikael Pettersson and Anthony Ramine for report, initial patch and optimization suggestion.
* | | | | Merge branch 'sverk/nif-inspect-copy-bug/OTP-9828' into maintSverker Eriksson2014-09-043-0/+50
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sverk/nif-inspect-copy-bug/OTP-9828: erts: Fix bug with enif_make_copy reallocating writable binary Conflicts: erts/emulator/test/nif_SUITE.erl
| * | | | | erts: Fix bug with enif_make_copy reallocating writable binarySverker Eriksson2014-09-033-0/+50
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that could invalidate a pointer received from an earlier call to enif_inspect_binary. Solution: Emasculate writable binary at enif_inspect_binary. There are room for optimizations here as we now do an unconditional emasculation even though enif_make_copy is not called later in the NIF.
* | | | | Merge branch 'egil/fix-llvm-cc-warnings/OTP-12138' into maintBjörn-Egil Dahlberg2014-09-042-9/+14
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * egil/fix-llvm-cc-warnings/OTP-12138: odbc: Suppress signedness warnings for 'char *' ic: Suppress unused-value warning erts: Fix tentative-definition-incomplete-type erts: Don't redefine '_XOPEN_SOURCE'
| * | | | erts: Fix tentative-definition-incomplete-typeBjörn-Egil Dahlberg2014-06-241-9/+10
| | | | |
| * | | | erts: Don't redefine '_XOPEN_SOURCE'Björn-Egil Dahlberg2014-06-241-0/+4
| | | | |
* | | | | Merge branch 'rickard/runnable-trace-ooo-bug/OTP-12105' into maintRickard Green2014-08-298-62/+190
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rickard/runnable-trace-ooo-bug/OTP-12105: Fix busy_port_SUITE:io_to_busy test-case Ensure "runnable port" trace messages are not sent out of order Ensure "runnable proc" trace messages are not sent out of order
| * | | | | Fix busy_port_SUITE:io_to_busy test-caseRickard Green2014-08-221-2/+4
| | | | | |
| * | | | | Ensure "runnable port" trace messages are not sent out of orderRickard Green2014-08-224-31/+86
| | | | | |
| * | | | | Ensure "runnable proc" trace messages are not sent out of orderRickard Green2014-08-224-30/+101
| | | | | |
* | | | | | Merge branch 'rickard/port-emigrate-bug/maint/OTP-12084' into maintRickard Green2014-08-291-2/+15
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | * rickard/port-emigrate-bug/maint/OTP-12084: Verify run-queue asserts Fix emigrate bug in erts_port_task_schedule()
| * | | | | Merge branch 'rickard/port-emigrate-bug/OTP-12084' into ↵Rickard Green2014-08-181-2/+15
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rickard/port-emigrate-bug/maint/OTP-12084 * rickard/port-emigrate-bug/OTP-12084: Verify run-queue asserts Fix emigrate bug in erts_port_task_schedule() Conflicts: erts/emulator/beam/erl_port_task.c
| | * | | | | Verify run-queue assertsRickard Green2014-08-141-2/+14
| | | | | | |
| | * | | | | Fix emigrate bug in erts_port_task_schedule()Rickard Green2014-08-071-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While current run-queue lock is unlocked in the call to erts_check_emigration_need() from erts_port_task_schedule() the port can be migrated to another run-queue by another thread. The code in erts_port_task_schedule() needs to check if this has occurred when returning from erts_check_emigration_need(), and if so respect the migration decision. When this was not done, the thread calling erts_port_task_schedule() held the wrong run-queue lock which caused invalid updates of the port task queue. This bug was automatically fixed by the rewrites in the branch rickard/r16b/port-optimizations-fixes/OTP-10336 (commit 56cef897ca3ad2377e34a6ea5800a54a28cbeb6e) introduced in erts-5.10 and do not effect erts versions after that.
* | | | | | | Merge branch 'vinoski/enif-schedule-nif' into maintRickard Green2014-08-2811-261/+626
|\ \ \ \ \ \ \ | | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | * vinoski/enif-schedule-nif: add enif_schedule_nif() to NIF API
| * | | | | | add enif_schedule_nif() to NIF APISteve Vinoski2014-08-2811-261/+626
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the #erlang IRC channel Anthony Ramine once mentioned the idea of allowing a NIF to use an emulator trap, similar to a BIF trap, to schedule another NIF for execution. This is exactly how dirty NIFs were implemented for Erlang/OTP 17.0, so this commit refactors and generalizes that dirty NIF code to support a new enif_schedule_nif() API function. The enif_schedule_nif() function allows a long-running NIF to be broken into separate NIF invocations. The NIF first executes part of the long-running task, then calls enif_schedule_nif() to schedule a NIF for later execution to continue the task. Any number of NIFs can be scheduled in this manner, one after another. Since the emulator regains control between invocations, this helps avoid problems caused by native code tying up scheduler threads for too long. The enif_schedule_nif() function also replaces the original experimental dirty NIF API. The function takes a flags parameter that a caller can use to indicate the NIF should be scheduled onto either a dirty CPU scheduler thread, a dirty I/O scheduler thread, or scheduled as a regular NIF on a regular scheduler thread. With this change, the original experimental enif_schedule_dirty_nif(), enif_schedule_dirty_nif_finalizer() and enif_dirty_nif_finalizer() API functions are no longer needed and have been removed. Explicit scheduling of a dirty NIF finalization function is no longer necessary; if an application wants similar functionality, it can have a dirty NIF just invoke enif_schedule_nif() to schedule a non-dirty NIF to complete its task. Lift the restriction that dirty NIFs can't call enif_make_badarg() to raise an exception. This was a problem with the original dirty NIF API because it forced developers to get and check all incoming arguments in a regular NIF, and then schedule the dirty NIF which then had to get all the arguments again. Now, the argument checking can be done in the dirty NIF and it can call enif_make_badarg() itself to flag incorrect arguments. Extend the ErlNifFunc struct with a new flags field that allows NIFs to be declared as dirty. The default value for this field is 0, indicating a regular NIF, so it's backwards compatible with all existing statically initialized ErlNifFunc struct instances, and so such instances require no code changes. Defining the flags field with a value of ERL_NIF_DIRTY_JOB_CPU_BOUND indicates that the NIF should execute on a dirty CPU scheduler thread, or defining it with a value of ERL_NIF_DIRTY_JOB_IO_BOUND indicates that the NIF should execute on a dirty I/O scheduler thread. Any other flags field value causes a NIF library loading error. Extend the ErlNifEntry struct with a new options field that indicates whether a NIF library was built with support for optional features such as dirty NIFs. When a NIF library is loaded, the runtime checks the options field to ensure compatibility. If a NIF library built with dirty NIF support is loaded into a runtime that does not support dirty NIFs, and the library defines one or more ErlNifFunc entries with non-zero flags fields indicating dirty NIFs, a NIF library loading error results. There is no error if a NIF library built with dirty NIF support is loaded into a runtime that does not support dirty NIFs but the library does not have any dirty NIFs. It is also not an error if a library without dirty NIF support is loaded into a runtime built with dirty NIF support. Add documentation and tests for enif_schedule_nif().
* | | | | | | Merge branch 'tuncer/misspelled-another' into maintMarcus Arendt2014-08-282-2/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tuncer/misspelled-another: Fix misspellings of 'another'
| * | | | | | | Fix misspellings of 'another'Tuncer Ayaz2014-08-252-2/+2
| | | | | | | |
* | | | | | | | Fix ERTS_POLL_DEBUG_PRINT usageMichael Truog2014-08-221-1/+1
| |/ / / / / / |/| | | | | |
* | | | | | | Merge branch 'egil/proc_lib-optimizations/OTP-12060' into maintBjörn-Egil Dahlberg2014-08-215-3/+54
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * egil/proc_lib-optimizations/OTP-12060: stdlib: Update dependencies to erts-6.2 erts: Update preloaded erlang.beam stdlib: Use erlang:fun_info_mfa/1 in proc_lib:init_p/3 erts: Test erlang:fun_info_mfa/1 erts: Introduce erlang:fun_info_mfa/1
| * | | | | | erts: Update preloaded erlang.beamBjörn-Egil Dahlberg2014-07-141-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Specs for erlang:fun_info_mfa/1
| * | | | | | erts: Test erlang:fun_info_mfa/1Björn-Egil Dahlberg2014-07-111-2/+21
| | | | | | |
| * | | | | | erts: Introduce erlang:fun_info_mfa/1Björn-Egil Dahlberg2014-07-113-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduced for proc_lib:init_p/3
* | | | | | | Merge branch 'nox/reedr-logging/OTP-12115' into maintLukas Larsson2014-08-215-16/+30
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nox/reedr-logging/OTP-12115: Add number of entries to mnesia copy debug message Add thread index to allocator enomem dump slogan Add run queue index to process dump info Add missing error string to syslog logging in epmd Demote rare debug slogan of message discarding to debug build
| * | | | | | Add thread index to allocator enomem dump sloganRick Reed2014-03-092-15/+17
| | | | | | |
| * | | | | | Add run queue index to process dump infoRick Reed2014-03-092-0/+4
| | | | | | |
| * | | | | | Add missing error string to syslog logging in epmdRick Reed2014-03-091-1/+5
| | | | | | |
| * | | | | | Demote rare debug slogan of message discarding to debug buildRick Reed2014-03-091-0/+4
| | | | | | |
* | | | | | | Fix +swct docRickard Green2014-08-141-1/+1
| |_|_|_|_|/ |/| | | | |
* | | | | | Merge branch 'lukas/erts/fix_neg_of_int64_min/OTP-12097' into maintLukas Larsson2014-08-144-17/+25
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lukas/erts/fix_neg_of_int64_min/OTP-12097: erts: Fix neg int overflow when sint is min size
| * | | | | | erts: Fix neg int overflow when sint is min sizeLukas Larsson2014-08-084-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When INT64_MIN is the value of a Sint64 we have to first cast it to an Uint64 before negating it. Otherwise we get an integer overflow which is undefined behaviour and in gcc 4.9 this results in -0 instead of -9223372036854775808 in gcc 4.8.
* | | | | | | Merge branch 'nox/clang-ubsan/OTP-12097' into maintLukas Larsson2014-08-142-3/+5
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nox/clang-ubsan/OTP-12097: Properly handle SINT_MIN in small_to_big() Use offsetof() in io.c
| * | | | | | | Properly handle SINT_MIN in small_to_big()Anthony Ramine2014-07-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As there is no overflow for signed integers, -SINT_MIN is undefined behaviour and the cast to unsigned needs to happen before negation. SINT_MIN denotes the minimum value that can be stored in the Sint type. beam/big.c:1512:6: runtime error: negation of -9223372036854775808 cannot be represented in type 'Sint' (aka 'long'); cast to an unsigned type to negate this value to itself
| * | | | | | | Use offsetof() in io.cAnthony Ramine2014-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This silences the following UBSan errors: beam/io.c:7131:27: runtime error: member access within null pointer of type 'ErlDrvSysInfo' beam/io.c:7140:20: runtime error: member access within null pointer of type 'ErlDrvSysInfo' beam/io.c:7166:20: runtime error: member access within null pointer of type 'ErlDrvSysInfo' beam/io.c:7174:20: runtime error: member access within null pointer of type 'ErlDrvSysInfo'
* | | | | | | | Merge branch 'rickard/nosuspend-bug/OTP-12082' into maintRickard Green2014-08-115-4/+220
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rickard/nosuspend-bug/OTP-12082: Fix build of test port program Update Makefile.src Add async_ports test Fix abort of nosuspend-tasks in erts_port_task_schedule()
| * | | | | | | | Fix build of test port programRickard Green2014-08-063-5/+32
| | | | | | | | |
| * | | | | | | | Update Makefile.srckudryashov-sv2014-08-051-1/+1
| | | | | | | | |
| * | | | | | | | Add async_ports testSergey Kudryashov2014-08-054-0/+188
| | | | | | | | |
| * | | | | | | | Fix abort of nosuspend-tasks in erts_port_task_schedule()Rickard Green2014-08-051-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The counter for the amount of outstanding data in the port queue became inconsistent when aborting nosuspend-signals in erts_port_task_schedule(). This since the counter was subtracted by the data size of the signal although the data size had never been added to it. This inconsistency caused the port queue to remain in a busy state forever.
* | | | | | | | | Merge branch 'tuncer/sanitizers' into maintBruce Yinhe2014-08-081-0/+20
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OTP-12081 * tuncer/sanitizers: Implement --enable-sanitizers[=sanitizers]
| * | | | | | | | | Implement --enable-sanitizers[=sanitizers]Tuncer Ayaz2014-07-121-0/+20
| | |_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to debugging with Valgrind, it's very useful to enable -fsanitize= switches to catch bugs at runtime. $ ./configure Result: no sanitizer enabled $ ./configure --enable-sanitizers Result: -fsanitize=address,undefined $ ./configure --enable-sanitizers=address,thread,undefined Result: -fsanitize=address,thread,undefined $ ./configure --enable-sanitizers=undefined Result: -fsanitize=undefined
* | | | | | | | | Merge branch 'lukas/erts/malloc_failure_errors/OTP-12085' into maintLukas Larsson2014-08-084-10/+28
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lukas/erts/malloc_failure_errors/OTP-12085: erts: Print error reason when malloc fails