Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yugabyte#11662] [YSQL] Fix asan issue for TestPgIsolationRegress
Summary: The asan issue occurs because of a memory leak in the isolation regress test suite's spec parser if we have a comment block in setup with some SQL reserved words. The error is as below - ``` + ================================================================= + ==3009==ERROR: LeakSanitizer: detected memory leaks + + Direct leak of 2048 byte(s) in 1 object(s) allocated from: + #0 0x7f7df2412cd9 in realloc /opt/yb-build/llvm/yb-llvm-v12.0.1-yb-1-1633099823-bdb147e6-centos7-x86_64-build/src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:164:3 + #1 0x40eed7 in pg_realloc /nfusr/dev-server/pjain/code/yugabyte-db/src/postgres/src/common/../../../../../src/postgres/src/common/fe_memutils.c:72:8 + #2 0x405e31 in addlitchar /nfusr/dev-server/pjain/code/yugabyte-db/src/postgres/src/test/isolation/specscanner.l:116:12 + #3 0x40542f in spec_yylex /nfusr/dev-server/pjain/code/yugabyte-db/src/postgres/src/test/isolation/specscanner.l + #4 0x402ae0 in spec_yyparse /nfusr/dev-server/pjain/code/yugabyte-db/src/postgres/src/test/isolation/specparse.c:1190:16 + #5 0x409349 in main /nfusr/dev-server/pjain/code/yugabyte-db/src/postgres/src/test/isolation/../../../../../../src/postgres/src/test/isolation/isolationtester.c:112:2 + #6 0x7f7df12a3554 in __libc_start_main (/lib64/libc.so.6+0x22554) + + Objects leaked above: + 0x61d000000080 (2048 bytes) + + SUMMARY: AddressSanitizer: 2048 byte(s) leaked in 1 allocation(s). ====================================================================== ``` I found which part of the spec caused the issue by just performing a binary search and running different parts of the spec instead of reading the code (since that would take more time and effort). And it is evident that the comment block with reserved words was the issue. The fix is to just move those blocks outside. I have also increased the timeout since the test fails occsionaly with a timeout error. This happened after I added more test schedules to TestPgIsolationRegress as part of D15383. Test Plan: ./yb_build.sh --java-test org.yb.pgsql.TestPgIsolationRegress Reviewers: mtakahara Reviewed By: mtakahara Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D15886
- Loading branch information