[SERVER-27537] Seg fault with $max and $bucketAuto Created: 28/Dec/16  Updated: 28/Dec/16  Resolved: 28/Dec/16

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.4.0, 3.4.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Nathaniel May Assignee: David Storch
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File backtrace.txt    
Issue Links:
Duplicate
duplicates SERVER-25535 Remove injectExpressionContext() meth... Closed
Operating System: ALL
Participants:

 Description   

When going through M034 with MongoDB 3.4.1 on Mac OS X Yosemite v 10.10.5 I generated a seg fault on the server by running the following query on the following dataset. Backtrace attached. Seg fault also generated on 3.4.0. with the same query and dataset.

Dataset: https://university.mongodb.com/static/MongoDB_2016_M034_ondemand_v1/handouts/companies_dataset/companies.2a9d317cfa74.json

db.companies.aggregate( [
      {'$match': { 'number_of_employees' : {'$type': 'int'} }},
      { '$facet': {
        'Employees': [
          {'$bucketAuto': {
            'groupBy': '$number_of_employees',
            'buckets': 3,
            'granularity': '1-2-5',
            'output': {
		value: {$max: '$number_of_employees'}
          }
        }}],
    }
  }]).pretty()

However the same query replacing '$max' with '$sum' works just fine.

db.companies.aggregate( [
      {'$match': { 'number_of_employees' : {'$type': 'int'} }},
      { '$facet': {
        'Employees': [
          {'$bucketAuto': {
            'groupBy': '$number_of_employees',
            'buckets': 3,
            'granularity': '1-2-5',
            'output': {
		value: {$sum: "$number_of_employees"}
          }
        }}],
    }
  }]).pretty()



 Comments   
Comment by David Storch [ 28/Dec/16 ]

Yep, it's a duplicate. The fix has already been merged into the v3.4 branch under SERVER-25535 and will be shipped as part of 3.4.2.

Comment by Nathaniel May [ 28/Dec/16 ]

I can confirm that this is the same issue. Thanks, kyle.suarez.

Comment by Kyle Suarez [ 28/Dec/16 ]

This looks similar to SERVER-27395, which was closed as a duplicate of SERVER-25535, which fixes the problem. david.storch, could you please confirm?

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