Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mysql-test/lib/My/Debugger.pm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ my %debuggers = (
push @::global_suppressions, qr/InnoDB: native AIO failed/;
::mtr_error('rr requires kernel.perf_event_paranoid <= 1')
if ::mtr_grab_file('/proc/sys/kernel/perf_event_paranoid') > 1;
$ENV{LSAN_OPTIONS}= "report_objects=1:" . ($ENV{LSAN_OPTIONS} || '')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Appending a trailing colon when $ENV{LSAN_OPTIONS} is empty or undefined can lead to syntax warnings from LSAN/ASAN (e.g., complaining about empty options or missing =). Since mtr is highly sensitive to unexpected output on stderr, these warnings can cause test failures. Additionally, a terminating semicolon should be added to ensure robust Perl syntax.

We can conditionally append the colon only when $ENV{LSAN_OPTIONS} is non-empty.

      $ENV{LSAN_OPTIONS}= "report_objects=1" . ($ENV{LSAN_OPTIONS} ? ":$ENV{LSAN_OPTIONS}" : "");

}
},
valgdb => {
Expand Down
3 changes: 2 additions & 1 deletion mysql-test/mariadb-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,8 @@ sub command_line_setup {
# $ENV{ASAN_OPTIONS}= "log_path=${opt_vardir}/log/asan:" . $ENV{ASAN_OPTIONS};

# Add leak suppressions
$ENV{LSAN_OPTIONS}= "suppressions=${glob_mysql_test_dir}/lsan.supp:print_suppressions=0"
$ENV{LSAN_OPTIONS}= "suppressions=${glob_mysql_test_dir}/lsan.supp:print_suppressions=0:"
. ($ENV{LSAN_OPTIONS} || '')
Comment on lines +1647 to +1648
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Appending a trailing colon when $ENV{LSAN_OPTIONS} is empty or undefined can lead to syntax warnings from LSAN/ASAN. We should conditionally append the colon only when $ENV{LSAN_OPTIONS} is non-empty.

  $ENV{LSAN_OPTIONS}= "suppressions=${glob_mysql_test_dir}/lsan.supp:print_suppressions=0"
     . ($ENV{LSAN_OPTIONS} ? ":$ENV{LSAN_OPTIONS}" : "")

if -f "$glob_mysql_test_dir/lsan.supp" and not IS_WINDOWS;

mtr_verbose("ASAN_OPTIONS=$ENV{ASAN_OPTIONS}");
Expand Down