Age | Commit message (Collapse) | Author |
|
* pan/unregister_error:
Add possibly missing process lock before unregistering oneself
Keep process lock over trace of unregister
OTP-8663 Unregister may crash VM
Extreme combinations of register/unregister in a highly parallell SMP
application could crash the VM. The error is corrected.
|
|
* pan/otp_8086_ms_grammar:
Add match_specification grammar documentation specifically for ets
OTP-8086 Grammar for match specification describes tracing only
The grammar for match specifications in ERTS users guide only described the
tracing dialect of match specifications. An informal grammar for the ETS
dialect is added.
|
|
* jv/autoimport-binary_to_term_2:
Change binary_to_term/2 to be auto-imported
OTP-8671 jv/autoimport-binary_to_term_2
Now, binary_to_term/2 is auto-imported. This will cause a compile warning
if and only if a module has got a local function with that name.
|
|
See dwShareMode on
http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx
|
|
|
|
ethr_rwmutex_tryrlock() acquired and refused to acquire a lock with
inverted logic. The lock was however never acquired in a thread unsafe
manner. (Thanks to JR Zhang for noting this issue)
|
|
Writer preferred pthread read/write locks has been enabled on Linux.
|
|
The number of spinlocks used when implementing atomic fall-backs when no
native atomic implementation is available has been increased from 16 to
1024.
|
|
Port locks could be prematurely destroyed.
|
|
Support for using gcc's built-in functions for atomic memory access has
been added. This functionallity will be used if available and no other
native atomic implementation in ERTS is available.
|
|
Missing memory barriers in erts_poll() could cause the runtime system to
hang indefinitely.
|
|
This BIF was only used by the now broken SAE support.
|
|
The experimental Standalone Erlang (SAE) support based on
Joe Armstrong's work has long been broken. Remove the remaining
code and Makefile rules.
|
|
|
|
|
|
* sv/socket-error-portability:
inet_drv.c: Remove red herring
use macro to portably test for socket system call errors
OTP-8654 sv/socket-error-portability
On some combination of Montavista Linux on Cavium Octeon processors, some
socket-related system calls returned other numbers than -1 for errors. This
caused a core dump in inet_drv.c. Now the code works around this problem.
|
|
* se/spawn_drv_win_deadlock:
Fix deadlock in spawn driver on windows
OTP-8641 se/spawn_drv_win_deadlock
Windows: Closing port of program that stalled without reading all data
could deadlock scheduler thread.
|
|
* ta/extend-nif-api:
erl_nif: add make_atom_len, make_existing_atom_len and make_string_len
erl_nif: add enif_get_atom_length and enif_get_list_length
erl_nif: add enif_is_list and enif_is_tuple
OTP-8640 ta/extend-nif-api
New NIF API functions: enif_make_atom_len, enif_make_existing_atom_len,
enif_make_string_len, enif_get_atom_length, enif_get_list_length,
enif_is_list, enif_is_tuple (by Tuncer Ayaz)
|
|
Remove redundant "!defined(__WIN32__)". It is used inside
the #else branch of a "#ifdef __WIN32__", so it serves no
useful purpose except to fool unsuspecting readers.
|
|
On some combinations of Montavista Linux running on Cavium Octeon
chips, some socket-related system calls erroneously return negative
numbers other than -1 to indicate errors, but inet_drv.c specifically
compares against -1 to test for errors. The result is that beam dumps
core due to the code treating these negative numbers as success
indicators, as counts/offsets of bytes written, etc. thereby
corrupting its own internal data structures.
To fix this, introduce a portability macro to test the result of
socket system calls. The test remains unchanged on Windows but for
other platforms the macro considers all return values that are less
than zero to be errors.
Though POSIX specifies that errors from these system calls are
indicated by a return value of -1, treating all negative return values
as errors is also safe, as described in detail below. In networking
programming, treating all negative return values from system calls as
errors is very common practice -- see the examples in W. Richard
Stevens's popular and highly lauded network programming books, for
example.
For system calls that return 0 to indicate success, treating all
negative numbers as errors is safe because only 0 is specified to
indicate success. These include:
getsockname
getpeername
getsockopt
gethostname
bind
listen
connect
close
shutdown
Likewise, for system calls that return non-negative numbers to
indicate success, treating all negative numbers as errors is also
safe. These functions typically return signed integers of type
ssize_t, and they treat any parameters of type size_t that cannot fit
within the ssize_t return value, such as numbers of bytes to read or
write, as errors (specifically EINVAL). For example, in the "ERRORS"
section of the man page for writev from several varieties of Linux, it
states that EINVAL is returned when the total length of the I/O is
more than can be expressed by the ssize_t return value.
These calls include:
recv
recvfrom
recvmsg
writev
send
sendto
sendmsg
Finaly, the socket() system call is also similar to these in that it
returns a signed type (int) with all non-negative return values
indicating success, so treating all negative return values as errors
is safe.
|
|
* fm/file-operations:
Update preloaded modules
Add file:advise/4 - a wrapper to the POSIX syscall posix_fadvise
Add file:datasync/1 for syncing file contents only
sys.h: Correct the get_int64() macro
OTP-8637 fm/file-operations
The functions file:advise/4 and file:datasync/1 have been added. (Thanks to
Filipe David Manana.)
|
|
A misbehaving port program that does not read all data written to the port
may deadlock the scheduler thread when it calls port_close. The chosen solution
was to use the new function CancelIoEx if it exist (Vista) otherwise let the
spawn driver wait for a short while (10ms) and then to spawn a thread that will
wait for the port program to exit.
|
|
Add new NIF API functions
- enif_make_atom_len
- enif_make_existing_atom_len
- enif_make_string_len
These are basically the same as enif_make_atom,
enif_make_existing_atom and enif_make_string except that the
new functions require a length parameter instead of a
null-terminated C-string.
Signed-off-by: Tuncer Ayaz <[email protected]>
|
|
Add new NIF API functions
- enif_get_atom_length
- enif_get_list_length
Signed-off-by: Tuncer Ayaz <[email protected]>
|
|
Add new NIF API functions
- enif_is_list
- enif_is_tuple
Signed-off-by: Tuncer Ayaz <[email protected]>
|
|
While binary_to_term/2 was added in R13B04, it wasn't auto-imported. This
conformed to longstanding policy of not changing auto-imports between major
versions. This patch contains changes to auto-import binary_to_term/2 to
coincide with the release of R14.
|
|
* bg/compiler-cover-and-clean:
v3_life: Remove clause that cannot match in match_fail/3
v3_life tests: Cover exception handling code in v3_life:function/1
beam_type: Remove redundant clause
v3_core tests: Cover make_bool_switch_guard/5
v3_core tests: Cover handling of pattern aliases
v3_core: Remove a clause in is_simple/1 that cannot match
v3_core: Remove unused support for generating compilation errors
Remove stray support for the put_literal/2 instruction
Remove stray support for the bs_bits_to_bytes2/2 instruction
Remove the bs_bits_to_bytes/3 instruction
Cover handling of 'math' BIFs
beam_bool: Remove a clause in live_regs/1 that cannot match
beam_bool: Cover handling of bs_context_to_binary in initialized_regs/2
beam_bool: Remove a clause in initialized_regs/2 that cannot match
beam_block: Remove a clause that will never be executed
erts: Stop supporting non-literal empty tuples
compile: Remove code that is only executed on Solaris
Do not cover-analyze core_scan
core_SUITE_data: Don't ignore *.core files in this directory
OTP-8636 bg/compiler-cover-and-clean
|
|
Signed-off-by: Tuncer Ayaz <[email protected]>
|
|
|
|
Useful for informing the Operating System about the access pattern
for a file's data, so that it can adapt the caching strategy to
maximize disk IO performance.
|
|
file:datasync/1 invokes the POSIX system call "int fdatasync(int fd)".
This system call is similar to "fsync" but, unlike fsync, it does not
update the metadata associated with the file (like the access time for
example). It's used by many DBMSs (MySQL and SQLite of example) to
increase disk IO performance, as it avoids disk seeks and disk write
operations compared to fsync.
More details on it at:
http://linux.die.net/man/2/fdatasync
An example, from the MySQL source:
http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1-telco-6.1/annotate/head%3A/mysys/my_sync.c#L61
This new function just calls fsync on systems not implementing fdatasync.
|
|
The get_int64() macro has never been used (it was probably added
for completeness at the same time that put_int64() was added),
but it was not actually used and therefore it does not actually
work.
|
|
put_literal/2 was an experimental instruction added in R11 to
support literals, but before the R12 release support for literals
was implemented for all instruction, making the put_literal/2
instruction redundant. Although the beam_disasm module supports
dissambley of instructions in older releases, there is
no reason to have it support experimental instructions.
|
|
The last compiler to generate code that uses the bs_bits_to_bytes/3
instruction was the R11 compiler. Since we don't support loading
R11 *.beam files in R14, removing the remaining support for the
instruction.
|
|
Since R12B, empty tuples are literals. Thus the compiler will no
longer generate the instruction:
put_tuple 0 Destination
for creating an empty tuple. It is now time to stop supporting
that instruction in the run-time system.
While we are at it, correct a typo.
|
|
* pan/otp_8217_binary:
Add documentation for binary module
Add more tests and make some go easier on small systems
Correct Boyer More and trapping for longest_common_suffix
Add longer timetrap to testcases and add binary to app file
Add guard BIFs binary_part/2,3
Add binary:{encode,decode}_unsigned({1,2}
Add referenced_byte_size/1
Add binary:list_to_bin/1 and binary:copy/1,2
Add bin_to_list/{1,2,3}
Add binary:longest_common_prefix/longest_common_suffix
Add binary:part to erl_bif_binary.c
Move binary module bif's to erl_bif_binary.c
Count reductions for process even when not trapping
Add random compare testcase
Teach BIF's binary:match/matches interrupting/restarting
Teach binary.c the semantics to take longest instead of shortest match
Initial commit of the binary EEP
OTP-8217 Implement EEP31
The module binary from EEP31 (and EEP9) is implemented.
|
|
Correct behaviour of copy/2 witn 0 copies.
|
|
Even more tests added to cover more error cases, some tests
made easier on systems with small memories and timeouts made longer
due to timetraps on solaris daily builds.
|
|
Add testcases and clean up to get better code coverage.
|
|
Add the gc_bif's to the VM.
Add infrastructure for gc_bif's (guard bifs that can gc) with two and.
three arguments in VM (loader and VM).
Add compiler support for gc_bif with three arguments.
Add compiler (and interpreter) support for new guard BIFs.
Add testcases for new guard BIFs in compiler and emulator.
|
|
Add testcases for encode/decode_unsigned/1,2.
|
|
Add testcases for referenced_byte_size/1.
Add failure tests for referenced_byte_size.
|
|
Add testcases for binary:list_to_bin/1 and binary:copy/1,2.
Add reference implementation of list_to_bin/1.
|
|
Add testcases for bin_to_list.
Teach binref.erl bin_to_list.
|
|
Add allcoator parameter to erts_get_aligned_binary_bytes_extra.
Add testcases for the functions above.
Add reference implementation for the functions above.
|
|
Change name of the 'scope' option for binary:match/matches.
Add split and replace to binary.erl.
Cleanup comments etc in binary.erl and atom.names
Add testcases for part, split, replace and scopes.
|
|
|
|
Set loop factors to 10.
Teach erts_debug:set_internal_state to limit loop factor for binary.
Add random tests for matches and match with multiple searchstrings.
|
|
Fix heap-hole when trapping in binary.c
Fix boyer more segfaulting when searchstring is longer than haystack
|
|
Add Boyer More implementation of binary:matches.
Cleanup and removed unused code.
|