Jump to page: 1 2 3
Thread overview
Um. "Error: Access Violation", no other information, doesn't even ask if I want to debug it, etc.
Mar 24, 2004
SL
Mar 24, 2004
C
Mar 25, 2004
SL
Mar 26, 2004
Russ Lewis
Mar 26, 2004
J Anderson
Mar 26, 2004
Russ Lewis
Re: assert + if + double standards
Mar 26, 2004
J Anderson
[Suggestion] Re: Um. "Error: Access Violation", no other information, doesn't even ask if I want to debug it, etc.
Mar 29, 2004
Stewart Gordon
Mar 30, 2004
Manfred Nowak
Re: Um.
Mar 24, 2004
larry cowan
Mar 24, 2004
Ilya Minkov
Mar 25, 2004
J C Calvarese
Mar 25, 2004
Dave Sieber
Mar 25, 2004
Phill
Re: Debuggers (was "Error: Access Violation")
Mar 25, 2004
J C Calvarese
Mar 25, 2004
Dave Sieber
Mar 25, 2004
C
Mar 25, 2004
Dave Sieber
Mar 25, 2004
C
Mar 26, 2004
Dave Sieber
Mar 26, 2004
C
Mar 26, 2004
Dave Sieber
Mar 26, 2004
C
Mar 26, 2004
Dave Sieber
Mar 25, 2004
SL
Mar 25, 2004
Andy Friesen
Mar 25, 2004
SL
Mar 26, 2004
C
March 24, 2004
So I'm running the debug version of this program here I just compiled, and I get "Error: Access Violation", no other information, doesn't even ask if I want to debug it, the program just prints that and exits.

It was compiled with the following command:
dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more

I attempted to debug it with VCPP6SE, but it didn't seem to find any symbols and showed me a disassembly of the program, which I was disinclined to try to trace through - I compiled it debug and all that for a reason. :/

I wonder if it's trying to access this object before it's initialized... *adds checks* nope.

I wonder if it's because of the synchronized(someobjecthere) {} stuff which was accessing said object... *comments them out* nope.

Hmmm. Oh how I wish that "Error: Access Violation" was an exception which would give me filenames and line numbers. *continues fiddling to try to find the cause*
March 24, 2004
I usually get this error when forgetting to 'new' something.  But i feel your pain, this single oversight could cause hours of searching , almost nullifying the reduced development time of using D :/.  I think someone mentioned something about the error messages getting beefed next release <crosses fingers> .

OT, id like to learn about the math they use for astrononmy ( this.getHE=mass*sunHU*(1/(pow(pow(1.9,(uint)orbit),2))); ) , is there a good book you can recommend for a complete newb ?  Is it possible I can take a look at your code ?

Thanks,
Charlie

On Wed, 24 Mar 2004 13:20:09 -0500, SL <shadowlord13@users.sourceforge.net> wrote:

> So I'm running the debug version of this program here I just compiled, and I get "Error: Access Violation", no other information, doesn't even ask if I want to debug it, the program just prints that and exits.
>
> It was compiled with the following command:
> dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more
>
> I attempted to debug it with VCPP6SE, but it didn't seem to find any symbols and showed me a disassembly of the program, which I was disinclined to try to trace through - I compiled it debug and all that for a reason. :/
>
> I wonder if it's trying to access this object before it's initialized... *adds checks* nope.
>
> I wonder if it's because of the synchronized(someobjecthere) {} stuff which was accessing said object... *comments them out* nope.
>
> Hmmm. Oh how I wish that "Error: Access Violation" was an exception which would give me filenames and line numbers. *continues fiddling to try to find the cause*



-- 
D Newsgroup.
March 24, 2004
Might try the old C coder's method of dropping in printf's as traces to isolate where it's happenning.  In general, D seems to do a decent job of flushing so fprintf to stderr hasn't been necessary for me yet... Good luck.

