Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27626

Segfault when using $bucketAuto with $min in output

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.1
    • Component/s: Aggregation Framework
    • None
    • ALL
    • Hide

      1. Import companies.json (attached) to MongoDB 3.4.1 using mongoimport, as in the following:

      mongoimport -d startsup -c companies ~/Downloads/companies.json
      

      2. Run the following aggregation operation:

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

      3. Check the log to see that your mongod has segfaulted and shut itself down.

      Show
      1. Import companies.json (attached) to MongoDB 3.4.1 using mongoimport, as in the following: mongoimport -d startsup -c companies ~/Downloads/companies.json 2. Run the following aggregation operation: use startsup db.companies.aggregate( [ { '$match' : { 'number_of_employees' : { '$type' : ' int ' } }}, { '$bucketAuto' : { 'groupBy' : '$number_of_employees' , 'buckets' : 3, 'granularity' : '1-2-5' , 'output' : { 'value' : {$min: '$number_of_employees' } } }}]) 3. Check the log to see that your mongod has segfaulted and shut itself down.

      When I run the agg operation in the steps to reproduce, I get a segfault that kills my 3.4.1 mongod (this also happens on 3.4.0, unsurprisingly). This happens with the $min and $max accumulator expression; $stdDevPop and $stdDevSamp did not cause a segfault. I didn't try the other accumulator expressions.

      I've attached my fairly verbose log output for the backtrace.

        1. companies.json
          74.61 MB
          Allison Reinheimer Moore
        2. mongod.log
          215 kB
          Allison Reinheimer Moore

            Assignee:
            Unassigned Unassigned
            Reporter:
            allison.moore@mongodb.com Allison Reinheimer Moore (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: