Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #4335
Closed
Open
Issue created Jun 25, 2020 by Administrator@rootContributor

Allocation of more than 2GB in unreachable heap causes out of memory errror

Created by: SweetVishnya

How to reproduce

This reproduces on both Linux x86-32 and x86-64.

Just allocate more than 2GB from dr_client_main with malloc:

    int *tmp = 0;
    int cnt = 0;
    for (int i = 0; i != 4 * 96086; ++i)
    {
        tmp = (int *) malloc(30000);
        ++cnt;
        std::cout << cnt << std::endl;
        for (int j = 0; j != 30000 / sizeof(int); ++j)
        {
            tmp[j] = i * 43;
        }
    }
    std::cout << "Do not optimize out malloc " << tmp[20] << std::endl;

Run debug:

dynamorio/bin64/drrun -debug -c client.so -- /bin/ls

Get an error:

<Out of vmheap reservation - reserving 256KB. Falling back onto OS allocation>
<CURIOSITY : (0) && "Out of vmheap reservation" in file /home/vishnya/dynamorio/core/heap.c line 1614
<Out of memory - cannot reserve 256KB. Trying to recover.>
<Out of memory.  Program aborted.>
<OOM Status: R 0x0000000000000001>

What goes wrong

When unreachable memory size reaches first 2GB it tries to ask more memory from system. But this code fails and leads to out of memory.

Assignee
Assign to
Time tracking