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

Uncaught alloc Exception in Snappy on Windows

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.0-rc9
    • Component/s: Storage, WiredTiger
    • Environment:
      Windows Server 2012 R2
    • Fully Compatible
    • Windows
    • Hide

      manually throw a std::bad_alloc() in place of

          if (scratch_output == NULL) {
            scratch_output = new char[max_output];
          }
      

      around line 945 in snappy.cc.

      We may need to keep a counter to only throw after 50 or so calls, otherwise WT won't start.

      Show
      manually throw a std::bad_alloc() in place of if (scratch_output == NULL) { scratch_output = new char[max_output]; } around line 945 in snappy.cc. We may need to keep a counter to only throw after 50 or so calls, otherwise WT won't start.

      snappy.cc could throw an exception if an allocation for a char array fails in the function "Compress". This exception is not caught.

      There's a code review for a different change that affects this line of code but does not address this issue.
      link to CR here: http://codereview.10gen.com/6078463630901248/patch/5629499534213120/5066549580791808
      link to SERVER ticket here: SERVER-17299

      This only affects Windows since other OSes don't use this function.

      mongod log is attached in the comments

            Assignee:
            michael.cahill@mongodb.com Michael Cahill (Inactive)
            Reporter:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: