RockteMQ-AI commented on issue #10288: URL: https://github.com/apache/rocketmq/issues/10288#issuecomment-5327932379
**Issue Evaluation** Category: `bug` | Status: **Confirmed** The reported SIGSEGV crash in the ConsumeQueue write path is a valid concurrency bug. The root cause is that `ReputMessageService` writes to a `MappedByteBuffer` via `putMessagePositionInfo` while `cleanExpiredConsumeQueue` (running on `AdminBrokerThread`) can `munmap` the same MappedFile concurrently. There is no reference-counting or read-write locking between the dispatch writer and the cleaner. **Root Cause:** Missing reference counting / lifecycle guard on `MappedFile` — the cleaner can `munmap` a buffer that is still being written to by `ReputMessageService`. **Impact:** Fatal JVM crash (SIGSEGV) in production. Data loss risk if the crash corrupts ConsumeQueue state. **Severity:** Critical Suggested fix directions: 1. Add reference counting to `MappedFile` so `munmap` is deferred until all writers release. 2. Alternatively, use a `ReentrantReadWriteLock` to serialize dispatch writes against cleanup. 3. Add a guard in `cleanExpired()` to check if the MappedFile is currently held by `ReputMessageService`. --- *Automated evaluation by RockteMQ-AI* -- 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]
