johnsonjh / duma

duma: Detect Unintended Memory Access (D.U.M.A.) - A Red-Zone memory allocator
https://github.com/johnsonjh/duma
GNU General Public License v2.0
99 stars 10 forks source link

What does DUMA_FAIL_ENV mean? #171

Open sdbbs opened 2 years ago

sdbbs commented 2 years ago

In gdb (under Cygwin), I got:

[Switching to Thread 13604.0x396c]
0x000000010056b969 in _duma_allocate (alignment=1, userSize=32, protectBelow=0, fillByte=0, protectAllocList=1,
    allocator=EFA_CALLOC, fail=DUMA_FAIL_ENV,
    filename=0x1005f21c0 <unknown_file> "UNKNOWN (use #include \"duma.h\")", lineno=0) at duma.c:1435
1435              if ( DUMAST_EMPTY == slot->state )

Since I couldn't quite figure out what DUMA_FAIL_ENV, I did a grep -r DUMA_FAIL_ENV . in the source directory, but I could find no mentions of it in common language; best I could find is this in duma.h:

    enum _DUMA_FailReturn
    {
      DUMA_FAIL_NULL
    , DUMA_FAIL_ENV
    };

I could intepret DUMA_FAIL_NULL as "the failure that happens, when you try to allocate memory, but get a null pointer instead, which means the memory allocation failed" - but I have a hard time understanding what DUMA_FAIL_ENV means.

Could anyone make a note about what the meaning of DUMA_FAIL_ENV is?

johnsonjh commented 2 years ago

Will update documentation