In article <c3sjf3$8i4$1@digitaldaemon.com>, SL says...
>
>So I'm running the debug version of this program here I just compiled, and I get "Error: Access Violation", no other information, doesn't even ask if I want to debug it, the program just prints that and exits.
>
>It was compiled with the following command:
>dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d
>windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more
>
>I attempted to debug it with VCPP6SE, but it didn't seem to find any symbols and showed me a disassembly of the program, which I was disinclined to try to trace through - I compiled it debug and all that for a reason. :/
>
>I wonder if it's trying to access this object before it's initialized... *adds checks* nope.
>
>I wonder if it's because of the synchronized(someobjecthere) {} stuff which was accessing said object... *comments them out* nope.
>
>Hmmm. Oh how I wish that "Error: Access Violation" was an exception which would give me filenames and line numbers. *continues fiddling to try to find the cause*


March 24, 2004
I think i was able to do a few steps (at least as to get line number) with OpenWatcom compiler. Walter also recommands MS's windbg.exe

That you see assembly may be caused by 2 further reasons:
- debugger cannot find the source or
- you traced into a non-debug library right from the beginning. you might want to step out of it.

-eye

SL schrieb:

> So I'm running the debug version of this program here I just compiled, and I get "Error: Access Violation", no other information, doesn't even ask if I want to debug it, the program just prints that and exits.
> 
> It was compiled with the following command:
> dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more
> 
> I attempted to debug it with VCPP6SE, but it didn't seem to find any symbols and showed me a disassembly of the program, which I was disinclined to try to trace through - I compiled it debug and all that for a reason. :/
> 
> I wonder if it's trying to access this object before it's initialized... *adds checks* nope.
> 
> I wonder if it's because of the synchronized(someobjecthere) {} stuff which was accessing said object... *comments them out* nope.
> 
> Hmmm. Oh how I wish that "Error: Access Violation" was an exception which would give me filenames and line numbers. *continues fiddling to try to find the cause*
March 25, 2004
SL wrote:
> So I'm running the debug version of this program here I just compiled, and I get "Error: Access Violation", no other information, doesn't even ask if I want to debug it, the program just prints that and exits.
> 
> It was compiled with the following command:
> dmd.exe spacesim.d mt.d webinterface.d winutil.d socket.d winsock.d windows.d ws2_32.lib D_SpaceSim.exe -debug -g -gt -unittest | more
> 
> I attempted to debug it with VCPP6SE, but it didn't seem to find any symbols and showed me a disassembly of the program, which I was disinclined to try to trace through - I compiled it debug and all that for a reason. :/
> 
> I wonder if it's trying to access this object before it's initialized... *adds checks* nope.
> 
> I wonder if it's because of the synchronized(someobjecthere) {} stuff which was accessing said object... *comments them out* nope.
> 
> Hmmm. Oh how I wish that "Error: Access Violation" was an exception which would give me filenames and line numbers. *continues fiddling to try to find the cause*


Aside form not new-ing objects, another common way to get an Access Violation is faulty printf code as described on this page:
http://www.wikiservice.at/wiki4d/wiki.cgi?FaqRoadmap#ErrorAccessViolationonprintingastring

Without seeing any code, it's hard to say what the problem is.

Like Larry suggested, sprinkling printf's all you code is probably the best way to track down the problem:

   printf("Reached line 10\n");
   ...
   printf("Reached line 30\n");
   ...
   printf("Reached line 50\n");

You could also use assert to make sure what you think is true, is true.

-- 
Justin
http://jcc_7.tripod.com/d/
March 25, 2004
J C Calvarese <jcc7@cox.net> wrote:

> Like Larry suggested, sprinkling printf's all you code is probably the best way to track down the problem:
> 
>     printf("Reached line 10\n");
>     ...
>     printf("Reached line 30\n");
>     ...
>     printf("Reached line 50\n");
> 
> You could also use assert to make sure what you think is true, is true.

PMJI, but as I am just taking a first look at D, does this mean that there is no debugger at this time? I did the above back in the 80s when I first learned C. I'm not sure I want to go back to that decade again :-)

-- 
dave
March 25, 2004
I think you can also get this when you havent
set the length on an array, and then try to
access it.

I haven't got the latest version though.

Phill.


