Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Cannot access memory at address 0x0
Cannot access memory at address 0x0 [message #658825] Wed, 09 March 2011 22:41 Go to next message
hefeweizen  is currently offline hefeweizen
Messages: 32
Registered: July 2009
Member
I get this error message while debugging a C++ code in Helios CDT under Ubuntu Linux 9.1. I just do not understand why. The same code can be debugged directly with gdb (7.0, the one that eclipse uses) without issues. Can you help me? I am considering about giving up eclipse ... I tried with the mac vesion and too many problems but I did not expect it so buggy for linux
Re: Cannot access memory at address 0x0 [message #658868 is a reply to message #658825] Thu, 10 March 2011 07:58 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1964
Registered: July 2009
Senior Member
When does this error message encounter? Can you show the gdb traces? Do you use DSF backend for gdb in Eclipse (recommended)?

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Cannot access memory at address 0x0 [message #658891 is a reply to message #658868] Thu, 10 March 2011 10:32 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen
Messages: 32
Registered: July 2009
Member
yes, I have DSF backend. Just a short and maybe stupid question; how can I show the gdb traces in eclipse?
Re: Cannot access memory at address 0x0 [message #658932 is a reply to message #658891] Thu, 10 March 2011 13:43 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1964
Registered: July 2009
Senior Member
Windows->Preferences->C/C++->Debug->GDB->Enable gdb traces
You will have then an additional console window called gdb traces.



Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Cannot access memory at address 0x0 [message #658965 is a reply to message #658932] Thu, 10 March 2011 15:12 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen
Messages: 32
Registered: July 2009
Member
I activated that option, but no window called "gdb traces" appears. Should I install additional plugins? or how can I tell eclipse to show this window? Under Windows, view, debug, that options does not appear neither
Re: Cannot access memory at address 0x0 [message #658967 is a reply to message #658965] Thu, 10 March 2011 15:16 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen
Messages: 32
Registered: July 2009
Member
Ok, I've found that window, was not clear to me how to find it.
Re: Cannot access memory at address 0x0 [message #658968 is a reply to message #658868] Thu, 10 March 2011 15:21 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen
Messages: 32
Registered: July 2009
Member
Ok, when the error occurrs, these are the last lines shown in the console gdb traces:

........
314,327 478-stack-info-depth --thread 1
314,328 478^done,depth="1"
314,328 (gdb)
314,329 479-var-update 1 var6
314,329 480-var-update 1 var7
314,329 481-var-update 1 var5
314,331 479^done,changelist=[]
314,331 (gdb)
314,331 480^done,changelist=[]
314,331 (gdb)
314,331 481^done,changelist=[]
314,331 (gdb)
326,530 482-exec-next --thread 1 1

does it give any hint?
where can I find more info about what these numbers mean?
Re: Cannot access memory at address 0x0 [message #658971 is a reply to message #658968] Thu, 10 March 2011 15:24 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen
Messages: 32
Registered: July 2009
Member
when I quit the debuggin session I aslo get:

Cannot access memory at address 0x0
Cannot access memory at address 0x0
/build/buildd/gdb-7.0/gdb/inferior.c:43: internal-error: current_inferior: Assertion `inf' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
/build/buildd/gdb-7.0/gdb/inferior.c:43: internal-error: current_inferior: Assertion `inf' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]


Re: Cannot access memory at address 0x0 [message #659004 is a reply to message #658968] Thu, 10 March 2011 16:33 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1964
Registered: July 2009
Senior Member
hefeweizen wrote on Thu, 10 March 2011 16:21
Ok, when the error occurrs, these are the last lines shown in the console gdb traces:

........
314,327 478-stack-info-depth --thread 1
314,328 478^done,depth="1"
314,328 (gdb)
314,329 479-var-update 1 var6
314,329 480-var-update 1 var7
314,329 481-var-update 1 var5
314,331 479^done,changelist=[]
314,331 (gdb)
314,331 480^done,changelist=[]
314,331 (gdb)
314,331 481^done,changelist=[]
314,331 (gdb)
326,530 482-exec-next --thread 1 1

does it give any hint?
where can I find more info about what these numbers mean?


Did you set a breakpoint when the error occurred? Or did you hit a breakpoint?
I once got this error when I set a breakpoint on a static inlined function. But in my case I also got this error on the command line gdb.


Quote:
/build/buildd/gdb-7.0/gdb/inferior.c:43: internal-error: current_inferior: Assertion `inf' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

Might be a bug in gdb see http://server1.sourceware.org/ml/gdb-patches/2010-12/msg0003 1.html



Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Cannot access memory at address 0x0 [message #659011 is a reply to message #659004] Thu, 10 March 2011 16:54 Go to previous messageGo to next message
hefeweizen  is currently offline hefeweizen
Messages: 32
Registered: July 2009
Member
It happened two lines after a breakpoint was hit.

If I run directly gdb on the shell, I do not get this problem, independetly of static inlined function or not. So it means to me that this is an error in how eclipse "calls" gdb.

This happens under internal DSF/GDB, as I selected this option and the error talks about

/build/buildd/gdb-7.0/gdb/inferior.c

You give a link with some patch for gdb. I am not going to try this. I found problems in mac and thought "ok, this is because nobody uses eclipse on mac", and then tried linux version. Now I find this error. I means to me that a default installation of eclipse helios in ubuntu linux 9.1 (widely used distribution), does not allow to debug in normal conditions (the program I am working with is very simple).

Can you suggest a solution here? (i.e. not patching internal's eclipse gdb)

Otherwise I am giving up for eclipse, this is too much.

What I find amazing the most, is that nobody found this errors or it seems that nobody is using debugging. The same code can be perfecly debugged in Visual Studio, which I want to forget about.


Re: Cannot access memory at address 0x0 [message #659077 is a reply to message #659011] Thu, 10 March 2011 21:46 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1964
Registered: July 2009
Senior Member
Quote:
Cannot access memory at address 0x0
It happened two lines after a breakpoint was hit.

Did you hover with the mouse over a variable or is there anything in your expression view? Looks like you want to dereference a null pointer. Can you continue debugging? This message should do no harm.
Do you try to debug an optimized build?

Quote:
..and then tried linux version. Now I find this error. I means to me that a default installation of eclipse helios in ubuntu linux 9.1 (widely used distribution), does not allow to debug in normal conditions (the program I am working with is very simple).

I am using Eclipse and gdb on Linux on a daily basis for more than 5 years. I am very satisfied with it and encounter only seldom some problems.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Cannot access memory at address 0x0 [message #659145 is a reply to message #659077] Fri, 11 March 2011 09:46 Go to previous message
hefeweizen  is currently offline hefeweizen
Messages: 32
Registered: July 2009
Member
When it happens, and I hover over values, there are no values. The "step" icons are highlighted, I can click on them, but nothing happens. And after the second time, the only option is to click on the "terminate" icon.

I feel probably it is due to my particular code, which being proprietay, I can not show here. I will use eclipse for everything but for debugging.

Congratulations for your 1000th post!

Previous Topic:updating makefile after renaming source file
Next Topic:Include partial path names in source files
Goto Forum:
  


Current Time: Fri Oct 24 10:23:26 GMT 2014

Powered by FUDForum. Page generated in 0.02763 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software