diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2010-11-26 19:59:10 -0200 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2010-11-26 19:59:10 -0200 |
commit | 0008e06489cc3c346ee4ab62f89f20ac404f9472 (patch) | |
tree | 60dd85b3738059765520bb243a6626f1b7ec5a85 /client/mysqltest.cc | |
parent | a8680a58a1364a2ee5ca19d8a980c7eb5dc7f602 (diff) | |
download | mariadb-git-0008e06489cc3c346ee4ab62f89f20ac404f9472.tar.gz |
Bug#51817: incorrect assumption: thd->query at 0x2ab2a8360360 is an invalid pointer
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.
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r-- | client/mysqltest.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 4e03ad27246..e0575a1d638 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -7782,13 +7782,16 @@ static void dump_backtrace(void) { struct st_connection *conn= cur_con; - my_safe_print_str("read_command_buf", read_command_buf, - sizeof(read_command_buf)); + fprintf(stderr, "read_command_buf (%p): ", read_command_buf); + my_safe_print_str(read_command_buf, sizeof(read_command_buf)); + if (conn) { - my_safe_print_str("conn->name", conn->name, conn->name_len); + fprintf(stderr, "conn->name (%p): ", conn->name); + my_safe_print_str(conn->name, conn->name_len); #ifdef EMBEDDED_LIBRARY - my_safe_print_str("conn->cur_query", conn->cur_query, conn->cur_query_len); + fprintf(stderr, "conn->cur_query (%p): ", conn->cur_query); + my_safe_print_str(conn->cur_query, conn->cur_query_len); #endif } fputs("Attempting backtrace...\n", stderr); |