Prev: wxGrid problem
Next: FreeImage Graphics Library
From: Divick Kishore on 7 Jul 2006 11:24 Hi all, I am using wxSocket for communication between a client application and server. I have implemented my own protocol with wxSocket infrastructure. I am creating wxSocketServer with default flags at both client and server. When I run my application I get some assertion failure message (which is not shown as pop up box or something), but it breaks into code and shows the following in the stack trace in Visual Studio. Can somebody help me figure out what could possibly be wrong? ntdll.dll!7c901230() Viewer3Dds.exe!wxTrap() Line 589 + 0x8 C++ Viewer3Dds.exe!wxOnAssert(const unsigned short * szFile=0x0084bbd0, int nLine=684, const unsigned short * szCond=0x0081d74c, const unsigned short * szMsg=0x0084c040) Line 629 C++ Viewer3Dds.exe!wxAssert(int cond=0, const unsigned short * szFile=0x0084bbd0, int nLine=684, const unsigned short * szCond=0x0081d74c, const unsigned short * szMsg=0x0084c040) Line 612 + 0x15 C++ Viewer3Dds.exe!wxApp::Yield(bool onlyIfNeeded=false) Line 684 + 0x2b C++ Viewer3Dds.exe!wxYield() Line 725 + 0x2c C++ Viewer3Dds.exe!wxSocketBase::_Wait(long seconds=-1, long milliseconds=0, int flags=9) Line 766 + 0x11 C++ Viewer3Dds.exe!wxSocketBase::WaitForRead(long seconds=-1, long milliseconds=0) Line 805 C++ Viewer3Dds.exe!wxSocketBase::_Read(void * buffer=0x01209380, unsigned int nbytes=214182) Line 363 + 0x17 C++ Viewer3Dds.exe!wxSocketBase::Read(void * buffer=0x01209380, unsigned int nbytes=214182) Line 309 + 0x10 C++ > Viewer3Dds.exe!RFBClient::framebufferUpdateMsg(unsigned short x=0, unsigned short y=0, unsigned short w=326, unsigned short h=219) Line 223 C++ Viewer3Dds.exe!ViewerRemoteDataModel::draw() Line 82 + 0x1f C++ Viewer3Dds.exe!ViewerGLCanvas::draw() Line 53 + 0x1b C++ Viewer3Dds.exe!ViewerGLCanvas::OnPaint(wxPaintEvent & __formal={...}) Line 42 C++ Viewer3Dds.exe!wxAppConsole::HandleEvent(wxEvtHandler * handler=0x011f9358, void (wxEvent &)* func=0x0055ea44, wxEvent & event={...}) Line 324 + 0xc C++ Viewer3Dds.exe!wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase & entry={...}, wxEvtHandler * handler=0x011f9358, wxEvent & event={...}) Line 1193 + 0x30 C++ Viewer3Dds.exe!wxEventHashTable::HandleEvent(wxEvent & event={...}, wxEvtHandler * self=0x011f9358) Line 876 + 0x1c C++ Viewer3Dds.exe!wxEvtHandler::ProcessEvent(wxEvent & event={...}) Line 1255 + 0x23 C++ Viewer3Dds.exe!wxWindow::HandlePaint() Line 4073 + 0x25 C++ Viewer3Dds.exe!wxWindow::MSWWindowProc(unsigned int message=15, unsigned int wParam=0, long lParam=0) Line 2455 + 0x8 C++ Viewer3Dds.exe!wxWndProc(HWND__ * hWnd=0x00130556, unsigned int message=15, unsigned int wParam=0, long lParam=0) Line 2326 + 0x1c C++ user32.dll!77d48734() user32.dll!77d48816() user32.dll!77d4c63f() user32.dll!77d4c665() opengl32.dll!5ed2699b() user32.dll!77d48734() user32.dll!77d48816() user32.dll!77d4b4c0() user32.dll!77d4ebf3() user32.dll!77d4ec03() user32.dll!77d4b50c() ntdll.dll!7c90eae3() user32.dll!77d494d2() user32.dll!77d4b530() user32.dll!77d5e04a() user32.dll!77d48a10() user32.dll!77d5e2b9() user32.dll!77d561c6() user32.dll!77d6a92e() Thanks, Divick --------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
From: "Graham Daws" on 9 Jul 2006 12:28 Hi, Although I can't see Yield being called twice on the stack (is that the whole stack trace?) the assertion failure will likely be a detected recusive yield. With the default socket flag, wxSocket's i/o functions poll for read/write-ability while keeping the GUI responsive, by yielding control to pending events. From my experience, this mode of operation inside event functions is problematic - yielding control to the same event function or an event function with the same behaviour, causing an infinite yield loop. A solution is to read socket data inside socket events, where it won't block, instead of reading inside a paint event. Regards, Graham Daws On 7/7/06, Divick Kishore <divick.kishore(a)gmail.com> wrote: > Hi all, > I am using wxSocket for communication between a client > application and server. I have implemented my own protocol with wxSocket > infrastructure. I am creating wxSocketServer with default flags at both > client and server. When I run my application I get some assertion > failure message (which is not shown as pop up box or something), but it > breaks into code and shows the following in the stack trace in Visual > Studio. Can somebody help me figure out what could possibly be wrong? > > ntdll.dll!7c901230() > Viewer3Dds.exe!wxTrap() Line 589 + 0x8 C++ > Viewer3Dds.exe!wxOnAssert(const unsigned short * szFile=0x0084bbd0, > int nLine=684, const unsigned short * szCond=0x0081d74c, const unsigned > short * szMsg=0x0084c040) Line 629 C++ > Viewer3Dds.exe!wxAssert(int cond=0, const unsigned short * > szFile=0x0084bbd0, int nLine=684, const unsigned short * > szCond=0x0081d74c, const unsigned short * szMsg=0x0084c040) Line 612 + > 0x15 C++ > Viewer3Dds.exe!wxApp::Yield(bool onlyIfNeeded=false) Line 684 + > 0x2b C++ > Viewer3Dds.exe!wxYield() Line 725 + 0x2c C++ > Viewer3Dds.exe!wxSocketBase::_Wait(long seconds=-1, long > milliseconds=0, int flags=9) Line 766 + 0x11 C++ > Viewer3Dds.exe!wxSocketBase::WaitForRead(long seconds=-1, long > milliseconds=0) Line 805 C++ > Viewer3Dds.exe!wxSocketBase::_Read(void * buffer=0x01209380, > unsigned int nbytes=214182) Line 363 + 0x17 C++ > Viewer3Dds.exe!wxSocketBase::Read(void * buffer=0x01209380, > unsigned int nbytes=214182) Line 309 + 0x10 C++ > > Viewer3Dds.exe!RFBClient::framebufferUpdateMsg(unsigned short x=0, > unsigned short y=0, unsigned short w=326, unsigned short h=219) Line > 223 C++ > Viewer3Dds.exe!ViewerRemoteDataModel::draw() Line 82 + 0x1f C++ > Viewer3Dds.exe!ViewerGLCanvas::draw() Line 53 + 0x1b C++ > Viewer3Dds.exe!ViewerGLCanvas::OnPaint(wxPaintEvent & > __formal={...}) Line 42 C++ > Viewer3Dds.exe!wxAppConsole::HandleEvent(wxEvtHandler * > handler=0x011f9358, void (wxEvent &)* func=0x0055ea44, wxEvent & > event={...}) Line 324 + 0xc C++ > Viewer3Dds.exe!wxEvtHandler::ProcessEventIfMatches(const > wxEventTableEntryBase & entry={...}, wxEvtHandler * handler=0x011f9358, > wxEvent & event={...}) Line 1193 + 0x30 C++ > Viewer3Dds.exe!wxEventHashTable::HandleEvent(wxEvent & event={...}, > wxEvtHandler * self=0x011f9358) Line 876 + 0x1c C++ > Viewer3Dds.exe!wxEvtHandler::ProcessEvent(wxEvent & event={...}) > Line 1255 + 0x23 C++ > Viewer3Dds.exe!wxWindow::HandlePaint() Line 4073 + 0x25 C++ > Viewer3Dds.exe!wxWindow::MSWWindowProc(unsigned int message=15, > unsigned int wParam=0, long lParam=0) Line 2455 + 0x8 C++ > Viewer3Dds.exe!wxWndProc(HWND__ * hWnd=0x00130556, unsigned int > message=15, unsigned int wParam=0, long lParam=0) Line 2326 + 0x1c C++ > user32.dll!77d48734() > user32.dll!77d48816() > user32.dll!77d4c63f() > user32.dll!77d4c665() > opengl32.dll!5ed2699b() > user32.dll!77d48734() > user32.dll!77d48816() > user32.dll!77d4b4c0() > user32.dll!77d4ebf3() > user32.dll!77d4ec03() > user32.dll!77d4b50c() > ntdll.dll!7c90eae3() > user32.dll!77d494d2() > user32.dll!77d4b530() > user32.dll!77d5e04a() > user32.dll!77d48a10() > user32.dll!77d5e2b9() > user32.dll!77d561c6() > user32.dll!77d6a92e() > > > Thanks, > Divick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org > For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
|
Pages: 1 Prev: wxGrid problem Next: FreeImage Graphics Library |