[SERVER-54482] Crash if undefined is passed in collation.backwards parameter Created: 12/Feb/21  Updated: 29/Oct/23  Resolved: 15/Feb/21

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-52538 Update IDL definition for create command Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:
Linked BF Score: 16

 Description   

Start mongod and execute:

db.batch_write_collation_estsize.bulkWrite([{
    updateOne: {
        filter: { str: 'FOO' },
        update: { $set: { str: 'BAR' } },
        collation: {
            locale: 'en_US',
            caseLevel: false,
            caseFirst: 'off',
            strength: 3,
            alternate: 'non-ignorable',
            maxVariable: 'punct',
            normalization: false,
            backwards: undefined
        }
    }
}])

(This code was generated by the JS fuzzer.)
mongod crashes:

"msg":"Invariant failure","attr":{"expr":"collation->getBackwards().is_initialized()","file":"src/mongo/db/query/collation/collator_factory_icu.cpp","line":399



 Comments   
Comment by Githook User [ 15/Feb/21 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-54482 Fix crash if collation.backwards param is undefined/null
Branch: master
https://github.com/mongodb/mongo/commit/16aff18cbb6b993ac325a50a59b1898d35cf08c3

Generated at Thu Feb 08 05:33:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.