[SERVER-33084] Aggregate with explain >= 'executionStats' attempts to serialize a disposed pipeline Created: 02/Feb/18  Updated: 29/Oct/23  Resolved: 05/Feb/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.7.2

Type: Bug Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2018-02-12
Participants:
Linked BF Score: 0

 Description   

The simplest repro is running the following agg explain:

coll.explain('executionStats').aggregate([{$project: {_id: 1}}, {$sort: {_id: 1}}]);

This will trigger an access violation when the explain path attempts to serialize the pipeline after executing the plan, which was disposed by the DocumentSourceSort stage. In the case above, the projection stage releases a unique_ptr when it's disposed, however that same pointer is de-referenced in its serialize method.



 Comments   
Comment by Githook User [ 05/Feb/18 ]

Author:

{'email': 'nicholas.zolnierz@mongodb.com', 'name': 'Nick Zolnierz', 'username': 'nzolnierzmdb'}

Message: SERVER-33084: Aggregate with explain >= 'executionStats' attempts to serialize a disposed pipeline
Branch: master
https://github.com/mongodb/mongo/commit/838420937dc71c8128a0b3b59f11fbe666762902

Generated at Thu Feb 08 04:32:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.