aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/io.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-10-24 14:20:26 +0200
committerBjörn-Egil Dahlberg <[email protected]>2012-10-24 14:20:26 +0200
commitd5733bc3e34449affde2594d85b905c8ab440d42 (patch)
tree4744a65c8d163ef261f56d70ff7b4bf975a2aa28 /erts/emulator/beam/io.c
parente85c4dda93e416e8e97c0dcfadc5eeaf5bd8b4e1 (diff)
parent6f0a76a0f78f3483b561b5e59260e8ca968b052c (diff)
downloadotp-d5733bc3e34449affde2594d85b905c8ab440d42.tar.gz
otp-d5733bc3e34449affde2594d85b905c8ab440d42.tar.bz2
otp-d5733bc3e34449affde2594d85b905c8ab440d42.zip
Merge branch 'egil/ensure-erl_crash.dump/OTP-10422' into maint
* egil/ensure-erl_crash.dump/OTP-10422: test: Relax timeouts for heart_SUITE erts: Fix crash dump write to port hack erts: Fix lock check assertion doc: Document ERL_CRASH_DUMP_SECONDS behaviour test: Add test for heart restart on crash test: Add test for heart restart on crash erts: Change ERL_CRASH_DUMP_SECONDS behaviour test: Refactor away ?line macros in heart_SUITE erts: Search for heart in ports that are alive heart: Refactor heart debugging erts, heart: Ensure erl_crash.dump is written
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r--erts/emulator/beam/io.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 35b194f927..609fe9f5fb 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -1132,7 +1132,7 @@ int erts_write_to_port(Eterm caller_id, Port *p, Eterm list)
Uint size;
int fpe_was_unmasked;
- ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(p));
+ ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(p) || ERTS_IS_CRASH_DUMPING);
ERTS_SMP_CHK_NO_PROC_LOCKS;
p->caller = caller_id;
@@ -5235,3 +5235,27 @@ erl_drv_getenv(char *key, char *value, size_t *value_size)
{
return erts_sys_getenv_raw(key, value, value_size);
}
+
+/* get heart_port
+ * used by erl_crash_dump
+ * - uses the fact that heart_port is registered when starting heart
+ */
+
+Port *erts_get_heart_port() {
+
+ Port* port;
+ Uint ix;
+
+ for(ix = 0; ix < erts_max_ports; ix++) {
+ port = &erts_port[ix];
+ /* only examine undead or alive ports */
+ if (port->status & ERTS_PORT_SFLGS_DEAD)
+ continue;
+ /* immediate atom compare */
+ if (port->reg && port->reg->name == am_heart_port) {
+ return port;
+ }
+ }
+
+ return NULL;
+}