aboutsummaryrefslogtreecommitdiffstats
path: root/erts
AgeCommit message (Collapse)Author
2011-07-07Fix a match-spec trace bug that could cause emulator crashSverker Eriksson
A trace matchspec with 'enable_trace' or 'disable_trace' in body could cause an emulator crash if a concurrent process altered the trace setting of the traced function by calling erlang:trace_pattern. The effect was a deallocation of the binary holding the matchspec program while it was running. Fixed by increasing reference count of ms-binary in the cases when 'enable_trace' or 'disable_trace' may cause a system block that may alter the ongoing trace. The paradox here is that db_prog_match() is using erts_smp_block_system() to do 'enable_trace' and 'disable_trace' in a safe (atomic) way. But that also have the (non-atomic) effect that racing thread might block the system and change the trace settings with erlang:trace_pattern.
2011-07-07Fix bug in ets:delete for write_concurrency that could lead to deadlockSverker Eriksson
Relocking in ets_delete_1() and remove_named_tab() was done by unlocking the table without clearing the is_thread_safe flag. A racing thread could then read-lock the table and then incorrectly write-unlock the table as db_unlock() looked at is_thread_safe to determine which kind of lock to unlock. Several fixes: 1. Make db_unlock() use argument 'kind' instead of is_thread_safe to determine lock type. 2. Make relock logic use db_lock() and db_unlock() instead of directly accessing lock primitives. 3. Do ownership transfer earlier in ets_delete_1 to avoid racing owner process to also start deleting the same table.
2011-07-06Update preloaded modulesBjörn Gustavsson
2011-07-06Remove deprecated concat_binary/1Björn Gustavsson
concat_binary/1 was deprecated in R13B04, but already in the R10B-2 release, the documentation recommends using list_to_binary/1 instead.
2011-07-01Add version commentLukas Larsson
2011-07-01Rename enif_get_reverse_list to enif_make_reverse_listLukas Larsson
2011-06-30Fix halfword bug in enif_make_int64Sverker Eriksson
The bug was creating an invalid bignum instead of a small integer, causing strange comparing behavior (=:= failed but == succeeded).
2011-06-30Remove extra allocated heap fragmentLukas Larsson
2011-06-30Added enif_get_reverse_list to nif APILukas Larsson
2011-06-22Merge branch 'dev' into majorHenrik Nord
2011-06-22Merge branch 'hw/fix-doc-typos' into devHenrik Nord
* hw/fix-doc-typos: Fix typos in the epmd documentation OTP-9387
2011-06-21Update preloaded modulesPatrik Nyblom
2011-06-21Merge branch 'dev' into majorPatrik Nyblom
2011-06-20Add more specs and typesHans Bolinder
An incorrect spec, rpc:yield/1, has been fixed.
2011-06-20Merge branch 'dev' into majorSiri Hansen
2011-06-15Merge branch 'siri/sasl/release_handler-windows/OTP-9306' into devSiri Hansen
* siri/sasl/release_handler-windows/OTP-9306: Make release_handler work with windows services
2011-06-15Make release_handler work with windows servicesSiri Hansen
This commit adds test cases from release_handler_SUITE on windows, including some corrections in erlsrv and release_handler.
2011-06-14Use new atomic API in runtime systemRickard Green
All uses of the old deprecated atomic API in the runtime system have been replaced with the use of the new atomic API. In a lot of places this change imply a relaxation of memory barriers used.
2011-06-14Improve ethread atomicsRickard Green
The ethread atomics API now also provide double word size atomics. Double word size atomics are implemented using native atomic instructions on x86 (when the cmpxchg8b instruction is available) and on x86_64 (when the cmpxchg16b instruction is available). On other hardware where 32-bit atomics or word size atomics are available, an optimized fallback is used; otherwise, a spinlock, or a mutex based fallback is used. The ethread library now performs runtime tests for presence of hardware features, such as for example SSE2 instructions, instead of requiring this to be determined at compile time. There are now functions implementing each atomic operation with the following implied memory barrier semantics: none, read, write, acquire, release, and full. Some of the operation-barrier combinations aren't especially useful. But instead of filtering useful ones out, and potentially miss a useful one, we implement them all. A much smaller set of functionality for native atomics are required to be implemented than before. More or less only cmpxchg and a membar macro are required to be implemented for each atomic size. Other functions will automatically be constructed from these. It is, of course, often wise to implement more that this if possible from a performance perspective.
2011-06-08Update preloaded prim_file.beamBjörn-Egil Dahlberg
2011-06-08Fix boundry error where files might get lostBjörn-Egil Dahlberg
2011-06-08Teach prim_file:list_dir/1,2 to use fname chunksBjörn-Egil Dahlberg
The efile driver will now use chunked data on list_dir. This will lessen the number of sends to prim_file and hence improve performance. This method is utilized in both direct and async cases.
2011-06-08Merge branch 'dev' into majorRaimo Niskanen
2011-06-08Update preloaded moduleRaimo Niskanen
2011-06-08Replace atom in DRV macro in prim_file with stringStavros Aronis
An experimental version of Dialyzer discovered that the atom that replaced the DRV macro in prim_file ends up in calls to erlang:open_port({spawn, Driver}, Portopts) as the Driver argument. The documentation states that this call requires a string there. This change is also consistent with the one introduced in commit 0f03b1e9d2bef3bc830c31a369261af4c5234727 by Kostis Sagonas.
2011-06-07Update version numbers for R15A developmentBjörn-Egil Dahlberg
2011-06-01Fix typos in the epmd documentationHolger Weiß
2011-05-30Update version numbersBjörn-Egil Dahlberg
2011-05-24Fix use of logical operator && with constant operand instead of bitwise &.Cristian Greco
2011-05-24inet: error if fd does not match socket domainMichael Santos
If an IPv4 fd is opened as an IPv6 socket, unexpected behaviour can occur. For example, if an IPv4 UDP socket is opened and passed into Erlang as an IPv6 socket, the first 3 bytes (corresponding to 1 byte representing the protocol family, 2 bytes set to the port) are stripped from the payload. The cause of the UDP payload truncation happens in inet_drv.c:packet_inet_input when a call to inet_get_address fails silently because the family is set to PF_INET6 but the buffer len is the size of an IPv4 struct sockaddr_in. Prevent this behaviour by checking that the protocol family of the file descriptor matches the family of the requested Erlang socket. {ok, S1} = gen_udp:open(0, [binary, inet]), {ok, FD} = inet:getfd(S1), {ok, Port} = inet:port(S1), {ok, S} = gen_udp:open(Port, [binary, {fd, FD}, inet6]), {ok, C} = gen_udp:open(0, [binary]), Msg = <<1,2,3,4,5>>, gen_udp:send(C, "127.0.0.1", Port, Msg), receive {udp, S, _, _, Msg} -> ok; {udp, S, _, _, NewMsg} -> {error, Msg, NewMsg} end. This test results in: {error,<<1,2,3,4,5>>,<<4,5>>} Thanks to Andrew Tunnell-Jones for finding the bug and the test case!
2011-05-24Prepare releaseOTP_R14B03Erlang/OTP
2011-05-21Fix bug in FreeBSD topology detection codePaul Guyot
2011-05-21Fix bug related to hibernate and HiPE (clear F_HIBERNATE_SCHED flag)Paul Guyot
F_HIBERNATE_SCHED flag that was introduced in b7ecdcd1ae9e11b8f75e must be cleared in hipe_mode_switch as well. Otherwise, processes running HiPE code that hibernate, wake up and then trap into a BIF will not be rescheduled.
2011-05-20Update copyright yearsBjörn-Egil Dahlberg
2011-05-20Update preloaded modulesBjörn-Egil Dahlberg
2011-05-20Merge branch 'rickard/driver_async_cancel/OTP-9302' into devRickard Green
* rickard/driver_async_cancel/OTP-9302: Fix testcase
2011-05-20Fix testcaseRickard Green
2011-05-19Merge branch 'pan/epmd_testcase/OTP-9214' into devPatrik Nyblom
* pan/epmd_testcase/OTP-9214: Make ssh proxy work with older versions of ssh Mend epmd testcases that test remote access
2011-05-19Merge branch 'rickard/driver_async_cancel/OTP-9302' into devRikard Green
* rickard/driver_async_cancel/OTP-9302: Fix driver_async_cancel()
2011-05-18Merge branch 'egil/remove-compile-warnings' into devBjörn-Egil Dahlberg
* egil/remove-compile-warnings: Remove unused variable warning in inet_res Remove unused variable in epmd_port Remove compiler warnings in inet_drv
2011-05-18Make ssh proxy work with older versions of sshPatrik Nyblom
2011-05-18Merge branch 'pan/win_static_openssl/OTP-9280' into devPatrik Nyblom
* pan/win_static_openssl/OTP-9280: Mend --with-ssl= in erts/configure Update OpenSSL license text in crypto Link OpenSSL libraries static on Windows
2011-05-18Fix driver_async_cancel()Rickard Green
2011-05-17Remove compiler warnings in inet_drvBjörn-Egil Dahlberg
2011-05-16OTP-9094: [httpc] Add support for upload body streaming (PUT and POST).Micael Karlberg
Filipe David Manana OTP-9114: [ftp] Added (type) spec for all exported functions. OTP-9123: mod_esi:deliver/2 made to accept binary data. Bernard Duggan OTP-9124: [httpd] Prevent XSS in error pages. Michael Santos OTP-9131: [httpd] Wrong security property names used in documentation. Garrett Smith OTP-9157: [httpd] Improved error messages. Ricardo Catalinas Jim�nez OTP-9158: [httpd] Fix timeout message generated by mod_esi. Bernard Duggan OTP-9202: [httpd] Extended support for file descriptors. Attila Rajmund Nohl OTP-9230: The default ssl kind has now been changed to essl. OTP-9246: [httpc] httpc manager crash because of a handler retry race condition. Merge branch 'bmk/inets/inet56_integration' into dev
2011-05-13Merge branch 'sverker/hipe-misc-fixing/OTP-9298' into devBjörn-Egil Dahlberg
* sverker/hipe-misc-fixing/OTP-9298: hipe_mkliterals print argv[0] in generated files Fix code:is_module_native segv on deleted module lock checking fix in hipe_bif2.c
2011-05-13Merge branch 'rickard/barriers/OTP-9281' into devRickard Green
* rickard/barriers/OTP-9281: Silence warnings Fix build with hipe on amd64 Reduce number of atomic ops Use 32-bit atomic for port snapshot Remove pointless erts_ports_alive variable Ensure quick break Ensure that all rehashing information are seen when done Ensure that stack updates are seen when stack is released Add needed barriers for write_concurrency tables Homogenize memory barriers on atomics
2011-05-13Silence warningsRickard Green
2011-05-13Fix build with hipe on amd64Rickard Green
2011-05-13Reduce number of atomic opsRickard Green
Counters for active, and used schedulers have been coalesced in order to reduce the amount of atomic operations needed. Some currently not strictly necessary barriers have also been added in order to be future proof.