aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
AgeCommit message (Collapse)Author
2014-05-08Add Visual Studio macros to erl_driver.h and ei.hPiotr Nosek
2014-05-06Merge branch 'sverk/ets-delete-unfix-race/OTP-11892' into maintSverker Eriksson
* sverk/ets-delete-unfix-race/OTP-11892: Fix race between ETS table deletion and unfixation erts: Add etp commands for alloc_util block and carrier inspection
2014-05-05Merge branch 'lukas/erts/suspend_assert/OTP-11906' into maintLukas Larsson
* lukas/erts/suspend_assert/OTP-11906: erts: Fix faulty process suspend assert
2014-05-05erts: Fix faulty process suspend assertLukas Larsson
2014-05-05Merge branch 'lukas/erts/etp-lc-macros/OTP-11904' into maintLukas Larsson
* lukas/erts/etp-lc-macros/OTP-11904: erts: Add etp-lc-dump and etp-ppc-stacktrace macro
2014-04-30erts: Add erts_internal:map_to_tuple_keys/1Björn-Egil Dahlberg
* Used for introspection. * Will return the internal key tuple if applicable * Not documented - not for public use
2014-04-29Fix race between ETS table deletion and unfixationSverker Eriksson
Symptom: VM crash running mnesia_SUITE Scenario: Process A terminates while still having fixed table T and process B "at the same time" deletes table T with ets:delete/1 or by terminating. Problem: A table scheduled for deallocation do only have a valid 'common' part. The unfix-table-at-process-exit code tried to read the hash-specific part of such a table. Solution: Must back off if DB_DELETE flag is set. Since: R16B
2014-04-28Add erlang:system_info(tolerant_timeofday)Eiichi Tsukata
Add erlang:system_info(tolerant_timeofday), an API to check whether compensation for sudden changes of system time is enabled or not.
2014-04-08erts: Fix system_monitor(large_heap) for non-smp VMSverker Eriksson
No message for large_heap monitoring was ever sent on non-smp VM. Bug introduced in R16B.
2014-03-31Merge branch 'sverk/suspend-running-race'Sverker Eriksson
* sverk/suspend-running-race: erts: Fix bug of scheduling a suspended process
2014-03-28prevent NIF purge during dirty NIF executionSteve Vinoski
Reference-count the NIF before and after invoking a NIF on dirty schedulers to prevent having the NIF purged during the call.
2014-03-28fix dirty NIF invalid memory readSteve Vinoski
Dirty NIF support used an Export structure to facilitate calls to dirty NIFs and finalizers, but Export isn't large enough to hold all necessary data. This was causing an invalid memory read in beam_emu.c past the end of the Export object. Add a local extended Export struct to erl_nif.c that can hold all the necessary data.
2014-03-28erts: Add etp-lc-dump and etp-ppc-stacktrace macroLukas Larsson
2014-03-27erts: Fix bug of scheduling a suspended processSverker Eriksson
This is a race that can cause RUNNING (instead of RUNNING_SYS) set on a SUSPENDED process. The effect of this race happening is probably quite benign. The bug was discovered by process_SUITE:processes_gc_trap on debug VM crashing on last assert in schedule(): /* Never run a suspended process */ ASSERT(!(ERTS_PSFLG_SUSPENDED & erts_smp_atomic32_read_nob(&p->state)));
2014-03-27erts: Adjust is_external_header() for new map tagSverker Eriksson
to not mistake a map for an external term (pid, port or ref).
2014-03-26Change the subtag used for maps from 0xB to 0xFKostis Sagonas
The subtag chosen for maps breaks crucial assumptions in other parts of the system, in particular the native code generation scheme used in the HiPE compiler. Therefore it is better to use 'the other' unused subtag. The main change here is the use of 0xF subtag for maps instead of 0xB. The rest of the differences are changes to and additions of comments. One more comment from my part. I noticed that the file contains the following two lines: The comment of the second line is most certainly a copy and paste error and should be appropriately fixed by the OTP developers. More importantly, it would be great if that subtag (0x7) turned out to be unused and could be used for maps instead of the 0xF one. This might turn out very handy in the future. I can elaborate on this, if needed.
2014-03-25Merge branch 'sverk/maps_remove_bug'Sverker Eriksson
* sverk/maps_remove_bug: erts: Fix heap overflow in maps:remove/2 when key is not found
2014-03-25Merge branch 'sverk/win-warning-io'Sverker Eriksson
* sverk/win-warning-io: erts: Fix compile warning in io.c for windows
2014-03-25erts: Fix compile warning in io.c for windowsSverker Eriksson
2014-03-25Merge branch 'paulgray/dtrace_snprintf_fix/OTP-11816'Lukas Larsson
* paulgray/dtrace_snprintf_fix/OTP-11816: Fix DTrace/SystemTap-related formatting
2014-03-25Fix DTrace/SystemTap-related formattingScott Lystig Fritchie
Thanks to Michał Ptaszek for bringing this embarrassing formatting error to my attention. Many DTrace/SystemTap trace strings are incorrectly truncated at 4/8 bytes, depending on the CPU word size. This patch expands the work from commit d032e097 by zheng siyao. Michał's report to the erlang-bugs list can be found at: http://erlang.org/pipermail/erlang-bugs/2014-March/004250.html Conflicts: erts/emulator/beam/beam_emu.c erts/emulator/beam/copy.c erts/emulator/beam/dist.c erts/emulator/beam/erl_async.c erts/emulator/beam/erl_bif_port.c erts/emulator/beam/erl_port_task.c erts/emulator/beam/erl_process.c erts/emulator/beam/io.c
2014-03-25Merge branch 'paulgray/dtrace_snprintf_fix/OTP-11816'Lukas Larsson
* paulgray/dtrace_snprintf_fix/OTP-11816: Pass full strings to DTrace probes
2014-03-21Merge branch 'fogfish/embedded-arm-android'Henrik Nord
* fogfish/embedded-arm-android: Raspberry PI / Android a minimal cross-compile configuration OTP-11805
2014-03-21erts: Fix heap overflow in maps:remove/2 when key is not foundSverker Eriksson
One key-value pair too many was copied.
2014-03-21Introduce minimum allowed major driver and nif versions on loadRickard Green
2014-03-21Raspberry PI / Android a minimal cross-compile configurationDmitry Kolesnikov
Enable a cross compile Erlang/OTP platform to Android or Raspberry PI using Android NDK. Port emulator and core application to support target HW platform. Exclude any add-on services required for OTP platform deployment into target hardware due to device fragmentation and jail-break requirements. * fix erts/emulator/beam/sys.h Disable redefinition of __noreturn macro * port erts/emulator/sys/unix/erl_child_setup.c Use techniques proposed by https://code.google.com/p/erlang4android to access system properties * fix erts/emulator/sys/unix/erl_unix_sys_ddll.c The static linking of emulator cannot find dlerror(), dlopen() symbols * port erts/emulator/sys/unix/sys.c make path to shell configurable at build time * port erts/etc/common/Makefile.in disable librt for *-linux-androideabi * port erts/lib_src/pthread/ethread.c Use techniques proposed by https://code.google.com/p/erlang4android to disable emulator crash if kernel threads are on. Replace unreliable pthread_sigmask() by sigprocmask() * port lib/erl_interface/src/connect/ei_connect.c Disable call to undefined gethostid() * port lib/erl_interface/src/connect/ei_resolve.c Use gethostbyname_r() on Android platform
2014-03-20Merge branch 'vinoski/ds-enif-send'Rickard Green
* vinoski/ds-enif-send: enable enif_send to work from a dirty scheduler
2014-03-20Merge branch 'bjorn/erts/fix-lingering-tracer'Björn Gustavsson
* bjorn/erts/fix-lingering-tracer: Teach the call_time trace to notice when the trace dies (non-SMP system)
2014-03-20Teach the call_time trace to notice when the trace dies (non-SMP system)Björn Gustavsson
The call_time trace is a special kind of tracing that requires a tracer process just like ordinary call trace, but it never actually sends anything to the tracer. It merely use the existence of a trace process (and call trace flags) as an indication that call_time tracing is active for the process. If the tracer dies in a non-SMP run-time system, processes with call_time tracing would not notice that the tracer had died. Furthermore, if the set_on_spawn flag was active, the dead tracer could be propagaged to newly spawned processes. Before accumulating trace information in a non-SMP system, always validate the tracer process. (In an SMP system, a reference to a dead tracer will be cleared away each time a process is scheduled.) While we could put all of the new code beam_bp.c, we have chosen to make a function call from beam_bp.c to a function in erl_trace.c for clarity's sake and to ease further maintenance. In the future, we might want to handle tracing in more similar ways in the SMP and non-SMP system.
2014-03-19Merge branch 'cobusc/correct_comment'Henrik Nord
* cobusc/correct_comment: Fix comment that differs from code OTP-11793
2014-03-17erts: Handle literals in is_map/1Björn-Egil Dahlberg
2014-03-14erts: Add distribution capability flag for maps DFLAG_MAP_TAGSverker Eriksson
This is just a preparation to allow detection of older nodes that do not understand maps (R16 and older).
2014-03-14erts: Change external format for mapsSverker Eriksson
to be: 116,Arity, K1,V1,K2,V2,...,Kn,Vn instead of: 116,Arity, K1,K2,...,Kn, V1,V2,....,Vn We think this will be better for future internal map structures like HAMT. Would be bad if we need to iterate twice over HAMT in term_to_binary, one for keys and one for values.
2014-03-12Pass full strings to DTrace probesMichal Ptaszek
Whenever string is passed as an argument to a DTrace probe, its length should be properly computed. Until now in order to get length of the input buffer size_of(char *) was used - which evalutes to 4 or 8 (depending on the architecture). To get a proper length, size_of(DTRACE_CHARBUF_NAME(buffer_name)) should be used.
2014-03-10enable enif_send to work from a dirty schedulerSteve Vinoski
2014-03-09Add thread index to allocator enomem dump sloganRick Reed
2014-03-09Add run queue index to process dump infoRick Reed
2014-03-09Demote rare debug slogan of message discarding to debug buildRick Reed
2014-03-05Fix comment that differs from codeCobus Carstens
The comment in the code state that the tree is traversed to the left, when in fact it is traversed to the right.
2014-02-27erts: Fix Map cmp exact equal of an empty mapBjörn-Egil Dahlberg
The expression, #{} =:= M where M was any Map, would always result in 'true'. This commit fixes this issue by first comparing sizes for both terms and then checking for size zero.
2014-02-25Merge branch 'sverk/hipe-disable-gc-bug'Sverker Eriksson
* sverk/hipe-disable-gc-bug: erts: Fix heap overwrite by hipe "trap frames" when GC is disabled ASSERT that GC is not tried with "need" when GC is disabled
2014-02-25erts: Fix heap overwrite by hipe "trap frames" when GC is disabledSverker Eriksson
by trapping BIFs like term_to_binary and binary_to_term.
2014-02-24Merge branch 'lukas/erts/float_encoding/OTP-11738'Lukas Larsson
* lukas/erts/float_encoding/OTP-11738: erts: Set default external enc to use new float scheme
2014-02-24Merge branch 'lukas/ose/master/OTP-11334'Lukas Larsson
* lukas/ose/master/OTP-11334: (71 commits) erts: Fix unix efile assert ose: Use -O2 when building ose: Expand OSE docs ose: Add dummy ttsl driver ose: Cleanup cleanup of mutex selection defines ose: Polish mmap configure checks ose: Add ose specific x-compile flags ose: Updating fd_driver and spawn_driver for OSE ose: Updating event and signal API for OSE ose: Cleanup of mutex selection defines win32: Compile erl_log.exe ose: Remove uneccesary define ose: Fix ssl configure test for osx erts: Fix sys_msg_dispatcher assert ose: Fix broken doc links ose: Thread priorities configurable from lmconf ose: Yielding the cpu is done "the OSE" way ose: Start using ppdata for tse key ose: Do not use spinlocks on OSE ose: Fix support for crypto ... Conflicts: lib/crypto/c_src/crypto.c
2014-02-24ose: Updating event and signal API for OSEJonas Karlsson
2014-02-24erts: Fix sys_msg_dispatcher assertLukas Larsson
Schedulers is too restrictive. Managed threads should be able to clean this up.
2014-02-24ose: Thread priorities configurable from lmconfLukas Larsson
The pattern used for getting the priority from the lmconf is based on the name of the process created. The pattern is: ERTS_%%PROCESS_NAME%%_PRIO with the %%PROCESS_NAME%% replaced by the prefix of the process the priority applies to. eg: ERTS_SCHEDULER_PRIO=24 applies to processes with name SCHEDULER_1, SCHEDULER_2 etc.
2014-02-24ose: Cleanup POLL_SCHED_1 codeLukas Larsson
Now schedulers 2..N make sure to wake sched 1 if they find that all io has been consumed and sched 1 is sleeping. Before sched 1 was spinning in sys_schedule waiting for sched 2..N to finish consuming io jobs
2014-02-24ose: Add fair scheduling yieldsLukas Larsson
This is needed on OSs that do not do round robin scheduling of threads.
2014-02-24ose: Rewrite resolve_signal API for ose driversLukas Larsson
This new API has less impact on the check_io code and also removes the callback from ErlDrvEntry. The downside is that you have to give the resolve function when creating each event. Also the mode if the resolve was removed as this mimics the win32 code and decreases complexity.