Hi all,

I am new to this community and would like to get some help with a problem I am 
having. I hope I am posting it in the right section and I apologize if that is 
not the case.

I am experiencing write access violations upon every frame update 
(pViewer->frame()) after attaching the VS 2010 debugger to a running process 
which uses the OSG viewer. I first started to see this error with the MFC-based 
multithreaded app I developed, and I of course blamed my code and my handling 
of synchronization objects for that. After a few hours of debugging and 
scratching my head, however, I realized the following things:

1) The access violation happens only when the debugger is attached to an 
already running process. If I start the process by debugging it in VS, no 
access violation exception is raised; 
2) The problem is not just with my application: if I attach the VS debugger to 
the osgviewerd.exe or osgviewermfcd.exe process after loading the Avatar.osg 
model, I can observe the same behavior, i.e. write access violations after 
attaching the debugger when the process is already running, no access violation 
when starting the process from VS with the debugger attached;
3) If I tell VS to ignore the access violation (from the Exceptions dialog), 
everything works fine, except that the debugger output window is flushed with 
access violation messages - one per frame update;
4) The place in the code where the access violation occurs varies depending on 
the process being debugged and model loaded. Sometimes it is in OSG sources, 
sometimes in STL sources, but never in my own code - or in the code of the 
application i am debugging;
5) Not all models cause the problem - with osgviewerd.exe, for instance, the 
Cessna.osg model does not cause any access violation even after attaching the 
debugger when the process is already running;
6) The access violation after attaching the debugger occurs both in debug and 
in release configurations;
7) After reproducing the problem with osgviewermfcd.exe and the Avatar.osg 
model, if I keep the debugger attached, tell VS to ignore access violation 
exceptions (so I can actually keep interacting with the app, otherwise an 
exception dialog would pop up after each frame update), close the window which 
shows the Avatar.osg model and open the same model in a new window, I see no 
access violations in the debug output.

I thought there might be a problem with the OSG binaries I downloaded, so I 
downloaded the source code and built them myself, but the issue persists. I am 
using Win7 64 bit and VS 2010 SP1.

I suspect this to be an issue with the VS 2010 debugger, but I haven't seen it 
with any other application before. Did anybody experience this problem or has 
an idea what could it be caused by?

I would very much appreciate any kind of help. In case you need more 
information which I might have forgotten to type, please do not hesitate to ask.

Thank you in advance,

Andrea

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46395#46395





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to