f12-Bug in wxWidgets?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
123abc
Knows some wx things
Knows some wx things
Posts: 38
Joined: Thu Jun 23, 2005 5:12 pm

f12-Bug in wxWidgets?

Post by 123abc » Tue Nov 01, 2005 4:58 pm

Heyho,
maybe you remeber me, yesterday i had a problem with my app. Everytime i wanted a key input from the user (using ::GetAsyncKeyState) and the user pressed f12, my programm crashed. Now i implemented the whole "input-function" using key-event-handler. Unfortunately my programm also crashed when the user pressed f12. 3 Minutes ago i found out that my programm crashed everytime the user presses the f12 key. The even happen when i only have that little application:

Code: Select all

class CMyTestApp : public wxApp
{
public:
	bool				OnInit()
	{
		wxFrame* pFrame=new wxFrame(NULL, wxID_ANY, "", wxDefaultPosition,wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxCAPTION | wxTHICK_FRAME|wxFULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
		pFrame->Show();
		SetTopWindow(pFrame);

		return true;
	}

	int					OnExit()
	{

		return 0;
	}
};

IMPLEMENT_APP(CMyTestApp);
I press f12, application freezes and my compiler shows that little message:
Image

Can you help me???

123

benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte » Tue Nov 01, 2005 5:07 pm

What does happen when you try to debug ?
You should see the call stack and find why the app crashes.

123abc
Knows some wx things
Knows some wx things
Posts: 38
Joined: Thu Jun 23, 2005 5:12 pm

Post by 123abc » Tue Nov 01, 2005 5:37 pm

When i press at "Weiter" (which means continue), i can use my programm without any problems till the next f12-press. When i press debug, i can only see the call stack...
http://img350.imageshack.us/img350/6408 ... nnt4lh.jpg
Last edited by 123abc on Tue Nov 01, 2005 7:06 pm, edited 1 time in total.

chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Post by chris » Tue Nov 01, 2005 6:35 pm

Hi,

I can't reproduce this (using the minimal sample you provided), neither with MinGW 3.4.2 and wxMSW 2.6.1 (ANSI) nor Visual C++ 7.1 and wxMSW 2.6.2 (ANSI).

What's your wx version, how did you compile it (release/debug, ANSI/Unicode, DLL or static libs)?

What does your Makefile look like?

Chris
this->signature=NULL;

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Tue Nov 01, 2005 6:48 pm

How does your handler look for the F12 key ? Can you post that code?

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

123abc
Knows some wx things
Knows some wx things
Posts: 38
Joined: Thu Jun 23, 2005 5:12 pm

Post by 123abc » Tue Nov 01, 2005 6:55 pm

I have no Handler. Even with this little app, only this little wxFrame, the Application crashes when i press f12...
Ii am using wxWidgets 2.6.2(Release,Ansi,Lib) with MSW 7.2
Command Line:

Code: Select all

/OUT:"Release/main.exe" /INCREMENTAL:NO /NOLOGO /NODEFAULTLIB:"libci.lib" /NODEFAULTLIB:"LIBCMT" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /OPT:NOWIN98 /MACHINE:X86 Psapi.lib Kernel32.lib wxmsw26_core.lib wxbase26.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib oleacc.lib odbc32.lib d3d8.lib d3dx8.lib  dinput8.lib dxguid.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "\Visual Studio Projects\ToolsLibs\wxWidgets\wxWidgets-2.6.2\lib\vc_lib\wxmsw26_core.lib" "\Visual Studio Projects\ToolsLibs\wxWidgets\wxWidgets-2.6.2\lib\vc_lib\wxbase26.lib" "\Visual Studio Projects\ToolsLibs\wxWidgets\wxWidgets-2.6.2\lib\vc_lib\wxtiff.lib" "\Visual Studio Projects\ToolsLibs\wxWidgets\wxWidgets-2.6.2\lib\vc_lib\wxjpeg.lib" "\Visual Studio Projects\ToolsLibs\wxWidgets\wxWidgets-2.6.2\lib\vc_lib\wxpng.lib" "\Visual Studio Projects\ToolsLibs\wxWidgets\wxWidgets-2.6.2\lib\vc_lib\wxzlib.lib" "\Visual Studio Projects\ToolsLibs\wxWidgets\wxWidgets-2.6.2\lib\vc_lib\wxregex.lib" "\Visual Studio Projects\ToolsLibs\wxWidgets\wxWidgets-2.6.2\lib\vc_lib\wxexpat.lib" 

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Tue Nov 01, 2005 7:13 pm

I have no SetTopWindow() maybe that is relevant,

Also, wxFrame is preferrably inherited from.

Have you tried creating your app as described in the minimal sample ?

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

123abc
Knows some wx things
Knows some wx things
Posts: 38
Joined: Thu Jun 23, 2005 5:12 pm

Post by 123abc » Tue Nov 01, 2005 7:26 pm

Jorg wrote:I have no SetTopWindow() maybe that is relevant
no :(
Jorg wrote:Have you tried creating your app as described in the minimal sample ?
Yeah

I also tried recompiling wxWidgets, but nothing helps :( :?

toxicBunny
Super wx Problem Solver
Super wx Problem Solver
Posts: 424
Joined: Tue Jul 12, 2005 8:44 pm
Location: Alabama, USA

Post by toxicBunny » Tue Nov 01, 2005 7:37 pm

I just wanted to say that one of my applications is doing the same thing. I have several apps written with wxWidgets, but only one of them is showing this bug. I have no key event handlers, but I have a menu item with a shortcut for the F1 key. The program appears to be crashing on the following line in wxEvtLoop::Dispatch().

Code: Select all

BOOL rc = ::GetMessage(&msg, (HWND) NULL, 0, 0);
Or more precisely, on the GetMessageA() call in winundef.h around line 273.

Code: Select all

return GetMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
I haven't determined why this happens. No other keys seem to cause this to happen. If I try to break into the code on the error, I get the "There is no source code available for the current location" message. I guess that's because this is actually a Windows API function. I can go to the disassembly, but this doesn't mean much to me. I never got around to learning assembly.

I'm using XP Pro, VS2002, and CVS from some time between the 2.6.1 and 2.6.2 releases.

Just thought I'd throw this into the discussion. If I find out more, I'll let everyone know.

-Scott

123abc
Knows some wx things
Knows some wx things
Posts: 38
Joined: Thu Jun 23, 2005 5:12 pm

Post by 123abc » Tue Nov 01, 2005 7:43 pm

Well, here's a little sample project. Just compile it (release) using wxwidgets 2.6.2 release ansi lib and see yourself

http://rapidshare.de/files/7059122/test.rar.html

toxicBunny
Super wx Problem Solver
Super wx Problem Solver
Posts: 424
Joined: Tue Jul 12, 2005 8:44 pm
Location: Alabama, USA

Post by toxicBunny » Tue Nov 01, 2005 8:20 pm

Actually, I don't think this is an error. At least not on my app. It seems that when running in debug mode in Visual Studio, pressing the F12 key will automatically break into the code. It appears to be an error but is actually by design. Running the app compiled in debug mode outside the debugger does not generate the error.

-Scott

chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Post by chris » Tue Nov 01, 2005 9:44 pm

Ah well, "Benutzerhaltepunkt" in the screenshot (first post) means "user breakpoint". So it seems that's actually a feature of Visual Studio.
Scott is right on this one for sure.

Chris
this->signature=NULL;

toxicBunny
Super wx Problem Solver
Super wx Problem Solver
Posts: 424
Joined: Tue Jul 12, 2005 8:44 pm
Location: Alabama, USA

Post by toxicBunny » Tue Nov 01, 2005 10:40 pm

Actually, I think it's a general Windows feature. It seems that any time an application is connected to a debugger, the user can break into the code by pressing the F12 hot key. The key used can actually be modified by changing a registry value. I think the debugger has to be defined as well.

http://www.microsoft.com/resources/docu ... /11501.asp

I think this is an old OS feature that has almost been forgotten. I don't remember running across it before, but I only use a few function keys in my apps such as F1 for help.

-Scott

Post Reply