fix(sql): prevent SIGSEGV in window join by awaiting workers before freeing cache#6662
fix(sql): prevent SIGSEGV in window join by awaiting workers before freeing cache#6662bluestreak01 merged 6 commits intomasterfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
That's not the only scenario when this bug would show up and the added test demonstrates that. While the That's why the segfault happened reliably when I'll create a GH issue for this performance enhancement. |
GH issue: #6665 |
[PR Coverage check]😍 pass : 84 / 84 (100.00%) file detail
|
Summary
Fixes #6661 - SIGSEGV crash when using WINDOW JOIN with large slave tables.
Root cause:
AsyncWindowJoinRecordCursor.close()was freeingslaveTimeFrameAddressCachebefore waiting for worker threads to finish. When workers tried to access the freedDirectLongList(whose internal address becomes 0), they would read fromaddress + offsetwhereaddress = 0, causing SIGSEGV.Fix:
close()to await workers before freeing shared resourcesWindowJoinPrevailingCachewhererowIndex < 0check handlesLong.MIN_VALUETest plan
testWindowJoinWithPrevailingOnEmptyResultSetRegression🤖 Generated with Claude Code