summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/RtsFlags.c4
-rw-r--r--rts/RtsStartup.c3
-rw-r--r--testsuite/tests/rts/Makefile9
-rw-r--r--testsuite/tests/rts/T9405.hs3
-rw-r--r--testsuite/tests/rts/all.T3
5 files changed, 21 insertions, 1 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 3d0d7a45dc..cce799e139 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -590,9 +590,11 @@ void setupRtsFlags (int *argc, char *argv[], RtsConfig rts_config)
if (RtsFlags.GcFlags.statsFile != NULL) {
initStatsFile (RtsFlags.GcFlags.statsFile);
}
+#ifdef TICKY_TICKY
if (RtsFlags.TickyFlags.tickyFile != NULL) {
- initStatsFile (RtsFlags.GcFlags.statsFile);
+ initStatsFile (RtsFlags.TickyFlags.tickyFile);
}
+#endif
}
/* -----------------------------------------------------------------------------
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index bd6a6ae14a..4b9d9471ee 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -408,6 +408,9 @@ hs_exit_(rtsBool wait_foreign)
#if defined(TICKY_TICKY)
if (RtsFlags.TickyFlags.showTickyStats) PrintTickyInfo();
+
+ FILE *tf = RtsFlags.TickyFlags.tickyFile;
+ if (tf != NULL) fclose(tf);
#endif
#if defined(mingw32_HOST_OS) && !defined(THREADED_RTS)
diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile
index 094506dc10..6181f87d3a 100644
--- a/testsuite/tests/rts/Makefile
+++ b/testsuite/tests/rts/Makefile
@@ -45,6 +45,15 @@ T5423:
"$(TEST_HC)" $(TEST_HC_OPTS) -v0 T5423.o T5423_cmm.o -o T5423$(exeext)
./T5423
+.PHONY: T9405
+T9405:
+ @'$(TEST_HC)' $(TEST_HC_OPTS) -ticky -rtsopts T9405.hs; \
+ ./T9405 +RTS -rT9405.ticky & \
+ sleep 0.2; \
+ kill -2 $$!; \
+ wait $$!; \
+ [ -s T9405.ticky ] && echo Ticky-Ticky
+
# Naming convention: 'T5423_' obj-way '_' obj-src
# obj-way ::= v | dyn
# obj-src ::= gcc // using __attribute__(constructor)
diff --git a/testsuite/tests/rts/T9405.hs b/testsuite/tests/rts/T9405.hs
new file mode 100644
index 0000000000..ca68e10230
--- /dev/null
+++ b/testsuite/tests/rts/T9405.hs
@@ -0,0 +1,3 @@
+import Control.Concurrent
+
+main = threadDelay 2000000
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index 60513ca795..269bc55f52 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -330,3 +330,6 @@ test('T10904', [ omit_ways(['ghci']), extra_run_opts('20000') ],
test('T10728', [extra_run_opts('+RTS -maxN3 -RTS'), only_ways(['threaded2'])],
compile_and_run, [''])
+
+test('T9405', [extra_clean(['T9405.ticky'])],
+ run_command, ['$MAKE -s --no-print-directory T9405'])