yjhjstz opened a new pull request, #1392:
URL: https://github.com/apache/cloudberry/pull/1392

   Previously, if a group reused statistics from its duplicate, appending new 
statistics could cause a segmentation fault when trying to release a NULL 
pointer. Fixed by appending directly to the duplicate's statistics instead.
   
   
   Fixes #ISSUE_Number
   
   ```sql
   #6  <signal handler called>
   #7  0x00000000012436f2 in gpos::CRefCount::Check (this=0x0)
       at 
../../../../../../src/backend/gporca/libgpos/include/gpos/common/CRefCount.h:50
   #8  0x000000000124387a in gpos::CRefCount::Release (this=0x0)
       at 
../../../../../../src/backend/gporca/libgpos/include/gpos/common/CRefCount.h:99
   #9  0x00000000014b67a5 in gpopt::CGroup::AppendStats (this=0x7f3c857e48c8, 
mp=0x83f1670, stats=0x874a0d0) at CGroup.cpp:895
   #10 0x00000000014b84ca in gpopt::CGroup::PstatsRecursiveDerive 
(this=0x7f3c857e48c8, pmpLocal=0x83f1670, pmpGlobal=0x83f1670, 
       prprel=0x7f3c858490e8, stats_ctxt=0x7f3c8583b280) at CGroup.cpp:1518
   #11 0x000000000141a584 in gpopt::CExpressionHandle::DeriveStats 
(this=0x7fff76b7b130, stats_ctxt=0x7f3c8583cf60, 
       fComputeRootStats=false) at CExpressionHandle.cpp:450
   #12 0x00000000014c58e0 in gpopt::CGroupExpression::PstatsRecursiveDerive 
(this=0x86b9318, pmpGlobal=0x83f1670, prprel=0x7f3c858491e8, 
       stats_ctxt=0x7f3c8583cf60, fComputeRootStats=false) at 
CGroupExpression.cpp:1004
   #13 0x00000000014b8160 in gpopt::CGroup::EspDerive (pmpLocal=0x86e6c88, 
pmpGlobal=0x83f1670, pgexpr=0x86b9318, prprel=0x7f3c858491e8, 
       stats_ctxt=0x7f3c8583cf60, fDeriveChildStats=true) at CGroup.cpp:1426
   #14 0x00000000014b88e4 in gpopt::CGroup::PgexprBestPromise 
(this=0x7f3c857fbab0, pmpLocal=0x86e6c88, pmpGlobal=0x83f1670, 
       prprelInput=0x7f3c858491e8, stats_ctxt=0x7f3c8583cf60) at CGroup.cpp:1611
   ```
   
   ### What does this PR do?
   <!-- Brief overview of the changes, including any major features or fixes -->
   
   ### Type of Change
   - [ ] Bug fix (non-breaking change)
   - [ ] New feature (non-breaking change)
   - [ ] Breaking change (fix or feature with breaking changes)
   - [ ] Documentation update
   
   ### Breaking Changes
   <!-- Remove if not applicable. If yes, explain impact and migration path -->
   
   ### Test Plan
   <!-- How did you test these changes? -->
   - [ ] Unit tests added/updated
   - [ ] Integration tests added/updated
   - [ ] Passed `make installcheck`
   - [ ] Passed `make -C src/test installcheck-cbdb-parallel`
   
   ### Impact
   <!-- Remove sections that don't apply -->
   **Performance:**
   <!-- Any performance implications? -->
   
   **User-facing changes:**
   <!-- Any changes visible to users? -->
   
   **Dependencies:**
   <!-- New dependencies or version changes? -->
   
   ### Checklist
   - [ ] Followed [contribution 
guide](https://cloudberry.apache.org/contribute/code)
   - [ ] Added/updated documentation
   - [ ] Reviewed code for security implications
   - [ ] Requested review from [cloudberry 
committers](https://github.com/orgs/apache/teams/cloudberry-committers)
   
   ### Additional Context
   <!-- Any other information that would help reviewers? Remove if none -->
   
   ### CI Skip Instructions
   <!--
   To skip CI builds, add the appropriate CI skip identifier to your PR title.
   The identifier must:
   - Be in square brackets []
   - Include the word "ci" and either "skip" or "no"
   - Only use for documentation-only changes or when absolutely necessary
   -->
   
   ---
   <!-- Join our community:
   - Mailing list: 
[[email protected]](https://lists.apache.org/[email protected])
 (subscribe: [email protected])
   - Discussions: https://github.com/apache/cloudberry/discussions -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to