Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED]Buffer Overrun?  (Read 10921 times)

0 Members and 1 Guest are viewing this topic.

powell

  • Newbie
  • *
  • Posts: 3
    • View Profile
[SOLVED]Buffer Overrun?
« on: June 12, 2009, 05:53:08 pm »
Just started with SFML, doing some of the tutorials, but when doing the window ones and closing out the window I get errors

Code: [Select]

#include <SFML/Window.hpp>
int main()
{
sf::Window App(sf::VideoMode(800, 600, 32), "My windows");
     while (App.IsOpened())
     {
         // Process events
         sf::Event Event;
         while (App.GetEvent(Event))
         {
             // Close window : exit
             if (Event.Type == sf::Event::Closed)
                 App.Close();
         }
 
         // Update the window
         App.Display();
     }
 

return EXIT_SUCCESS;
}


Errors:
Rune Time check failure #2 - Stack around variable 'App' was corrupted

Debug output
Code: [Select]

'SFML.exe': Loaded 'C:\Users\Anthony\Documents\Visual Studio 2008\Projects\SFML\Debug\SFML.exe', Symbols loaded.
'SFML.exe': Loaded 'C:\Windows\System32\ntdll.dll'
'SFML.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'SFML.exe': Loaded 'C:\Users\Anthony\Documents\Visual Studio 2008\Projects\SFML\SFML\sfml-window.dll'
'SFML.exe': Loaded 'C:\Windows\System32\opengl32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
'SFML.exe': Loaded 'C:\Windows\System32\advapi32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\rpcrt4.dll'
'SFML.exe': Loaded 'C:\Windows\System32\gdi32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\user32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\glu32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\ddraw.dll'
'SFML.exe': Loaded 'C:\Windows\System32\dciman32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\setupapi.dll'
'SFML.exe': Loaded 'C:\Windows\System32\oleaut32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\ole32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\dwmapi.dll'
'SFML.exe': Loaded 'C:\Windows\System32\winmm.dll'
'SFML.exe': Loaded 'C:\Windows\System32\oleacc.dll'
'SFML.exe': Loaded 'C:\Users\Anthony\Documents\Visual Studio 2008\Projects\SFML\SFML\sfml-system.dll'
'SFML.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30411.0_none_dba7eb55a0823cdf\msvcp90.dll'
'SFML.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30411.0_none_dba7eb55a0823cdf\msvcr90.dll'
'SFML.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcp90d.dll', Symbols loaded.
'SFML.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcr90d.dll', Symbols loaded.
'SFML.exe': Loaded 'C:\Windows\System32\imm32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\msctf.dll'
'SFML.exe': Loaded 'C:\Windows\System32\lpk.dll'
'SFML.exe': Loaded 'C:\Windows\System32\usp10.dll'
'SFML.exe': Loaded 'C:\Windows\System32\avgrsstx.dll'
'SFML.exe': Loaded 'C:\Windows\System32\uxtheme.dll'
'SFML.exe': Loaded 'C:\Windows\System32\nvoglv32.dll'
The thread 'Win32 Thread' (0x6830) has exited with code 0 (0x0).
'SFML.exe': Loaded 'C:\Windows\System32\CTAGENT.DLL'
'SFML.exe': Loaded 'C:\Windows\System32\dinput.dll'
'SFML.exe': Loaded 'C:\Windows\System32\hid.dll'
'SFML.exe': Loaded 'C:\Windows\System32\wintrust.dll'
'SFML.exe': Loaded 'C:\Windows\System32\crypt32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\msasn1.dll'
'SFML.exe': Loaded 'C:\Windows\System32\userenv.dll'
'SFML.exe': Loaded 'C:\Windows\System32\secur32.dll'
'SFML.exe': Loaded 'C:\Windows\System32\imagehlp.dll'
Run-Time Check Failure #2 - Stack around the variable 'App' was corrupted.
The program '[28264] SFML.exe: Native' has exited with code 0 (0x0).


Build output
Code: [Select]

1>------ Rebuild All started: Project: SFML, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'SFML', configuration 'Debug|Win32'
1>Compiling...
1>main.cpp
1>Linking...
1>LINK : C:\Users\Anthony\Documents\Visual Studio 2008\Projects\SFML\Debug\SFML.exe not found or not built by the last incremental link; performing full link
1>Embedding manifest...
1>mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "..\Debug\SFML.exe". Access is denied.
1>Build log was saved at "file://c:\Users\Anthony\Documents\Visual Studio 2008\Projects\SFML\SFML\Debug\BuildLog.htm"
1>SFML - 1 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


EDIT: More output from debug when continuing
Code: [Select]

A buffer overrun has occurred in SFML.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'.
A buffer overrun has occurred in SFML.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'.

STATUS_STACK_BUFFER_OVERRUN encountered
Windows has triggered a breakpoint in SFML.exe.

This may be due to a corruption of the heap, which indicates a bug in SFML.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while SFML.exe has focus.

The output window may have more diagnostic information.
The thread 'Main Thread' (0x6924) has exited with code -1073740791 (0xc0000409).
The thread 'Win32 Thread' (0x5a68) has exited with code -1073740791 (0xc0000409).
The program '[28172] SFML.exe: Native' has exited with code -1073740791 (0xc0000409).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[SOLVED]Buffer Overrun?
« Reply #1 on: June 12, 2009, 06:05:56 pm »
You're probably mixing debug and release builds.
Laurent Gomila - SFML developer

powell

  • Newbie
  • *
  • Posts: 3
    • View Profile
[SOLVED]Buffer Overrun?
« Reply #2 on: June 12, 2009, 06:13:39 pm »
no I am buildng like normal and it compiles

Just when I run it and try to exit the window it gives me error

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[SOLVED]Buffer Overrun?
« Reply #3 on: June 12, 2009, 06:17:19 pm »
Well, I see "sfml-window.dll" (this is a release build) and "Project: SFML, Configuration: Debug Win32" (this is a debug build).

So you're obviously mixing debug and release builds.

Have a look at the first "Important" paragraph in the getting started tutorial, it is about this particular issue.
Laurent Gomila - SFML developer

powell

  • Newbie
  • *
  • Posts: 3
    • View Profile
[SOLVED]Buffer Overrun?
« Reply #4 on: June 12, 2009, 06:33:51 pm »
Ah, facepalm

I see what you mean, works perfectly now