Repository navigation
Cherry pick #125505 to 26.3: Fix a possible segmentation fault in AvroConfluent when reading an Avro map into a Map column - #125932
Conversation
AvroConfluentRowInputFormat::getOrCreateDeserializer built a stack-local AvroDeserializer and moved it into deserializer_cache. The AVRO_MAP key closure created while constructing it captures `this` (#48119), and moving a std::function keeps that pointer, so every map key read `settings` through the frame of the returned function: stack-use-after-return under ASan for any key type, and a segfault for key types whose text parser dereferences FormatSettings (DateTime, Date, ...) on some builds. #104751 already replaced the copy into the cache by a move to keep the other self-reference (references into symbolic_skip_fn_map) valid. Finish it: delete the move constructor and construct the cache entry in place with try_emplace; unordered_map never relocates its nodes, so both self-references stay valid, and relocating the object no longer compiles. Closes #125457 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test reserved a port by binding port 0 in one process, closing it and binding the same number again in the schema registry process; a parallel process could take the port in between. The registry now binds port 0 itself and writes the port it got to a file (atomically, via os.replace), and the test waits for that file. TCPServer binds and listens in its constructor, so the server accepts connections as soon as the file exists. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The port file name depended only on CLICKHOUSE_TEST_UNIQUE_NAME. Under a fixed `--database` (the stress test's odd workers loop tests that way) a file left by a SIGKILLed earlier run was read before the new registry published its port, so the query hit a dead port. mktemp makes the name unique per run, as in 04615_kill_query_url_function.sh. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cached-deserializer Fix a possible segmentation fault in `AvroConfluent` when reading an Avro `map` into a `Map` column
…onflict The only conflict is in `AvroConfluentRowInputFormat::getOrCreateDeserializer`. On master the `getSchema` call takes the registry timeouts and retry settings added by #101935 (AvroConfluent output format), which is not on 26.3. Resolution: keep 26.3's one-argument `schema_registry->getSchema(schema_id)` and take #125505's change as is: build the cached `AvroDeserializer` in place with `try_emplace` instead of moving a stack-local one into the cache. The header and the test are unchanged from the PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflict resolved; the resolution is on my forkThe only conflict is in Checked on a local 26.3 ASan build (clang-21): I have Tip |
Original pull-request #125505
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job