Another SubscribeEvent Crash

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

simmerd
Just popping in
Just popping in
Posts: 6
Joined: Sat Jun 07, 2008 02:58

Another SubscribeEvent Crash

Postby simmerd » Sat Jun 07, 2008 03:08

I am having the infamous SubscribeEvent crash. I have read the forums and checked some of the other issues and solutions folks have had, and none seem to apply in my case.

My game runs ok, in VC2k3.net, building cegui 0.4. I am having unrelated issues that make me want to try VC2k8 express edition ( sp1 ).

The game compiles & runs fine in debug mode in vc2k8, rebuilding cegui and my app using multithreaded debug dll libraries, neither one using STL port. When I build & run in release mode, multithreaded dll, i crashes on my 1st SubscribeEvent call.

I have checked via dependencywalker that the app only is loading my freshly built ceguibase.dll, ceguifalgardbase.dll and directx9GUIrenderer.dll, and not the debug versions.

Please Help!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sat Jun 07, 2008 08:35

Hi,

At this stage I'm not certain what you've done wrong.

Can you please post the exact error that you're getting and a call stack showing where things are going awry (I'm aware that this may not actually be much use in Release mode without symbols ;) ).

Due to the nature of the issue, it's highly likely I'll have to ask for other info too if/when the above does not shed any light.

CE.

simmerd
Just popping in
Just popping in
Posts: 6
Joined: Sat Jun 07, 2008 02:58

Still broken

Postby simmerd » Sun Jun 08, 2008 03:28

Ok, after converting over to my own freshly built cegui v 0.6, again built with the same settings as my exe, it works in debug mode ( at least doesn't crash ), but crashes in subscribeevent in release mode.

I am very sad.

First-chance exception at 0x0068cb8c in AncientGalaxy.exe: 0xC0000005: Access violation reading location 0x00000008.

at this line : mpBackBtn->subscribeEvent( CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber( &MainMenu::HandleBackToGame, this ) );


Right after i step over

template<typename T>
SubscriberSlot(bool (T::*function)(const EventArgs&), T* obj) :
d_functor_impl(new MemberFunctionSlot<T>(function, obj))
{}

It goes back to the subscribeEvent line above, i attempt to step in, then the crash.

I am using vc2k8 sp1 beta.

simmerd
Just popping in
Just popping in
Posts: 6
Joined: Sat Jun 07, 2008 02:58

quick update

Postby simmerd » Sun Jun 08, 2008 03:40

As a test, I changed the subscribe function to a static member function, and got it compiling, ran, and now it crashes as soon as I try to step into the subscribeEvent call, so looks like the pointer to member function was not the issue...

Jon
Just popping in
Just popping in
Posts: 7
Joined: Mon Jun 02, 2008 04:07

Postby Jon » Sun Jun 08, 2008 04:02

Have you checked the value of mpBackBtn in the debugger? Also, while you are at it, does "this" look ok?

simmerd
Just popping in
Just popping in
Posts: 6
Joined: Sat Jun 07, 2008 02:58

this

Postby simmerd » Sun Jun 08, 2008 06:32

In debug mode, everything is fine, and i can walk through the whole shebang.

In Ship mode ( optimizations on but also debug symbols ), I can step into the 1st template function, in which case the mpBackButton is still valid, but after i next hit F11, and it comes back out to the calling scope that calls SubscribeEvent, then mpBackButton is set to 0x0000000d, so something is getting corrupted.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Still broken

Postby CrazyEddie » Sun Jun 08, 2008 08:52

Hi,

This is worrying me at the moment:
simmerd wrote:I am using vc2k8 sp1 beta.


I'm not saying it's definitely this, though using a beta compiler, other than for the purposes of testing said compiler, is asking for trouble. Is there any chance you can try the same code on a version of the compiler without the beta service pack installed?

Does a minimal example exhibit the same result?

CE.

simmerd
Just popping in
Just popping in
Posts: 6
Joined: Sat Jun 07, 2008 02:58

Some more clues.

Postby simmerd » Sun Jun 08, 2008 14:25

Re : beta compiler - yes, I know, I only used it b/c of a large compiler bug in the released version. I have d/l vc2k5 express edition and will try that later.

Ok, a new clue : I tried setting all dlls to '_CRT_SECURE_NO_DEPRECATE' and '_SECURE_SCL=0', and now I get past the line, and have a crash in my app, which still shouldn't happen, but at least it's not crashing in CEGUI right now.

Assuming I can fix this, my next step is to get the GUI visible on the screen - it's invisible right now, although I am getting text.

BTW, what is the technique in CEGUI 0.6 to set font sizes for text I mean to just draw arbitrarily at runtime?

simmerd
Just popping in
Just popping in
Posts: 6
Joined: Sat Jun 07, 2008 02:58

Stopped the crash!

Postby simmerd » Sun Jun 08, 2008 15:34

Ok, here is the solution for those who enter the same hell I did. Make sure you compile all of your DLLs with the same _SECURE_SCL setting. Making that consistent was the key. Seems like it uses incompatible heaps or something??!?

I am still having trouble getting my gui converted from 0.4 to 0.6, but will start a separate thread on that...


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests