Bug 12493 - GDB Singe-Step Error: Windows (MinGW) GDB 7.x Under certain conditions, attempts to Single Step result in the error: "Error accessing memory address 0xxxxxxxx: Input/output error"
Summary: GDB Singe-Step Error: Windows (MinGW) GDB 7.x Under certain conditions, atte...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: unknown
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-16 15:35 UTC by Richard C
Modified: 2013-04-05 09:12 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Project files to re-create error and log files (38.04 KB, application/zip)
2011-02-16 15:35 UTC, Richard C
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard C 2011-02-16 15:35:14 UTC
Created attachment 5245 [details]
Project files to re-create error and log files

DESCRIPTION OF PROBLEM:
GDB Singe-Step Error: Under certain conditions, cannot Single-Step using Windws (MinGW) GDB.  Breakpoints may be set and watch values update correctly, however attempts to Single Step (using the Code::Blocks toolbar button or F7) result in the error:
"Error accessing memory address 0xxxxxxxx: Input/output error"
It seems that only single-stepping is affected.  Breakpoints may be set at each line, and the program resumed at each breakpoint, which will allow a single-step equivalent debug process.
The problem does not occur with gdb 6.8, nor on Fedora 14 Linux(all versions).  All MinGW 7.1 and 7.2 versions MinGW I have tried have the problem.
See Full Discussion thread on Code::Blocks Forum: http://forums.codeblocks.org/index.php/topic,14193.0.html for more info

wxWidgets (2.8.11) project built in Code::Blocks IDE (10.05 and svn 6931)  XP Pro x64 2003 SP2

PROBLEM OCCURS WITH:
-tdm version ( from http://tdm-gcc.tdragon.net/ ) GNU gdb (GDB) 7.1
-http://sourceforge.net/projects/mingw/files/ using mingw-get-inst-20101030.exe GNU gdb (GDB) 7.2
-http://pcxprj.googlecode.com/files/MinGW_win32_gcc4.5.3static_snapshots.7z GNU gdb (GDB) 7.2.50.20110115
(For each of the above, the entire compiler/debugger/utils package was downloaded, and the project cleaned and rebuilt with the associated compiler before testing)

PROBLEM DOES NOT OCCUR WITH:
-MinGW packaged with Code::Blocks (10.05) GNU gdb 6.8
-Any gdb version in Fedora Linux

FILES IN ATTACHED ZIP:

-All the Code::Blocks project files in case they have any bearing on the problem (doubtful, several different projects with different settings have been created, all with the same problem.)
-portions of log files from various runs collected in a single file.
-two cpp source files: dcmain.cpp, dataclass.cpp
-Two .h header files)
-A0018.prn is a sample data file.

***************TO REPRODUCE PROBLEM, LOCATION OF DATA FILE IS CRITICAL***************:
-data file in parallel folder (up a level from the project file, then down a level into another folder) - the problem always occurs. (Example: project is in ../wxprojs/debugerror, data file is in ../wxprojs/otherfolder)
-data file in project folder -it usually works, although not always.  But immediately running it again can change the result from the previous run
-data file in parent folder - fairly random (Example: project is in ../wxprojs/debugerror, data file is in project is in ../wxprojs)

TO PRODUCE THE ERROR:
Set a breakpoint at line 227 in dataclass.cpp
 ( if(!DS[setnum].minmaxset[0]) return false; is the line)

Start the debugger, go to File|Open New ASCII and open A0018.prn (IN A 'PARALLEL' FOLDER - SEE ABOVE)
The debugger should stop at the breakpoint.  Use the single-step command. This should produce the memory access error.
Comment 1 tom.boddington 2013-04-03 09:42:30 UTC
Two years on, I am experiencing the very same issues and I see that nobody has been assigned to this bug. Please could somebody give it some attention?
Comment 2 Pedro Alves 2013-04-03 13:01:42 UTC
A minimal reproducer that just uses gdb (no codeblocks in the picture) would go a long way.  Please also try 7.5 and if possible the 7.6 release candidate (bugs in this area have been fixed in 7.6).
Comment 3 Pedro Alves 2013-04-03 13:05:05 UTC
BTW, that error usually indicates something wrong with gdb's software single-step implementation bit that decides what the PC will be after the instruction being stepped executes (in order to place a breakpoint there).

A disassemble of the code that is failed to step would be useful, along with perhaps a "set debug infrun 1" log.
Comment 4 asmwarrior 2013-04-05 06:19:58 UTC
Today, I'm testing the project in the attachment under WinXP, PCX's mingw gcc 4.6.3, and GDB CVS build myself, I don't see any issue. I guess such bug is fixed either in GCC or GDB. If you still meet such bug, please post a simple minimal test case.

Yuanhui Zhang (Code::Blocks developer)
Comment 5 Pedro Alves 2013-04-05 09:12:27 UTC
Thanks.  Closing as fixed then.  Please reopen if more info comes along.