diff options
Diffstat (limited to 'src/util/profile/prof_test1')
-rw-r--r-- | src/util/profile/prof_test1 | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/util/profile/prof_test1 b/src/util/profile/prof_test1 index d7117a6..c330740 100644 --- a/src/util/profile/prof_test1 +++ b/src/util/profile/prof_test1 @@ -40,7 +40,7 @@ proc test1 {} { #profile_iterator_free $iter catch {file delete $wd/test3.ini} profile_flush_to_file $p $wd/test3.ini - profile_release $p + profile_abandon $p if $verbose { puts "Reloading new profile" } set p [profile_init_path $wd/test3.ini] @@ -305,6 +305,25 @@ proc test8 {} { puts "OK: test8: relation order in the presence of deletions" } +proc test9 {} { + global wd verbose + + # Regression test for #8431: profile_flush_to_file erroneously + # cleared the DIRTY and SHARED flags from the data object, which + # could lead to a dangling reference in g_shared_trees on release. + set p [profile_init_path $wd/test2.ini] + catch {file delete $wd/test3.ini} + profile_flush_to_file $p $wd/test3.ini + profile_release $p + + # If a dangling reference was created in g_shared_trees, the next + # profile open will trigger an assertion failure. + set p [profile_init_path $wd/test2.ini] + profile_release $p + + puts "OK: test9: profile_flush_to_file with no changes" +} + test1 test2 test3 @@ -313,5 +332,6 @@ test5 test6 test7 test8 +test9 exit 0 |