yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.92k stars 1.06k forks source link

[YSQL] Memory leak in yb_lock_status #18324

Open foucher opened 1 year ago

foucher commented 1 year ago

Jira Link: DB-7312

Description

Please refer to commit 82003085aea65aa724d7e950e73dbc364b4000ee. If you uncomment test: yb-lock-status in yb_pg_isolation_schedule (recommended: for speed, temporarily comment out all the other regression tests in that schedule), and let Jenkins run it, you will find asan detects a memory leak. Please see attached asan_mem_leak.txt.

asan doesn't work on MacOS. I tried the following command on my dev server, but I didn't see the memory leak there.

ybd asan --java-test 'org.yb.pgsql.TestPgIsolationRegress#isolationRegress'

Warning: Please confirm that this issue does not contain any sensitive information

tvesely commented 1 year ago

This is actually a memory leak in LWAppStatusPB, and it was allocated while making a LWPgPerformResponsePB. There are intrusive pointers being used, and it's not clear what the cause of the memory leak is.

I've been running the yb_pg_isolation_schedule with asan in a loop for a week, and I have been unable to reproduce the error.

What kind of instrumentation might we add/use to help us track down this leak?