From 0e6aba22c6b876a36adc39cac5314ce6e626954c Mon Sep 17 00:00:00 2001 From: k0kubun Date: Mon, 26 Nov 2018 14:45:39 +0000 Subject: process.c: try to workaroun SEGV by r65994 http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/1480173 It tries to print C backtrace but fails. And core file on the server seems to be stopping on the irrelevant place due to its own signal handler for the dump. And I failed to reproduce this SEGV on my machine. I don't know why it's broken, so let me try this change to investigate the reason of SEGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'mjit.c') diff --git a/mjit.c b/mjit.c index 5fa93a3cfa..f7ae80834f 100644 --- a/mjit.c +++ b/mjit.c @@ -785,6 +785,29 @@ mjit_child_after_fork(void) start_worker(); } +/* Half-baked version of mjit_finish(). It just deletes MJIT-related files. + Caller should disable MJIT because it won't work without the deleted files. + + We want to use mjit_finish() for this function's usage but it's somehow broken like: + http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/1480173 */ +void +mjit_clean_files(void) +{ +#ifndef _MSC_VER /* mswin has prebuilt precompiled header */ + if (!mjit_opts.save_temps && getpid() == pch_owner_pid) + remove_file(pch_file); + + xfree(header_file); header_file = NULL; +#endif + xfree(tmp_dir); tmp_dir = NULL; + xfree(pch_file); pch_file = NULL; + + mjit_call_p = FALSE; + free_list(&unit_queue); + free_list(&active_units); + free_list(&compact_units); +} + /* Finish the threads processing units and creating PCH, finalize and free MJIT data. It should be called last during MJIT life. */ @@ -817,19 +840,7 @@ mjit_finish(void) rb_native_cond_destroy(&mjit_worker_wakeup); rb_native_cond_destroy(&mjit_gc_wakeup); -#ifndef _MSC_VER /* mswin has prebuilt precompiled header */ - if (!mjit_opts.save_temps && getpid() == pch_owner_pid) - remove_file(pch_file); - - xfree(header_file); header_file = NULL; -#endif - xfree(tmp_dir); tmp_dir = NULL; - xfree(pch_file); pch_file = NULL; - - mjit_call_p = FALSE; - free_list(&unit_queue); - free_list(&active_units); - free_list(&compact_units); + mjit_clean_files(); finish_conts(); mjit_enabled = FALSE; -- cgit v1.2.3