C++ Question Stack cookie instrumentation code

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
Every once in a while I get a CTD. When I run the debugger I get this:
'orbiter.exe' (Win32): Loaded 'D:\Orbiter2016\Modules\SPACESHUTTLE2016earlymet.dll'. Symbols loaded.
Unhandled exception at 0x7B36C4CC (SPACESHUTTLE2016earlymet.dll) in orbiter.exe: Stack cookie instrumentation code detected a stack-based buffer overrun.

LjDYcRz.jpg


Not sure it means. How to fix it?
 

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,144
Reaction score
5
Points
53
It means something in your code wrote to an address it shouldn't have, probably off the end of an array.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
Thanks. I need to figure out where. I guess by elimination? comment out parts to see if it occurs?
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
sgcUOKG.jpg

RIs8i8x.jpg


I started commenting out. now I get the symbol no loaded. I rerun the scn 3 times no ctd but the fourth time. get the symbols not loaded
 

dbeachy1

O-F Administrator
Administrator
Moderator
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
8,917
Reaction score
942
Points
203
Location
VA
Website
alteaaerospace.com
Step through the method where the crash occurred one line at a time using the debugger, watching the variables the code is writing to as you step. You should be able to see when it writes to something that is out-of-bounds.

See this post for details about why Orbiter.exe does not have symbols (aka "debug information") loaded (nor should it).

Also, if you have not done so already, be sure to enable Visual C++'s runtime heap checks for debug builds to help narrow down memory bugs like this -- see this post for details.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
Thanks.
now when I run the debugger
Severity Code Description Project Path File Line Suppression State
Error C1073 Internal error involving incremental compilation(compiler file 'd:\agent\_work\3\s\src\vctools\Compiler\CxxFE\sl\p1\c\main.c', line 1031) SPACESHUTTLE2016EARLYMET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET\Atlantis.cpp 1
Warning D9035 option 'Gm' has been deprecated and will be removed in a future release SPACESHUTTLE2016EARLYMET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET\cl 1
Error C1073 Internal error involving incremental compilation(compiler file 'd:\agent\_work\3\s\src\vctools\Compiler\CxxFE\sl\p1\c\main.c', line 1031) SPACESHUTTLE2016EARLYMET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET\Common.cpp 1
Warning MSB8028 The intermediate directory (Debug\) contains files shared from another project (SPACESHUTTLE2016D.vcxproj, SPACESHUTTLE2016EARLY.vcxproj, SPACESHUTTLE.vcxproj). This can lead to incorrect clean and rebuild behavior. SPACESHUTTLE2016EARLYMET C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets 519
Error C1073 Internal error involving incremental compilation(compiler file 'd:\agent\_work\3\s\src\vctools\Compiler\CxxFE\sl\p1\c\main.c', line 1031) SPACESHUTTLE2016EARLYMET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET\PlBayOp.cpp 1


I have been running it by attaching to process
 

Attachments

  • debugsetup1.jpg
    debugsetup1.jpg
    87.1 KB · Views: 2
Last edited:

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
Something is wrong.
I tried to run the debugger in normal graphics
I get the same:
Severity Code Description Project Path File Line Suppression State Error C1073 Internal error involving incremental compilation(compiler file 'd:\agent\_work\3\s\src\vctools\Compiler\CxxFE\sl\p1\c\main.c', line 1031) SPACESHUTTLE2016EARLYMET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET\Common.cpp 1 Error C1073 Internal error involving incremental compilation(compiler file 'd:\agent\_work\3\s\src\vctools\Compiler\CxxFE\sl\p1\c\main.c', line 1031) SPACESHUTTLE2016EARLYMET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET\PlBayOp.cpp 1 Error C1073 Internal error involving incremental compilation(compiler file 'd:\agent\_work\3\s\src\vctools\Compiler\CxxFE\sl\p1\c\main.c', line 1031) SPACESHUTTLE2016EARLYMET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET D:\Orbiter2016\Orbitersdk\samples\SPACESHUTTLE2016E4evaearlyvccammoveEVAnewmfd MET\Atlantis.cpp 1

line1
which are comments
uHZfwUi.jpg
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
I did this and got rid of the error.


GE3hNx4.jpg

But ran the debugger and still get a ctd with symbols not loaded:
 

Attachments

  • debugsetup4.jpg
    debugsetup4.jpg
    102.1 KB · Views: 2
  • debugsetup5.jpg
    debugsetup5.jpg
    50.7 KB · Views: 2

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
I remove more code. Get a ctd about after 3 reloads. but on the debugger. I get symbols loaded.
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
Now source not loaded:
 

Attachments

  • sourcenot.jpg
    sourcenot.jpg
    45.8 KB · Views: 2
  • SPACESHUTTLE2016A.vcxprojtxt.txt
    6.9 KB · Views: 1

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
I am out of ideas. I went back and used earlier shuttle code that worked. On my 3rd reset I get a cTD
 

Attachments

  • symbolnot.jpg
    symbolnot.jpg
    46.3 KB · Views: 2

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
6,614
Reaction score
856
Points
203
Location
Dallas, TX
Not sure how to fix the symbols not loading. I have updated VS. I made a new sample using code that worked. Changed the mesh name and mesh info to the latest mesh. And after 1 or 2 reloads CTD.

Could it be the mesh?
 
Top