This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/21372] New: “Cannot access memory at address” after catch syscall on Raspbian


https://sourceware.org/bugzilla/show_bug.cgi?id=21372

            Bug ID: 21372
           Summary: “Cannot access memory at address” after catch syscall
                    on Raspbian
           Product: gdb
           Version: 7.12
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: roman.mescheryakov at gmail dot com
  Target Milestone: ---

Created attachment 9983
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9983&action=edit
gdb_slave_player-7.7.1.typescript

I’m new to gdb and Linux, so please excuse me if my situation will appear to be
not a bug.
I’m investigating a performance issue with my Python script on a Raspberry Pi
3. It runs official Raspbian operating system that is adaptation of Debian for
Raspberry Pi mini-PC. I need to set catchpoint on a certain system call
(gettimeofday, also tried futex), so the need arises in using gdb and not the
Python debugger.
I installed python2.7-dbg package in order to have Python extensions for gdb:

sudo apt-get install python2.7-dbg

After that I run my script under gdb and issue “catch syscall gettimeofday”,
see gdb_slave_player-7.7.1.typescript file attached. After 1st breakpoint hit
and issuing the “continue” command 2 times, the following error message
appears:

Cannot access memory at address 0x76e3b964

If I examine the /proc/<PID>/maps file, I see that this address is indeed not a
part of my Python’s process address space.
After this error I see that my application is not running. If I issue
“continue” to gdb again, the following message is displayed:

Cannot execute this command while the selected thread is running.

And my script is still not running.
If I run that Python script under gdb without issuing “catch syscall”, the
program works well and gdb doesn’t output any errors.

I suppose this “Cannot access memory at address 0x76e3b964” error is a bug. My
expectation is that after “catch syscall” Python process runs without errors
and breakpoint is hit when corresponding system function is called.

Additional information:

GDB version: GNU gdb (Raspbian 7.7.1+dfsg-5+rpi1) 7.7.1

GDB configuration:
This GDB was configured as follows:
   configure --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/usr/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/lib/gdb (relocatable)
             --without-libunwind-ia64
             --with-lzma
             --with-python=/usr (relocatable)
             --with-separate-debug-dir=/usr/lib/debug (relocatable)
             --with-system-gdbinit=/etc/gdb/gdbinit
             --with-zlib
             --without-babeltrace

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)

“What compiler (and its version) was used to compile GDB” - I don’t know, I use
GDB preinstalled in Raspbian.

uname -a: Linux s21volnaya5 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017
armv7l GNU/Linux


After searching in Internet I found the "Raspbian GDB broken"
(https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=104827&p=1146299#p1146299)
forum post with instructions on how to compile and build newer GDB version on
Raspbian. I tried these steps and succeeded with new GDB version compiling and
installation, but the problem remained the same. See
gdb_slave_player-7.12.typescript file attached.

GDB version: GNU gdb (GDB) 7.12

GDB configuration:
This GDB was configured as follows:
   configure --host=armv7l-unknown-linux-gnueabihf
--target=armv7l-unknown-linux-gnueabihf
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/usr/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/lib/gdb (relocatable)
             --without-libunwind-ia64
             --without-lzma
             --with-python=/usr (relocatable)
             --without-guile
             --with-separate-debug-dir=/usr/lib/debug (relocatable)
             --without-babeltrace

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)

“What compiler (and its version) was used to compile GDB” - My GCC version is:
gcc (Raspbian 4.9.2-10) 4.9.2

I tried reporting this problem to Raspbian developers, see
https://github.com/raspberrypi/linux/issues/1956, but I was told the issue
should be reported to GDB developers. So I report this issue here. Please help!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]