diff options
author | Ingela Anderton Andin <[email protected]> | 2012-12-06 15:42:18 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2012-12-06 15:42:18 +0100 |
commit | 6bc9c65ae207ebc2fba03521c2ca3b84264a1dcf (patch) | |
tree | 7017f536fe5557b1494d1b3844ff776b5bfcae40 /erts/emulator/beam | |
parent | 51f1f06bafa99291daaafe22a24a1dc4ff45d067 (diff) | |
parent | 1cbd897c43f0dab1275392a3736e4629c1f80243 (diff) | |
download | otp-6bc9c65ae207ebc2fba03521c2ca3b84264a1dcf.tar.gz otp-6bc9c65ae207ebc2fba03521c2ca3b84264a1dcf.tar.bz2 otp-6bc9c65ae207ebc2fba03521c2ca3b84264a1dcf.zip |
Merge branch 'maint'
Conflicts:
erts/emulator/sys/vxworks/sys.c
erts/vsn.mk
lib/ssl/src/ssl_connection.erl
lib/ssl/test/ssl_basic_SUITE.erl
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/break.c | 18 | ||||
-rw-r--r-- | erts/emulator/beam/sys.h | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/erts/emulator/beam/break.c b/erts/emulator/beam/break.c index 63136d86c9..c1e9fe536d 100644 --- a/erts/emulator/beam/break.c +++ b/erts/emulator/beam/break.c @@ -670,6 +670,7 @@ erl_crash_dump_v(char *file, int line, char* fmt, va_list args) char dumpnamebuf[MAXPATHLEN]; char* dumpname; int secs; + int env_erl_crash_dump_seconds_set = 1; if (ERTS_SOMEONE_IS_CRASH_DUMPING) return; @@ -694,6 +695,8 @@ erl_crash_dump_v(char *file, int line, char* fmt, va_list args) envsz = sizeof(env); /* ERL_CRASH_DUMP_SECONDS not set + * if we have a heart port, break immediately + * otherwise dump crash indefinitely (until crash is complete) * same as ERL_CRASH_DUMP_SECONDS = 0 * - do not write dump * - do not set an alarm @@ -715,8 +718,10 @@ erl_crash_dump_v(char *file, int line, char* fmt, va_list args) */ if (erts_sys_getenv__("ERL_CRASH_DUMP_SECONDS", env, &envsz) != 0) { - return; /* break immediately */ + env_erl_crash_dump_seconds_set = 0; + secs = -1; } else { + env_erl_crash_dump_seconds_set = 1; secs = atoi(env); } @@ -724,7 +729,16 @@ erl_crash_dump_v(char *file, int line, char* fmt, va_list args) return; } - erts_sys_prepare_crash_dump(secs); + /* erts_sys_prepare_crash_dump returns 1 if heart port is found, otherwise 0 + * If we don't find heart (0) and we don't have ERL_CRASH_DUMP_SECONDS set + * we should continue writing a dump + * + * beware: secs -1 means no alarm + */ + + if (erts_sys_prepare_crash_dump(secs) && !env_erl_crash_dump_seconds_set ) { + return; + } if (erts_sys_getenv__("ERL_CRASH_DUMP",&dumpnamebuf[0],&dumpnamebufsize) != 0) dumpname = "erl_crash.dump"; diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index c5af5b9577..f5f10bb616 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -644,7 +644,7 @@ void erts_sys_schedule_interrupt_timed(int set, erts_short_time_t msec); void erts_sys_main_thread(void); #endif -extern void erts_sys_prepare_crash_dump(int secs); +extern int erts_sys_prepare_crash_dump(int secs); extern void erts_sys_pre_init(void); extern void erl_sys_init(void); extern void erl_sys_args(int *argc, char **argv); |