X crash problem
Enzo Matrix
thebell at gmail.com
Sun Sep 3 06:51:57 PDT 2006
OK, it seems I found a solution. I had to add the -fno-default-inline
in the compiler. It seems the 2 level of optimization og the GCC
compiler does some kind of inlining that wxwidgets doesn't like.
On 7/28/06, Vadim Zeitlin <vadim at wxwindows.org> wrote:
> On Fri, 28 Jul 2006 19:47:04 +0200 Enzo Matrix <thebell at gmail.com> wrote:
>
> EM> OK this is starting to be a monologue...
>
> This is because it's very difficult to help with a problem like this
> without being able to debug it, so you're probably the best placed person
> to solve it. I can give just one general hint: don't forget to use -sync
> command line option when debugging X errors, this can give more precise
> information about where the error happens.
>
>
> EM> I went one step forward and modified the source of the file wx/dcbuffer.h in
> EM> the problem line so now it's like this:
> EM>
> EM> private:
> EM> // check that the bitmap is valid and use it
> EM> void UseBuffer()
> EM> {
> EM> if (!m_buffer.Ok())
> EM> {
> EM> wxCoord w, h;
> EM> m_dc->GetSize(&w, &h);
> EM> printf("%d, %d\n", w, h);
> EM> m_buffer = wxBitmap(w, h);
> EM> }
> EM>
> EM> SelectObject(m_buffer);
> EM> }
> EM>
> EM> Now I can check the values of w and h before creating the bitmap and this is
> EM> what I get:
> EM>
> EM> 208, 226
> EM> 208, 226
> EM> 208, 226
> EM> 208, 226
> EM> 295, 454
> EM> 19066792, 136515468
> EM> ---- CRASH ----
> EM>
> EM> So it seems obvious for some reason in one of the calls to drawScene() the
> EM> routine
> EM>
> EM> m_dc->GetSize(&w, &h);
> EM>
> EM> gets some trash data... the question is... why?
>
> What kind of DC is m_dc in your case? Maybe there is a bug in its
> GetSize() or maybe, and this seems à priori more likely, there is a bug
> somewhere else which somehow corrupts the DC object.
>
> EM> It might be because the code of drawScene() can't be reentrant? Because
> EM> it's called frome the OnPaint() event and some others it might be
> EM> interrumped and then called again... I don't know if this can be a
> EM> problem or not.
>
> I'd try to avoid any reentrancies if possible in general but I don't see
> how can it explain this particular bug. Anyhow, if you call drawScene()
> from EVT_PAINT handler you should pass it a wxPaintDC (and pass it a
> wxClientDC when you call it from elsewhere), not create a wxClientDC inside
> it. But, still, I don't really see how would this explain the wrong DC size.
>
> Regards,
> VZ
>
> --
> TT-Solutions: wxWidgets consultancy and technical support
> http://www.tt-solutions.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
--
Live long and prosper
More information about the wx-users
mailing list