aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
AgeCommit message (Collapse)Author
2019-02-15Merge branch 'raimo/erts/gen_tcp-listen-linger-slow/ERIERL-303/OTP-14728' ↵Raimo Niskanen
into maint * raimo/erts/gen_tcp-listen-linger-slow/ERIERL-303/OTP-14728: Check empty_out_q at close also for linger Conflicts: erts/preloaded/ebin/prim_inet.beam
2019-02-15Merge branch 'maint'Björn Gustavsson
* maint: Add persistent_term:get(Key, DefaultValue) Make dialyzer faster for left-associative andalso/orelse expressions
2019-02-14Add persistent_term:get(Key, DefaultValue)Björn Gustavsson
https://bugs.erlang.org/browse/ERL-843
2019-02-11Check empty_out_q at close also for lingerRaimo Niskanen
2019-02-04Merge branch 'bmk/20180918/nififying_inet/OTP-14831' into ↵Micael Karlberg
bmk/20190204/socket_as_nif/OTP-14831
2019-02-01[socket-nif] nosup expection of win32 and type(s) replacementsMicael Karlberg
The nif callback functions (nif_open) now instead cause an 'nosup' exception if called (instead of badarg). The basic type uint16_t, uint32_t and int32_t (C99) replaced "own" (that is, defined by "us") types Uint16, Uint32 and Sint32. The point of this is that our Windows build system seems to be a bit lacking when it comes to types... Removed "some stuff" that was if-defed. Different solution when win32 support for sockets has been improved. Make sure the socket_*.c util modules are not included in the building for windows. OTP-15526
2019-01-31Merge branch 'maint'Sverker Eriksson
2019-01-29[socket-nif] The otp rcvbuf option updatedMicael Karlberg
Its now possible to set a rcvbuf (otp) option value of {N :: pos_integer(), BufSz :: pos_integer()}. This value is used for type stream and protocol tcp, when calling the function recv with length = 0 (zero). The second value, BufSz, is the actual size of the receive buffer used when calling the socket recv function, and the first value, N, is the max number of possible reads that will be performed (at most), even if there is more data to read. This is limit the effect of DoS attacks. OTP-15497
2019-01-28erts: Add magic port control numbersSverker Eriksson
to increase the probablity of a nice badarg from erlang:port_control.
2019-01-22Merge pull request #2089 from richcarl/document-undefined-current_functionRickard Green
Document that current_function can be undefined OTP-15543
2019-01-21Merge branch 'maint'Siri Hansen
2019-01-21[socket-nif] Add support for otp option fdMicael Karlberg
Add a way to *get* the file descriptor (fd) of a socket. Useful mostly for debugging. OTP-15528
2019-01-16Update preloadedSiri Hansen
2019-01-16Use system_time instead of monotonic_time in log eventsSiri Hansen
Two modules were missed when this was changed before OTP-21.
2019-01-15Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/beam/bif.c erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/prim_file.beam
2019-01-14Document that current_function can be undefinedRichard Carlsson
If a process is executing in native-compiled code, process_info(Pid, current_function) may return the atom undefined instead of an MFA.
2019-01-10Update preloaded modulesLukas Larsson
2019-01-10erts: Add erlang:system_flag(system_logger,_)Lukas Larsson
This flag allows logger and other components to set the process which log messages from ERTS are to be sent.
2019-01-10Merge branch 'maint'John Högberg
* maint: Implement integer_to_list/2 and integer_to_binary/2 as CIFs Accept base in all integer-printing functions Document cleanup semantics for atomics and counters
2019-01-10Implement integer_to_list/2 and integer_to_binary/2 as CIFsStanislav Mayorov
This makes them roughly as fast as integer_to_list/1 and integer_to_binary/1.
2019-01-09Merge branch 'maint'John Högberg
* maint: Remove an unused variable Spawn prim_file helper as a system process
2019-01-09Merge branch 'john/erts/prim_file-init-restart/OTP-15495/ERL-821' into maintJohn Högberg
* john/erts/prim_file-init-restart/OTP-15495/ERL-821: Remove an unused variable Spawn prim_file helper as a system process
2019-01-07Spawn prim_file helper as a system processJohn Högberg
2018-12-20Merge branch 'maint'Lukas Larsson
Conflicts: erts/preloaded/ebin/atomics.beam erts/preloaded/ebin/counters.beam erts/preloaded/ebin/erl_prim_loader.beam erts/preloaded/ebin/erl_tracer.beam erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_code_purger.beam erts/preloaded/ebin/erts_dirty_process_signal_handler.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/erts_literal_area_collector.beam erts/preloaded/ebin/init.beam erts/preloaded/ebin/otp_ring0.beam erts/preloaded/ebin/persistent_term.beam erts/preloaded/ebin/prim_buffer.beam erts/preloaded/ebin/prim_eval.beam erts/preloaded/ebin/prim_file.beam erts/preloaded/ebin/prim_inet.beam erts/preloaded/ebin/prim_zip.beam erts/preloaded/ebin/zlib.beam
2018-12-20Update preloaded modulesLukas Larsson
2018-12-20Merge branch 'lukas/erts/fix-seq_trace-reset_trace/OTP-15490' into maintLukas Larsson
* lukas/erts/fix-seq_trace-reset_trace/OTP-15490: erts: Fix seq_trace:reset_trace dirty gc bug erts: Use sys_memcpy in copy_one_frag
2018-12-14[socket-nif] Message interface between socket.erl and nif updatedMicael Karlberg
Previously the "message interface" between the functions in socket.erl and the nif-code (socket_nif.c) was "ad hoc". This has now been changed so that we have a unified message {'$socket', SockRef | undefined, Tag, Info} This also has the added advantage of preparing the code for when we start using the new select-fucntions (with which its possible to specify your own message). This will be used in order to get around our eterm "leak" (we will use a simple counter, maintained in the nif, instead of the [Recv|Send|Acc]Ref we generate in the erlang code today. OTP-14831
2018-12-13erts: Fix seq_trace:reset_trace dirty gc bugLukas Larsson
When seq_trace:reset_trace could be called while a process was doing a dirty GC. This triggered a race where all signals was moved to the internal signal queue during the GC which in turn caused the a heap overrun problem. This fix makes it so that the main and msgq lock are taken before the clear. This will make sure that we are allowed to do the clear.
2018-12-11Merge branch 'maint'Henrik Nord
* maint: Updated OTP version Prepare release
2018-12-10Prepare releaseErlang/OTP
2018-12-03Update preloaded modulesHenrik Nord
2018-11-22Merge branch 'maint'Sverker Eriksson
2018-11-22Merge branch 'sverker/erts/atomics-counters/OTP-13468' into maintSverker Eriksson
AGAIN * sverker/erts/atomics-counters/OTP-13468: erts: Add counters:put/3
2018-11-21erts: Add counters:put/3Sverker Eriksson
2018-11-16Merge branch 'maint'John Högberg
* maint: Fix broken assertion on monitor release Avoid closing files in gc/monitor callbacks
2018-11-16Merge branch 'john/erts/defer-orphan-file-close/OTP-15421/ERIERL-261' into maintJohn Högberg
* john/erts/defer-orphan-file-close/OTP-15421/ERIERL-261: Fix broken assertion on monitor release Avoid closing files in gc/monitor callbacks
2018-11-15Merge branch 'maint'Sverker Eriksson
2018-11-15erts: Add new module 'counters'Sverker Eriksson
2018-11-15erts: Add new module 'atomics'Sverker Eriksson
2018-11-13Avoid closing files in gc/monitor callbacksJohn Högberg
Closing files in these callbacks could block scheduler progress and cause major system instability. We now defer these operations to a dedicated process instead. This process may in turn block forever and prevent further orphaned files from being closed, but it will keep the emulator itself from misbehaving.
2018-11-06[socket-nif|test] Add UDP ping-pong test casesMicael Karlberg
Added ping-pong test cases for UDP, small and medium, using the sendto/recvfrom and sendmsg/recvmsg functions. OTP-14831
2018-11-06Merge branch 'maint'Björn Gustavsson
* maint: Implement a tab for persistent terms in crashdump viewer Add tests of persistent terms for crashdump_viewer Add a persistent term storage Refactor releasing of literals Extend the sharing-preserving routines to optionally copy literals Conflicts: erts/emulator/Makefile.in erts/emulator/beam/erl_process_dump.c erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/init.beam lib/sasl/src/systools_make.erl
2018-11-06Add a persistent term storageBjörn Gustavsson
Persistent terms are useful for storing Erlang terms that are never or infrequently updated. They have the following advantages: * Constant time access. A persistent term is not copied when it is looked up. The constant factor is lower than for ETS, and no locks are taken when looking up a term. * Persistent terms are not copied in garbage collections. * There is only ever one copy of a persistent term (until it is deleted). That makes them useful for storing configuration data that needs to be easily accessible by all processes. Persistent terms have the following drawbacks: * Updates are expensive. The hash table holding the keys for the persistent terms are updated whenever a persistent term is added, updated or deleted. * Updating or deleting a persistent term triggers a "global GC", which will schedule a heap scan of all processes to search the heap of all processes for the deleted term. If a process still holds a reference to the deleted term, the process will be garbage collected and the term copied to the heap of the process. This global GC can make the system less responsive for some time. Three BIFs (implemented in C in the emulator) is the entire interface to the persistent term functionality: * put(Key, Value) to store a persistent term. * get(Key) to look up a persistent term. * erase(Key) to delete a persistent term. There are also two additional BIFs to obtain information about persistent terms: * info() to return a map with information about persistent terms. * get() to return a list of a {Key,Value} tuples for all persistent terms. (The values are not copied.)
2018-11-05[socket-nif] Add "partial success" to sendmsgMicael Karlberg
The sendmsg function attempts to send *one message*. But its possible for the underlying software to fail to send the *entire* message. So, instead of retrying itself, as send does, the sendmsg function will now instead return with {ok, Remaining}, leaving it to the caller to decide what to do. OTP-14831
2018-10-30[socket-nif] Add a send and receive chunks test caseMicael Karlberg
The send and recv test case triggered a two bugs. One was that there was no re-selecting when only a portion of the data was received (which meant that we stopped reading). Also, the wrong 'current' (writer) was reset when demonitor current reader after a successful read (which meant that future readers would never have been monitored). OTP-14831
2018-10-22Merge branch 'maint'Raimo Niskanen
Conflicts: erts/preloaded/ebin/prim_inet.beam
2018-10-22Merge branch 'raimo/tcp-close-while-send/maint/ERL-561/OTP-12242' into maintRaimo Niskanen
* raimo/tcp-close-while-send/maint/ERL-561/OTP-12242: Write test case Fix hanging gen_tcp send vs close race Conflicts: erts/preloaded/ebin/prim_inet.beam
2018-10-19Fix hanging gen_tcp send vs close raceRaimo Niskanen
While a gen_tcp send was in progress with filled buffers and slow receiver a close (from another process) would place the port in a half dead state so the port could not signal back to send, that waited for confirmation. The solution is to after some time (5 s) of waiting for send confirmation set a monitor on the port, which detects if the port becomes half dead due to close from another process. The close pending loop has also been improved to use the linger timeout for waiting, and to set a system timeout (arbitrarily selected 3 min) to not wait forever when the other end reads data s l o w l y (tarpitting, kind of).
2018-10-17Merge branch 'maint'John Högberg
* maint: "cork" tcp socket around file:sendfile Add nopush TCP socket option
2018-10-17Merge branch 'igor/tcp-nopush-ERL-698/OTP-15357' into maintJohn Högberg
* igor/tcp-nopush-ERL-698/OTP-15357: "cork" tcp socket around file:sendfile Add nopush TCP socket option