Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

Intel MPX, unable to reproduce results in example

c_43
Beginner
494 Views

In trying to reproduce the example given by Ady Tal at https://software.intel.com/en-us/articles/debugging-applications-with-intel-sde#Linux I encounter the following problem:

Terminal 1:

$ ../sde-external-6.22.0-2014-03-06-lin/sde64 -mpx-mode -debug -- ./mpx_test3
Application stopped until continued from debugger.
Start GDB, then issue this command at the (gdb) prompt:
  target remote :44736


Terminal 2:

$ ../gdb-sde-x86-64-2013-09-07/linux/intel64/gdb/bin/gdb
GNU gdb (GDB) 7.5-4.0.61
Copyright (C) 2010 Free Software Foundation, Inc; (C) 2013 Intel Corp.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For information about how to find Technical Support, Product Updates,                          
User Forums, FAQs, tips and tricks, and other support information, please visit:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) target remote :44736
Remote debugging using :44736
0x00007fe57371d630 in ?? ()
=> 0x00007fe57371d630:  48 89 e7        mov    rdi,rsp
(gdb) b main
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or )


In other words I don't get the following: Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2


My test program is simply:

#include <stdio.h>

int main(int argc, char **argv)
{
    char overflow_buffer[512];
    int i;
    int limit = atoi(argv[1]);

    for(i = 0; i < limit; i++) {
        overflow_buffer = 0x41;
    }

    return 0;
}


In terminal 2 I have PYTHONHOME set to the directory with Python 2.7 included with the GDB-SDE package.

I compiled this program using: "$MPX_GCC/bin/gcc -B$MPX_BINUTILS/bin -fmpx -c" from here: https://software.intel.com/en-us/articles/using-intel-mpx-with-the-intel-software-development-emulator. My environment variables are set correctly.

0 Kudos
3 Replies
Michael_B_Intel2
Employee
494 Views

Have you build your app with debug information (-g flag)?

0 Kudos
c_43
Beginner
494 Views

Forgive me, yes; I've tried this, I omitted it as I just copy/pasted it from the example when writing the post. The result is the same with and without the -g argument on my system.

0 Kudos
c_43
Beginner
494 Views

The solution is of course to just give gdb the symbol table somehow. I had not done this (omitted the binary as argument to gdb). Ady does this correctly in the referenced example. It works now, either give gdb the symbol table with "file" or just give it as a command line argument when starting it. Everything works great now.

0 Kudos
Reply