aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
AgeCommit message (Collapse)Author
2010-09-03inet: support retrieving MAC address on BSDMichael Santos
On systems supporting getaddrinfo(), support looking up the MAC address from inet:ifget/2. The results have the same quirks as with Linux: if the MAC address is longer than 6 bytes (e.g., fw0 under Mac OS X), the address is truncated; if the interface does not have a MAC address (e.g., lo0), an address consisting of 0's is returned.
2010-07-26inet: fix getservbyname buffer overflowMichael Santos
The byte holding the length of the interface name for the getservbyname/2 function is used in a signed context and can become negative, causing the buffer to be overrun. Make the same change for getservbyport/2. Test case: inet:getservbyname(list_to_atom(lists:flatten(lists:duplicate(128, "x"))), tcp).
2010-07-26inet: fix ifr_name buffer overflowMichael Santos
The byte holding the length of the interface name for the ifget/2 functions is used in a signed context and can become negative, causing the ifreq.ifr_name buffer to be overrun. Test case: inet:ifget(lists:duplicate(128, "x"), [addr]).
2010-07-26inet: null terminate ifr_name bufferMichael Santos
The buffer holding the interface name should be null terminated. See man 7 socket on Linux or the definition of IFNAMSIZ in net/if.h on FreeBSD: Length of interface external name, including terminating '\0'.
2010-07-22Mending halfword heap emulatorSverker Eriksson
2010-07-20Merge branch 'sverker/one_offheap_list/OTP-8737' into devSverker Eriksson
* sverker/one_offheap_list/OTP-8737: One off-heap list, to eliminate two words per ETS object.
2010-07-20One off-heap list, to eliminate two words per ETS object.Sverker Eriksson
Merging the three off-heap lists (binaries, funs and externals) into one list. This reduces memory consumption by two words (pointers) per ETS object.
2010-07-20Merge branch 'sverker/ets_select_hang/OTP-8732' into devSverker Eriksson
* sverker/ets_select_hang/OTP-8732: Fix ets:select hanging on ordered_set with empty list as key.
2010-07-08Merge branch 'sverker/full_INTEGER_EXT/OTP-8540' into devSverker Eriksson
* sverker/full_INTEGER_EXT/OTP-8540: term_to_binary use all 32 bits of INTEGER_EXT
2010-07-08Merge branch 'sverker/driver_int64_bug/OTP-8716' into devSverker Eriksson
* sverker/driver_int64_bug/OTP-8716: Fix bug that caused faulty 64-bit integers from drivers.
2010-07-08nif_SUITE send3 stress testSverker Eriksson
2010-07-07Fix ets:select hanging on ordered_set with empty list as key.Sverker Eriksson
erl_db_tree.c incorrectly used NIL (empty list) as "lastkey" to mark start of the iteration. A real NIL key could then cause a select or match iteration to be restarted over and over again if the last key before a trap happended to be NIL. Changed NIL to THE_NON_VALUE. Should be ok as the initial key value can never be put into any continuation tuple.
2010-07-07Merge branch 'rani/sctp-udp-recv-error' into devRaimo Niskanen
* rani/sctp-udp-recv-error: Fix inet_drv to detect passive mode UDP errors for SCTP builds
2010-07-07Fix inet_drv to detect passive mode UDP errors for SCTP buildsRaimo Niskanen
Debug and patch by Per Hedeland for R13B04 on erlang-patches: Connected UDP (and handling of any other errors in UDP recv()) is broken in passive mode for all SCTP-enabled builds.
2010-07-07Merge branch 'se/http_response_empty_phrase' into devRaimo Niskanen
* se/http_response_empty_phrase: {packet,http} allow empty response phrase
2010-07-05term_to_binary use all 32 bits of INTEGER_EXTSverker Eriksson
Earlier, external format INTEGER_EXT was only produced for 28-bit signed integers. Now full 32-bit signed integers are produced as INTEGER_EXT to avoid the more costly SMALL_BIG_EXT format. Both old and new code can read 32-bit INTEGER_EXT. Also fixed integer encoding bugs in erl_interface erl_encode/erl_decode. (Thanks to Alexander Demidenko for reporting)
2010-06-30Fix bug that caused faulty 64-bit integers from drivers.Sverker Eriksson
2010-06-14OTP-8710 Fix emulator crash caused by setting CPU topologyRickard Green
A user defined CPU topology set via a call to <seealso marker="erlang#system_flag_cpu_topology">erlang:system_flag(cpu_topology, CPUTopology)</seealso> was not properly verified, and could in worst case cause an emulator crash. The emulator crash could only occur when a user defined CPU topology already existed and was redefined.
2010-06-11Merge branch 'se/port_SUITE_env' into devErlang/OTP
* se/port_SUITE_env: fix open_port with many unset env vars allow open_port with env vars with trailing '=' on Windows OTP-8701 se/port_SUITE_env open_port/2 with the spawn and spawn_executable options can include an {env,Env} option. In some cases unsetting variables would not work on Unix (typically if more variables were unset than were actually present in the environment).
2010-06-10{packet,http} allow empty response phraseSverker Eriksson
Packet type 'http' for erlang:deocode:packet and gen_tcp allow a response line with an empty phrase string, like "HTTP/1.1 200\r\n". Earlier, an empty phrase was only accepted if the status code was followed by space or tab, like "HTTP/1.1 200 \r\n".
2010-06-10fix open_port with many unset env varsSverker Eriksson
The erlang:open_port spawn and spawn_executable directives can include an {env, Env} directive to set up environment variables for the spawned process. Variables can be unset with {"NameOfVariable",false}. A bug in ert/emulator/sys/unix/sys.c could cause unset variables to not be unset. This would typically happen if there where more variables to be unset than there where already set variables in the destination evironment. Fix this problem for unix and add a new regression test for it to the port test suite. Windows does not seem to have the same problem.
2010-06-10allow open_port with env vars with trailing '=' on WindowsSverker Eriksson
Same problem that Steve Vinoski fixed for Unix. Similar fix done in erts/emulator/sys/win32/sys_env.c for Windows. Copy-paste from his commit-message: The erlang:open_port spawn and spawn_executable directives can include an {env, Env} directive to set up environment variables for the spawned process. A bug in ert/emulator/sys/unix/sys.c prevented applications from using {env, Env} to set an environment variable whose value ended with a '=' (equal sign) character; the code mistook the trailing equal sign as an indication that an environment variable was to be cleared from the environment of the spawned process. For example, passing an {env, Env} of {env, [{"foo", "bar="}]} would result in the code in sys.c seeing a string of the form "foo=bar=" The code would see the final '=' character and assume the directive wanted to clear a variable named "foo=bar" from the environment of the spawned process, rather than seeing it as a directive to set the environment variable "foo" to the value "bar=".
2010-06-08Merge branch 'bg/bif-types' into devErlang/OTP
* bg/bif-types: Add type information for erlang:garbage_collect_message_area/0 Add type information for erts_debug:* BIFs Add type information for erlang:port_call/2 Add type information for erlang:display* BIFs Add type information for the BIFs in the binary module Introduce and use the t_endian() helper Add type information for erlang:binary_part/2,3 Add type info for erlang:append/2 and erlang:subtract/2 Add type information for the erlang:adler32* BIFs Add ppc64 return for erlang:system_info(hipe_architecture) Test that all BIFs have known types erl_types: Export is_erl_type/1
2010-06-08Merge branch 'bg/nif_error' into devErlang/OTP
* commit 'bg/nif_error': crypto: Add type specs for all documented functions crypto: Use erlang:nif_error/1 to squelch false Dialyzer warnings Add erlang:nif_error/1,2
2010-06-08Merge branch 'pg/fix_erts_bld_string_n' into devErlang/OTP
* pg/fix_erts_bld_string_n: Fix erts_bld_string_n (called by enif_make_string and erlang:decode_packet/3) to work with 8 bits characters OTP-8685 pg/fix_erts_bld_string_n Fix bug causing erlang:decode_packet and enif_make_string to generate faulty strings with negative character values for ascii values larger than 127. (Thanks to Paul Guyot)
2010-06-07Test that all BIFs have known typesBjörn Gustavsson
Add a test that will verify that BIFs have type information in hiper/cerl/erl_bif_types.erl.
2010-06-07Merge branch 'ms/file-exclusive-mode' into devErlang/OTP
* ms/file-exclusive-mode: Update preloaded modules Support opening files in exclusive mode OTP-8670 ms/file-exclusive-mode There is a new option 'exclusive' to file:open/2 that uses the OS O_EXCL flag where supported to open the file in exclusive mode.
2010-06-07Fix erts_bld_string_n (called by enif_make_string and ↵Paul Guyot
erlang:decode_packet/3) to work with 8 bits characters
2010-06-07Merge OTP-8681Björn-Egil Dahlberg
2010-06-04Merge branch 'egil/call-time-trace-patterns' into devErlang/OTP
* egil/call-time-trace-patterns: Fix ops.tab to include i_return_time_trace Let trace_call_time_SUITE scheduling test be more relaxed Add documentation for call time breakpoints Fix bp_hash_put to do hash value after rehash Extend trace_call_time_SUITE with bif-tests Fix assertion in trace_pattern for bifs Teach erlang:system_info/1 to list snifs Add bif tests to call time trace tests Teach call time trace patterns to include bifs Fix BeamInstr code array in export.h Add trace call_time tests for nifs and bifs Teach call count tracing to use atomics Add first phase of trace call time test suite Add a scheduler array for BpData at BeamInstr[-4] Add search keys in breakpoints and a searchfunction Fix BeamInstr for call_time Teach call_time trace to use intruction pointers Add return_time trace and PSD deletions Remove trailing character in beam_bif_load Fix set_function_break to use correct breakpoint ... OTP-8677 egil/call-time-trace-patterns
2010-06-04Support opening files in exclusive modeMichael Santos
Add an option that atomically tests for the existence of a file and creates it if the file does not exist, by passing the O_EXCL flag to open() on Unix and CREATE_NEW flag on Windows. Support for O_EXCL varies across platforms and filesystems. {ok, Fd} = file:open("/tmp/foo", [write,exclusive]), {error, eexist} = file:open("/tmp/foo", [write,exclusive]).
2010-06-04Fix scheduler_suspend test when schedulers online isn't equal to the amount ↵Rickard Green
of schedulers
2010-06-03Fix ops.tab to include i_return_time_traceBjörn-Egil Dahlberg
Without the instruction defined in ops the interpreter will not compile when using NO_JUMPTABLE.
2010-06-03Let trace_call_time_SUITE scheduling test be more relaxedBjörn-Egil Dahlberg
2010-06-03Fix bp_hash_put to do hash value after rehashBjörn-Egil Dahlberg
If a rehash was done the old hash value was used. This was incorrect.
2010-06-03Extend trace_call_time_SUITE with bif-testsBjörn-Egil Dahlberg
2010-06-03Fix assertion in trace_pattern for bifsBjörn-Egil Dahlberg
2010-06-03Teach erlang:system_info/1 to list snifsBjörn-Egil Dahlberg
erlang:system_info(snifs) lists all static native implemented functions. The function presents the lists with three tuple values containing MFAs [{Module, Function, Arity}, ...].
2010-06-03Add bif tests to call time trace testsBjörn-Egil Dahlberg
2010-06-03Teach call time trace patterns to include bifsBjörn-Egil Dahlberg
2010-06-03Fix BeamInstr code array in export.hBjörn-Egil Dahlberg
2010-06-03Add trace call_time tests for nifs and bifsBjörn-Egil Dahlberg
2010-06-03Teach call count tracing to use atomicsBjörn-Egil Dahlberg
Call count previously used a global lock for accessing and writing its counter in the breakpoint. This is now changed to atomics instead. The change will let call count tracing and cprof to scale better when increasing the number of schedulers.
2010-06-03Add first phase of trace call time test suiteBjörn-Egil Dahlberg
2010-06-03Add a scheduler array for BpData at BeamInstr[-4]Björn-Egil Dahlberg
To solve the issue of multiple schedulers constantly updating the head pointer to the bp data wheel, each scheduler now has its own entrypoint to the wheel. This head pointer can be updated without a locking being taken. Previously there were no lock ...
2010-06-03Add search keys in breakpoints and a searchfunctionBjörn-Egil Dahlberg
2010-06-03Fix BeamInstr for call_timeBjörn-Egil Dahlberg
2010-06-03Teach call_time trace to use intruction pointersBjörn-Egil Dahlberg
call_time trace will use instruction pointers instead of breakpoint data pointers. More costly lookup but the bdt structure might be deallocated, we do not want that. Remove unnecessary pattern lock.
2010-06-03Add return_time trace and PSD deletionsBjörn-Egil Dahlberg
2010-06-03Remove trailing character in beam_bif_loadBjörn-Egil Dahlberg