Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13635

.NET: OOM due to integer overflow in PlatformOutputStream

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.4, 2.9
    • Fix Version/s: None
    • Component/s: platforms
    • Labels:

      Description

      PlatformOutputStreamImpl.unsafeEnsure causes integer overflow, then passes a negative value to PlatformCallbackGateway.memoryReallocate from there it is passed to Marshal.ReAllocHGlobal, which throws an OutOfMemoryException.

      Reproducer:

      var val = new byte[100_000_000];
      var ignite = Ignition.Start();
      var cache = ignite.CreateCache<int, byte[]>("c");
      
      for (int i = 0; i < 30; i++) // ~3GB of cache data
          cache[i] = val;
      
      cache.Query(new ScanQuery<int, byte[]>()).GetAll();
      

      We should handle this condition gracefully: detect stream size limit and throw an exception explaining how to fix the problem (use smaller pageSize for queries, for example).

        Attachments

          Activity

            People

            • Assignee:
              ptupitsyn Pavel Tupitsyn
              Reporter:
              ptupitsyn Pavel Tupitsyn
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: