[Kde-imaging] [Bug 290652] New: Gwenview segfaults when opening the OpenGL image viewer

Brad Hubbard bhubbard at redhat.com
Thu Jan 5 00:25:20 UTC 2012


https://bugs.kde.org/show_bug.cgi?id=290652

           Summary: Gwenview segfaults when opening the OpenGL image
                    viewer
           Product: kipiplugins
           Version: 2.4.1
          Platform: Fedora RPMs
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: crash
          Priority: NOR
         Component: ImageViewer
        AssignedTo: kde-imaging at kde.org
        ReportedBy: bhubbard at redhat.com


Created an attachment (id=67469)
 --> (http://bugs.kde.org/attachment.cgi?id=67469)
First alternative patch using isInitialized member variable

Version:           2.4.1 (using KDE 4.7.4) 
OS:                Linux

Steps to Reproduce:
1.Open gwenview
2.Go to Plug-in  
3.then tools
4.OpenGL image viewer

Reproducible: Always

Steps to Reproduce:
See above

Actual Results:  
segfault

Expected Results:  
No segfault but not sure about exactly what should happen?

I have created two possible solutions (patches) to this issue and will attach
them. I can provide a core if required.

That problem is caused by the fact that when the menu item is clicked with no
image open a ViewerWidget is instantiated but ViewerWidget::initializeGL()
never gets called and the tex member variable (GLuint[3]) is not initialized
properly. When the destructor is invoked it calls glDeleteTextures(1,tex) and
crashes when accessing the invalid tex. My first patch uses a dedicated
variable (isInitialized) to represent the initialized state and is more
intuitive IMHO. The second approach is more economical and uses an existing
member variable (firstImage) to accomplish the same. This required moving some
of the code in the constructor that should have no side effects but this
approach is less intuitive and maybe prone to the problems of using one
mechanism to accomplish multiple objectives?

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Kde-imaging mailing list