summaryrefslogtreecommitdiff
path: root/erts/etc
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright yearErlang/OTP2023-05-151-1/+1
|
* erlc: Fix compiler server args on windowsDan Gudmundsson2023-05-081-1/+3
| | | | String could be wrong length if arg was quoted and changed.
* escript: Avoid warning about truncated output in strncpyFrej Drejhammar2023-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | GCC warns about how `strncpy` is used in `erts/etc/common/escript.c`: ``` escript.c: In function ‘main’: escript.c:289:17: warning: ‘__builtin_strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 289 | strncpy(dir, beg, sz); | ^ In function ‘find_prog’, inlined from ‘main’ at escript.c:483:25: escript.c:282:26: note: length computed here 282 | sz = strlen(beg); ``` The warning is triggered as GCC understands that, as `sz = strlen(beg)`, `strncpy` will never see and copy a terminating nul character to `dir`. As we manually null-terminate `dir`, by `dir[sz] = '\0';` on the line following `strncpy` we can avoid the warning, and speed up the copy a little (there is no need to look for a nul terminator), by using a plain `memcpy`.
* erts: Modernize K&R-style functionsFrej Drejhammar2023-04-061-16/+6
| | | | | | Clang 16 now warns about functions using K&R syntax. Instead of juggling with compiler warning options, it is better to just bite the bullet and modernize the source code.
* Update copyright yearErlang/OTP2023-02-1415-15/+15
|
* Merge PR-6351 from max-au/call-memory OTP-18440Sverker Eriksson2023-02-081-1/+1
|\ | | | | [erts] Implement call_memory tracing
| * [erts] Implement call_memory tracingMaxim Fedorov2023-02-081-1/+1
| | | | | | | | | | Similar to call_time, erlang:trace_pattern(..., [call_memory]) accumulates memory allocations, allowing for basic heap profiling.
* | Merge branch 'maint'Dan Gudmundsson2023-02-072-7/+17
|\ \
| * | Win installer version fixDan Gudmundsson2023-02-072-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | Use 0.0.0.0 for non releases as productversion (and also seen as file version) on the installer for non release builds. Only integers works, so use 0.0.0.0 to indicate that this is not a normal release.
* | | Merge branch 'maint'Dan Gudmundsson2023-02-036-16/+45
|\ \ \ | |/ /
| * | Merge pull request #6587 from lukebakken/lukebakken/erlang-otp-4232Dan Gudmundsson2023-02-036-16/+45
| |\ \ | | | | | | | | | | | | Update various file and installer properties OTP-18429
| | * | Make copyright year dynamicDan Gudmundsson2023-02-015-2/+10
| | | | | | | | | | | | | | | | | | | | Copyright year inside installer and resource file is NOT automaticly updated by the release scripts so update them from the makefiles.
| | * | Use OTP version as product version in installerDan Gudmundsson2023-02-013-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ProductVersion must be of the format X.X.X.X so we can't use the release version as ProductVersion. Use OTP_VERSION instead this also makes sense for the windows installer as we on windows always delivers a complete OTP.
| | * | Rename macrosDan Gudmundsson2023-01-312-12/+12
| | | | | | | | | | | | | | | | So they are named as they should be.
| | * | Limits NSIS versionsDan Gudmundsson2023-01-312-4/+2
| | | | | | | | | | | | | | | | | | | | We use ExecShellWait. NSIS v3.02 added basic support for ExecShellWait.
| | * | Update various file and installer propertiesLuke Bakken2023-01-102-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | Fixes #4232 Show NSIS version
* | | | Merge branch 'maint'Sverker Eriksson2023-01-271-11/+10
|\ \ \ \ | |/ / /
| * | | Merge branch 'sverker/25/fix-cerl-core' into maintSverker Eriksson2023-01-271-11/+10
| |\ \ \
| | * \ \ Merge branch 'sverker/23/fix-cerl-core' into sverker/25/fix-cerl-coreSverker Eriksson2023-01-261-11/+10
| | |\ \ \ | | | |/ / | | |/| |
| | | * | erts: Fix cerl options -core and -gdbSverker Eriksson2023-01-261-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | for running gdb in Emacs. Seems to have stopped working in newer Ubuntu (Emacs) version.
* | | | | erts: Optionally include off-heap binaries into max_heap_sizeSverker Eriksson2023-01-231-0/+1
| | | | |
* | | | | Merge branch 'maint'Rickard Green2023-01-181-1/+3
|\ \ \ \ \ | |/ / / / | | | | / | |_|_|/ |/| | | * maint: [erts] Support for truly asynchronous distributed signaling
| * | | [erts] Support for truly asynchronous distributed signalingRickard Green2023-01-171-1/+3
| |/ /
* | | Merge pull request #6541 from jhogberg/john/erts/fix-fun-creation-race/OTP-18016John Högberg2022-12-151-4/+4
|\ \ \ | | | | | | | | erts: Fix race in fun loading
| * | | erts: Fix race in fun loadingJohn Högberg2022-12-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because funs are tied to their canonical module rather than a specific instance of a module, they are "moved over" to the newest instance whenever we reload _the exact same module_ over itself. This quirk, together with how fun entries are updated when a module is loaded, caused a small window where it was possible for a holder of an "old" fun to call the new instance before it was fully loaded. This commit fixes that by versioning funs in roughly the same way we do exports. It also fixes a related bug where fun purging could be messed up if a new module instance was loaded in the middle of purging, solving the issue by disallowing code loading while purging a module with funs.
* | | | Remove unused variableRaimo Niskanen2022-12-071-3/+2
|/ / /
* | | Merge branch 'maint'Sverker Eriksson2022-11-171-6/+22
|\ \ \ | |/ /
| * | erts: Add code_ix arguments to some etp commandsSverker Eriksson2022-11-171-6/+22
| | |
* | | Merge branch 'maint'Lukas Larsson2022-10-211-0/+1
|\ \ \ | |/ /
| * | erts: Add acful, abandon carried free utilization limitLukas Larsson2022-10-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This limit can be used to let erts_alloc know that it should use MADV_FREE on any pages within a carrier that are currently unused. Before this change we have tried to have this as default, but that caused performance issues as carriers oscillated in and out of the migration pool. So in 25 we decided to remove it. However, this caused MemAvailable from /proc/memory to become significantly lower and thus machines that have a tight memory budget need this option. So the solution is to add a new config option where the user can set at which utilization limit that free pages in a carrier should be placed in MemAvailable. The option is by default set to 0, to mimic the behaviour of OTP 25.
* | | otp: Create TARGET folders in MakefileLukas Larsson2022-10-181-0/+6
| | | | | | | | | | | | | | | | | | We create the TARGET folders in the makefiles instead of in configure as then we can delete them without having to re-run configure.
* | | Merge pull request #6340 from frej/frej/decouple-use-of-single-mapped-memoryBjörn Gustavsson2022-10-111-1/+1
|\ \ \ | | | | | | | | erts: Decouple use of single-mapped memory from `perf` support
| * | | erts: Decouple use of single-mapped memory from `perf` supportFrej Drejhammar2022-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running the JIT with single-mapped RWX memory for JIT:ed machine code is needed for `perf` support. But as it is also useful for running under QEMU user mode emulation [1] this patch adds a new flag `+JMsingle bool` which controls the use of single-mapped RWX memory without triggering the output of perf-related metadata. The naming of the flag is intended to follow the (perceived) pattern introduced by the `+JPperf`-flag, that is, `J` is a JIT-related option and `M` stands for memory related things. Thanks to Björn Gustavsson <bjorn@erlang.org> for suggesting how to deal with Apple-silicon aarch64 and how to make the smoke test work on Windows. Personally I use the additional patch below in order to use the same file system image for development on an amd64 build host and for deployment to an aarch64-target board. The patch detects when the VM is running using QEMU and if so, enables single-mapped memory. As the patch only works on Linux and doesn't try to identify the version of QEMU (if the bug gets fixed), I don't think it belongs on OTP master. But as it is nevertheless useful, I include it here: ``` diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c index 42216da0b2..6f11c7586b 100644 --- a/erts/emulator/beam/erl_init.c +++ b/erts/emulator/beam/erl_init.c @@ -2408,6 +2408,40 @@ erl_start(int argc, char **argv) erts_usage(); } + +#if defined(HAVE_LINUX_PERF_SUPPORT) + /* We want to detect if we are running under QEMU user mode + emulation in order to activate single-mapped RWX memory for the + JIT:ed code. This only works on Linux, so we use + HAVE_LINUX_PERF_SUPPORT to conditionally compile this piece of + detection code. + + To detect QEMU user mode we make use of the fact that our + parent process will always be QEMU, we detect that by looking + up our parent process and then checking if the final path + component of the symlink /proc/<parent>/exe starts with + "qemu-". + */ + { + char symlink_buf[21 + 11]; /* space for any 64 bit integer + + /proc/%d/exe and terminator */ + char target_buf[MAXPATHLEN]; + ssize_t l; + erts_snprintf(symlink_buf, sizeof(symlink_buf), + "/proc/%d/exe", getppid()); + l = readlink(symlink_buf, target_buf, sizeof(target_buf)); + if (l > 0 && l != sizeof(target_buf)) { + char *last_path_separator; + + target_buf[l] = 0; + last_path_separator = memrchr(target_buf, '/', l); + if (last_path_separator && strncmp(last_path_separator + 1, + "qemu-", 5) == 0) + erts_jit_single_map = 1; + } + } +#endif + /* Output format on windows for sprintf defaults to three exponents. * We use two-exponent to mimic normal sprintf behaviour. */ ``` [1] There is a bug in QEMU, see https://gitlab.com/qemu-project/qemu/-/issues/1034
* | | | erts: support unicode cmdline in compilation serverfrazze-jobb2022-10-031-3/+2
|/ / /
* | | stdlib: Fix escript SUITELukas Larsson2022-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Argument parsing by init is a bit naive. In the escript testcase "-noshell xxxx...." was interpreted as the "-noshell" flag being given the value "xxxx....". So to fix this, we push the "-boot file" argument last and thus "xxxxx" will be seen as a separate argument as it should.
* | | erts: Re-Implement shell using nifLukas Larsson2022-08-298-168/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit re-implements the entire tty driver for both Unix and Windows to use a common nif instead of two seperate drivers. The Unix implementation works pretty much as it did before only that a lot more of the terminal logic has been moved from Erlang to C. The windows implementation now uses Windows Terminal Sequences, i.e. the same sequences as most Unixes to control the terminal. This means that werl.exe is no longer needed and erl.exe will have the "newshell" with all the features normally only found on Unix. The new implementation also uses dirty I/O threads for all I/O which means that it can leave the FDs in blocking mode. This fixes problems when the Erlang tty is interacting with other systems such as bash. Closes #3150 Closes #3390 Closes #4343
* | | erts: Fix writing to std handler when detachedLukas Larsson2022-08-291-0/+12
| | | | | | | | | | | | | | | | | | | | | When writing using erlang:display* when detached the write operation would return an error on windows. So we make sure that the handles are valid so that they can always be written to.
* | | ct: Fix ct_run to work with space in pathLukas Larsson2022-08-181-23/+1
| | |
* | | Merge branch 'maint'Rickard Green2022-07-131-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | * maint: [erts] Yield when adjusting large message queues [erts] Improve flushing of signals
| * | [erts] Improve flushing of signalsRickard Green2022-07-131-1/+1
| | |
* | | to_erl: Do not make DEBUG flag enable debug loggingLukas Larsson2022-07-081-12/+12
| | | | | | | | | | | | | | | The log messages mess with testing and are really only meant to help when debugging to_erl, not when running it in tests.
* | | peer: Allow peers to stay attached and use ttyLukas Larsson2022-07-081-7/+6
|/ /
* | Merge branch 'lukas/24/erts/fix-dist-fragment-exit-leak/OTP-18077' into ↵Lukas Larsson2022-05-011-11/+221
|\ \ | | | | | | | | | lukas/25/erts/fix-dist-fragment-exit-leak/OTP-18077
| * \ Merge branch 'lukas/23/erts/fix-dist-fragment-exit-leak/OTP-18077' into ↵Lukas Larsson2022-05-011-10/+219
| |\ \ | | | | | | | | | | | | lukas/24/erts/fix-dist-fragment-exit-leak/OTP-18077
| | * \ Merge branch 'lukas/22/erts/fix-dist-fragment-exit-leak/OTP-18077' into ↵Lukas Larsson2022-04-301-10/+205
| | |\ \ | | | |/ | | |/| | | | | lukas/23/erts/fix-dist-fragment-exit-leak/OTP-18077
| | | * erts: Add etp-links for inspecting process linksLukas Larsson2022-04-271-8/+182
| | | |
| | | * erts: Fix fragmented send to finish before exitingLukas Larsson2022-04-271-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a process is suspended doing a fragmented send and then receives an exit signal it was terminated before it could finish sending the message leading to a memory leak on the receiving side. This change fixes that so that the message is allowed to finish being sent before the process exits. Closes #5876
| * | | Update copyright yearErlang/OTP2022-03-091-1/+1
| | | |
* | | | Merge pull request #5880 from garazdawi/lukas/erts/add-etp-distLukas Larsson2022-04-201-0/+190
|\ \ \ \ | | | | | | | | | | erts: Add etp-dist for listing all dist entries
| * | | | erts: Add etp-dist for listing all dist entriesLukas Larsson2022-04-121-0/+190
| | | | |