[CDRIVER-1208] /bson/iter/test_fuzz intermittent failures Created: 21/Apr/16  Updated: 10/Aug/16  Resolved: 25/Apr/16

Status: Closed
Project: C Driver
Component/s: libbson, tests
Affects Version/s: None
Fix Version/s: 1.4.0

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


 Description   

The libbson tests' built-in fuzz test has begun failing occasionally, perhaps especially (or only?) on 32-bit Windows. E.g.:

Assertion failed: child_len >= 5, file C:\data\mci\mongo-c-driver\src\libbson\tests\test-iter.c, line 262

What is the purpose of the test? Do its failures reveal bugs in libbson or in the test? Are its failures becoming more common recently for some reason? Is it more common on 32-bit Windows, and why?



 Comments   
Comment by Githook User [ 25/Apr/16 ]

Author:

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

Message: CDRIVER-1208 bad assumption in fuzz test

The fuzz test iterates random bytes as if they were bson. It can hit an
element of type "document" with length-prefix 0 and assert.
Branch: master
https://github.com/mongodb/libbson/commit/15b4c9d396f72c9ddec5f3cd366285ddeda30636

Comment by A. Jesse Jiryu Davis [ 21/Apr/16 ]

Can reproduce one of the failures, with Visual Studio 12 32-bit, by updating TestSuite_SeedRand:

static void
TestSuite_SeedRand (TestSuite *suite, /* IN */
                    Test *test)       /* IN */
{
   test->seed = 1461209255;
   return;
}

Now:

 ./Debug/test-libbson.exe --no-fork -d -l /bson/iter/test_fuzz
{
  "host": {
    "sysname": "Windows",
    "release": "6.1 (7601)",
    "machine": "586",
    "memory": {
      "pagesize": 4096,
      "npages": 0
    }
  },
  "options": {
    "parallel": false,
    "fork": false
  },
  "results": [
Begin /bson/iter/test_fuzz
Assertion failed: child_len >= 5, file C:\data\mci\mongo-c-driver\src\libbson\tests\test-iter.c, line 262

Comment by A. Jesse Jiryu Davis [ 21/Apr/16 ]

Seen on 64-bit Windows too.

Comment by Hannes Magnusson [ 21/Apr/16 ]

I've also seen it fail on the solaris variant

Generated at Wed Feb 07 21:11:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.