wang-jiahua opened a new pull request, #10566:
URL: https://github.com/apache/rocketmq/pull/10566

   ### Which Issue(s) This PR Fixes
   
   Fixes #10288
   
   ### Brief Description
   
   ConsumeQueue.putMessagePositionInfo() accesses MappedFile without holding a 
reference count. A concurrent cleanExpiredConsumeQueue can destroy() the 
MappedFile (unmapping its buffer) while the writer is still using it, causing 
SIGSEGV in JIT-compiled Unsafe.copyMemory.
   
   Fix: Call mappedFile.hold() before accessing the buffer and release() in a 
finally block, following the same pattern used in DefaultMappedFile.getData(). 
Also protect the fillPreBlank call in initializeWithOffset.
   
   ### How Did You Test This Change
   
   Existing ConsumeQueueTest (17 tests) all pass. The fix was validated during 
server benchmarking where the baseline broker crashed with SIGSEGV in 
ReputMessageService at ConsumeQueue.putMessagePositionInfo — exactly the crash 
signature reported in #10288.


-- 
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]

Reply via email to