"Dave Sieber" <dsieber@spamnot.sbcglobal.net> wrote in message news:Xns94B6DDDF2D6FFdsiebersbc@63.105.9.61...
> J C Calvarese <jcc7@cox.net> wrote:
>
> > Like Larry suggested, sprinkling printf's all you code is probably the best way to track down the problem:
> >
> >     printf("Reached line 10\n");
> >     ...
> >     printf("Reached line 30\n");
> >     ...
> >     printf("Reached line 50\n");
> >
> > You could also use assert to make sure what you think is true, is true.
>
> PMJI, but as I am just taking a first look at D, does this mean that there is no debugger at this time? I did the above back in the 80s when I first learned C. I'm not sure I want to go back to that decade again :-)
>
> --
> dave


March 25, 2004
Dave Sieber wrote:
[snip]
> PMJI, but as I am just taking a first look at D, does this mean that there is no debugger at this time? I did the above back in the 80s when I first learned C. I'm not sure I want to go back to that decade again :-)

Even for the sake of nostalgia? ;)

I don't use a debugger with D yet, but it's supposed to be possible. Here's what Walter wrote back in January...


"Is there some program available that supports D debugging info?" -- imr1984

"Any debugger that uses standard debugging information. If using linux, you can use gdb. If using Windows, you can use, for example, Microsoft's windbg.exe program (which comes on the DMC++ CD)." -- Walter

http://www.digitalmars.com/drn-bin/wwwnews?D/22036

-- 
Justin
http://jcc_7.tripod.com/d/
March 25, 2004
Pet rock, flock of seagulls, the brat pack .... spandex....whats not to love! :)
hehe no debugger though.  You can use windbg if ur familiar with asm , also the IDDE on the CD has some debugging capabilities.  To get source interaction i think the linker needs to create .pdb files ( dont quote me though ).

C


On Thu, 25 Mar 2004 05:48:39 +0000 (UTC), Dave Sieber <dsieber@spamnot.sbcglobal.net> wrote:

> J C Calvarese <jcc7@cox.net> wrote:
>
>> Like Larry suggested, sprinkling printf's all you code is probably the
>> best way to track down the problem:
>>
>>     printf("Reached line 10\n");
>>     ...
>>     printf("Reached line 30\n");
>>     ...
>>     printf("Reached line 50\n");
>>
>> You could also use assert to make sure what you think is true, is
>> true.
>
> PMJI, but as I am just taking a first look at D, does this mean that there
> is no debugger at this time? I did the above back in the 80s when I first
> learned C. I'm not sure I want to go back to that decade again :-)
>



-- 
D Newsgroup.
March 25, 2004
J C Calvarese <jcc7@cox.net> wrote:

> Dave Sieber wrote:
> [snip]
>> PMJI, but as I am just taking a first look at D, does this mean that there is no debugger at this time? I did the above back in the 80s when I first learned C. I'm not sure I want to go back to that decade again :-)
> 
> Even for the sake of nostalgia? ;)

LOL. I got enuff nostalgia already, ok? :-)

> I don't use a debugger with D yet, but it's supposed to be possible. Here's what Walter wrote back in January...

<snip>

Yes, I have windbg here, although I admit I've never used it.

D certainly looks very interesting, and I can't help but agree wholeheartedly with Walter's ambitions. I'm behind him 100% in that regard, and applaud his courage to Do Something About It (tm).

Just as an aside, I've just started reading a bit on D, and find myself mentally comparing it to C# as I read. I really like what MS did with C# (much better than Java, IMO), but the icing on the cake is Visual Studio, which makes programming in C# a joy (I honestly never thought I could say that about programming :-)  Getting an environment like that for D would be absolutely KILLER.

I wonder if Visual Studio could debug a D executable?  Seems that'd be a tall order.

Back to the original question in this post (and sorry for such noobish questions): it seems, then, that access violations do not generate an exception, or at least with default compilation they don't. Is there a way this could be done via some special switches?

Also, is there a standard exception type and hierarchy in D? One of the problems in C++ is that, with no standard exception type (you can throw whatever you want), when one is writing code that uses, say, STL, MFC, ATL, and possibly others, you end up either having to have multiple catch's for each type you want, or throwing away the exception altogether and doing a catch(...), which I really don't like. Again, C# (and Java) at least have a standard notion of an exception, so you don't get all these incompatibilities with code from different sources.

-- 
dave
« First   ‹ Prev
1 2 3