Re: [wxVTK] Re : wxVTKRWI, wxAuiManager and reparenting
Brought to you by:
malat
From: Quoc C. P. <quo...@ce...> - 2008-08-25 13:45:43
|
Here is the valgrind output : Gdk-ERROR **: The program 'auidemo' received an X Window System error. This probably reflects a bug in the program. The error was 'BadWindow (invalid Window parameter)'. (Details: serial 7 error_code 3 request_code 2 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) aborting... /usr/libexec/auidemo: No such file or directory. 145 m_syswrap/syscall-amd64-linux.S: No such file or directory. Asked for position 0 of stack, stack only has 0 elements on it. Asked for position 0 of stack, stack only has 0 elements on it. Asked for position 0 of stack, stack only has 0 elements on it. --10071-- Discarding syms at 0x10243000-0x10446000 in /usr/lib64/gconv/ISO8859-1.so due to munmap() --10071-- Discarding syms at 0xF2FE000-0xF501000 in /usr/lib64/gconv/UTF-32.so due to munmap() --10071-- Discarding syms at 0xF519000-0xF724000 in /lib64/libnss_files-2.7.so due to munmap() ==10071== ==10071== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 5 from 1) ==10071== ==10071== 1 errors in context 1 of 1: ==10071== Syscall param writev(vector[...]) points to uninitialised byte(s) ==10071== at 0x39EACCD89C: writev (in /lib64/libc-2.7.so) ==10071== by 0x39EC408A81: (within /usr/lib64/libxcb.so.1.0.0) ==10071== by 0x39EC408F9A: (within /usr/lib64/libxcb.so.1.0.0) ==10071== by 0x39EC4090CA: (within /usr/lib64/libxcb.so.1.0.0) ==10071== by 0x39EC40919E: xcb_flush (in /usr/lib64/libxcb.so.1.0.0) ==10071== by 0x39EC84AE26: _XSend (in /usr/lib64/libX11.so.6.2.0) ==10071== by 0x39F5822244: (within /usr/lib64/libGL.so.1.2) ==10071== by 0x39F58261A5: (within /usr/lib64/libGL.so.1.2) ==10071== by 0x39F582714E: (within /usr/lib64/libGL.so.1.2) ==10071== by 0x89787FF: vtkOpenGLPolyDataMapper::RenderPiece(vtkRenderer*, vtkActor*) (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) ==10071== by 0x88EE851: vtkPolyDataMapper::Render(vtkRenderer*, vtkActor*) (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) ==10071== by 0x8959F43: vtkOpenGLActor::Render(vtkRenderer*, vtkMapper*) (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) ==10071== Address 0x1164C361 is 5,417 bytes inside a block of size 8,680 alloc'd ==10071== at 0x4A04D1F: calloc (vg_replace_malloc.c:279) ==10071== by 0x39EC408C4E: xcb_connect_to_fd (in /usr/lib64/libxcb.so.1.0.0) ==10071== by 0x39EC40B002: xcb_connect (in /usr/lib64/libxcb.so.1.0.0) ==10071== by 0x39EC84A3EB: _XConnectXCB (in /usr/lib64/libX11.so.6.2.0) ==10071== by 0x39EC8335B5: XOpenDisplay (in /usr/lib64/libX11.so.6.2.0) ==10071== by 0x899FEF4: vtkXOpenGLRenderWindow::WindowInitialize() (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) ==10071== by 0x899CD1C: vtkXOpenGLRenderWindow::Initialize() (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) ==10071== by 0x899CE42: vtkXOpenGLRenderWindow::Start() (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) ==10071== by 0x890102F: vtkRenderWindow::DoStereoRender() (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) ==10071== by 0x8901622: vtkRenderWindow::DoFDRender() (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) ==10071== by 0x8901DFE: vtkRenderWindow::DoAARender() (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) ==10071== by 0x89025EE: vtkRenderWindow::Render() (in /usr/local/share/CEA/lcviExtern/vtk50/lib/libvtkRendering.so.5.0.4) --10071-- --10071-- supp: 5 dl-hack3 ==10071== ==10071== IN SUMMARY: 1 errors from 1 contexts (suppressed: 5 from 1) ==10071== ==10071== malloc/free: in use at exit: 3,349,298 bytes in 22,782 blocks. ==10071== malloc/free: 106,158 allocs, 83,376 frees, 34,453,538 bytes allocated. ==10071== ==10071== searching for pointers to 22,782 not-freed blocks. ==10071== checked 5,689,632 bytes. ==10071== ==10071== LEAK SUMMARY: ==10071== definitely lost: 92,830 bytes in 1,830 blocks. ==10071== possibly lost: 145,620 bytes in 253 blocks. ==10071== still reachable: 3,110,848 bytes in 20,699 blocks. ==10071== suppressed: 0 bytes in 0 blocks. ==10071== Rerun with --leak-check=full to see details of leaked memory. --10071-- memcheck: sanity checks: 444 cheap, 18 expensive --10071-- memcheck: auxmaps: 1773 auxmap entries (113472k, 110M) in use --10071-- memcheck: auxmaps: 48127738 searches, 338798389 comparisons --10071-- memcheck: SMs: n_issued = 325 (5200k, 5M) --10071-- memcheck: SMs: n_deissued = 2 (32k, 0M) --10071-- memcheck: SMs: max_noaccess = 524287 (8388592k, 8191M) --10071-- memcheck: SMs: max_undefined = 6 (96k, 0M) --10071-- memcheck: SMs: max_defined = 4763 (76208k, 74M) --10071-- memcheck: SMs: max_non_DSM = 324 (5184k, 5M) --10071-- memcheck: max sec V bit nodes: 3051 (262k, 0M) --10071-- memcheck: set_sec_vbits8 calls: 13006 (new: 3051, updates: 9955) --10071-- memcheck: max shadow mem size: 9590k, 9M --10071-- translate: fast SP updates identified: 95,864 ( 86.4%) --10071-- translate: generic_known SP updates identified: 9,261 ( 8.3%) --10071-- translate: generic_unknown SP updates identified: 5,719 ( 5.1%) --10071-- tt/tc: 382,485 tt lookups requiring 1,427,979 probes --10071-- tt/tc: 382,485 fast-cache updates, 9 flushes --10071-- transtab: new 82,506 (2,106,703 -> 38,234,918; ratio 181:10) [0 scs] --10071-- transtab: dumped 0 (0 -> ??) --10071-- transtab: discarded 188 (3,842 -> ??) --10071-- scheduler: 44,512,761 jumps (bb entries). --10071-- scheduler: 444/458,730 major/minor sched events. --10071-- sanity: 445 cheap, 18 expensive checks. --10071-- exectx: 30,011 lists, 18,200 contexts (avg 0 per list) --10071-- exectx: 187,711 searches, 175,866 full compares (936 per 1000) --10071-- exectx: 0 cmp2, 10 cmp4, 0 cmpAll I am sorry I am not very familiar with valgrind, it seems that the error is related to a call to vtkRenderWindow::Render() but I don't know how to interpret this output... Quoc Cuong Mathieu Malaterre a écrit : > Hi Quoc Cuong, > > On Mon, Aug 25, 2008 at 1:48 PM, Quoc Cuong PHAM <quo...@ce...> wrote: > >> this->Hide(); >> >> before the line: >> m_pVTKWindow = new wxVTKRenderWindowInteractor(this, MY_VTK_WINDOW, pos, >> size) >> >> because I use wxGLCanvas >> > > wow ! I do not know how I can patch wxVTK to support that ... > > >> - a second error occurs when the wxVTKRenderWindowInteractor::UpdateSize() >> is called with the same size as the initial size (at the creation >> wxVTKRenderWindowInteractor) >> if I do >> void FrameGL::OnSize(wxSizeEvent& event) >> { >> cout<<"FrameGL::OnSize()"<<endl; >> wxSize size = event.GetSize(); >> // cout<<"change size = "<< size.GetWidth() <<" "<< size.GetHeight() << >> endl; >> if (size!= this->initialSize) >> > > That seems a resonable patch. Thanks. > > > >> - then the application does not crash in UpdateSize() anymore but further, >> in the reparent section of the Render() as I mentioned in my first email >> >> else if(GetHandleHack()) >> { >> //this means the user has reparented us; let's adapt to the >> //new situation by doing the WindowRemap dance >> //store the new situation >> Handle = GetHandleHack(); >> cout<<"Handle (reparent)= "<< Handle << endl; >> RenderWindow->SetNextWindowId(reinterpret_cast<void *>(Handle)); // >> CRASH HERE !!!! >> > > > no the crash cannot happen here. > > RenderWindow is a valid pointer and Handle is simply an integer, on > linux you can always cast an integer to a void* pointer. So the bug > must appear somewhere before. > > On your linux station, please install valgrind, and start you > application this ways: > > $ valgrind -v ./aui-sample > > (replace aui-sample with whatever the name of your app is). Then send > us back the valgrind output, or study it, it is fairly easy to read. > > HTH > -- Quoc Cuong PHAM == CEA LIST Laboratoire Systèmes de Vision Embarqués DRT/LIST/DTSI/SARC/LSVE Centre de Saclay Bat 528 91191 Gif-sur-Yvette France Phone : +33 1 69 08 82 98 Fax : +33 1 69 08 83 95 e-mail : quo...@ce... |