• Davi Arnaut's avatar
    Bug#51817: incorrect assumption: thd->query at 0x2ab2a8360360 is an invalid pointer · 0008e064
    Davi Arnaut authored
    The problem is that the logic which checks if a pointer is
    valid relies on a poor heuristic based on the start and end
    addresses of the data segment and heap.
    
    Apart from miscalculating the heap bounds, this approach also
    suffers from the fact that memory can come from places other
    than the heap. See Bug#58528 for a more detailed explanation.
    
    On Linux, the solution is to access the process's memory
    through /proc/self/task/<tid>/mem, which allows for retrieving
    the contents of pages within the virtual address space of
    the calling process. If a address range is not mapped, a
    input/output error is returned.
    0008e064
mysqld.cc 324 KB