What does "AllK required contiguous memory" mean in gdb?

Viewed 16

On a program that I'm debugging with gdb in MINGW64 under Windows 10, I got the following warning:

 gdb --args ./myprogram.exe
GNU gdb (GDB) 12.1
...
Reading symbols from ./myprogram.exe...
(gdb) r
Starting program: C:\test\myprogram.exe
[New Thread 11460.0x4e38]
[New Thread 11460.0x4a60]
[New Thread 11460.0x2eac]
warning:
warning: AllK required contiguous memory = 675016 (64bit)
warning:   8 HotK Handles: HandleSize 2112 PoolSize 16912 (bytes)
warning:   64 LstK Handles: HandleSize 64 PoolSize 4112 (bytes)
warning:   2048 LstInfoK Handles: HandleSize 64 PoolSize 131088 (bytes)
warning:   128 UsbK Handles: HandleSize 96 PoolSize 12304 (bytes)
warning:   64 DevK Handles: HandleSize 112 PoolSize 7184 (bytes)
warning:   2048 OvlK Handles: HandleSize 104 PoolSize 213008 (bytes)
warning:   64 OvlPoolK Handles: HandleSize 96 PoolSize 6160 (bytes)
warning:   32 StmK Handles: HandleSize 176 PoolSize 5648 (bytes)
warning:   2048 IsochK Handles: HandleSize 136 PoolSize 278544 (bytes)
warning:
warning: Dynamically allocated as needed:
warning:        KLST_DEVINFO = 2596 bytes each
[New Thread 11460.0x24bc]
...

Where does this "banner" text with "warning: AllK required contiguous memory " come from - is it something gdb prints out, or is it some underlying Windows system dll?

And what is the meaning of this - and why is it a warning?

For instance, if it says "warning: AllK required contiguous memory = 675016 (64bit)" - why is it a warning? Is 675016 bytes of contiguous memory too much to ask for - and if so, what is the limit?

My guess is "AllK" probably refers to All Kernel objects (or handles?) - so this probably has to do with drivers (kernel objects); but still, it would be much better to know exactly what this means (rather than speculate with "probably") ...

1 Answers

OK, I think I found it - this comes from the libusbK driver, specifically in function LibK_Context_Init, where we have:

...
    processHeap = GetProcessHeap();
    ErrorMemory(processHeap == NULL, Error);

    AllK = HeapAlloc(processHeap, HEAP_ZERO_MEMORY, sizeof(ALLK_CONTEXT));
    ErrorMemory(AllK == NULL, Error);
...
    // one-time AllK initialize
    USBLOG_PRINTLN("");
    USBLOG_PRINTLN("AllK required contiguous memory = %u (%sbit)", sizeof(ALLK_CONTEXT), sizeof(PVOID) == 8 ? "64" : "32");
    ALLK_DBG_PRINT_SECTION(HotK);
    ALLK_DBG_PRINT_SECTION(LstK);
    ALLK_DBG_PRINT_SECTION(LstInfoK);
    ALLK_DBG_PRINT_SECTION(UsbK);
    ALLK_DBG_PRINT_SECTION(DevK);
    ALLK_DBG_PRINT_SECTION(OvlK);
    ALLK_DBG_PRINT_SECTION(OvlPoolK);
    ALLK_DBG_PRINT_SECTION(StmK);
    ALLK_DBG_PRINT_SECTION(IsochK);
    USBLOG_PRINTLN("");

... where:

#define ALLK_DBG_PRINT_SECTION(AllKSection) \
    USBLOG_PRINTLN("  %u %s Handles: HandleSize %u PoolSize %u (bytes)",(sizeof(AllK->AllKSection.Handles)/sizeof(AllK->AllKSection.Handles[0])),DEFINE_TO_STR(AllKSection),sizeof(AllK->AllKSection.Handles[0]), sizeof(AllK->AllKSection))

So, my guess is gdb added the word "warning:" - the original libusbK printout does not contain it; otherwise, if there was a problem with memory allocation, things would have failed in libusbK before we even get to the printing of this text.

I think I understand this now - but if someone knows better, please post an answer ...

Related