Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363684

Summary: Segmentation Fault at NPN_GetAuthenticationInfo
Product: [Eclipse Project] Platform Reporter: aj2r <ajrodriguez>
Component: SWTAssignee: Grant Gayed <grant_gayed>
Status: RESOLVED NOT_ECLIPSE QA Contact:
Severity: critical    
Priority: P3 CC: ajrodriguez, eclipse.felipe, remy.suen
Version: 3.7.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Error report file
none
Example application.
none
Core file dump backtrace
none
html test case none

Description aj2r CLA 2011-11-14 04:48:16 EST
Created attachment 206931 [details]
Error report file

I'm changing periodically the content of a div, loading SVGs in it via javascript (org.eclipse.swt.browser.Browser.execute()). In a short exceution time the JVM detects a SIGSEGV.
Reproducible: always.

Thanks in advance.
Comment 1 Grant Gayed CLA 2011-11-14 12:19:20 EST
The attached dump just indicates that the error is occuring in the event loop.  Are you able to provide a concrete means of reproducing the problem (ideal snippet template: http://www.eclipse.org/swt/faq.php#whatisasnippet )?
Comment 2 aj2r CLA 2011-11-15 02:57:50 EST
Created attachment 207008 [details]
Example application.

You must copy example.svg to /tmp
Comment 3 aj2r CLA 2011-11-17 08:30:36 EST
Created attachment 207141 [details]
Core file dump backtrace
Comment 4 Grant Gayed CLA 2011-11-24 15:36:36 EST
I've run App.java from the comment 2 attachment, but I do not see the crash, just blue content.  Questions:
- App.java is the correct thing to run, right?
- Can you verify that the crash still happens for you with a JRE from either Sun/Oracle or IBM?  OpenJDK is not considered to be supported.
- I notice that you're on Ubuntu 11.10; which version of webkitgtk is on there?
Comment 5 aj2r CLA 2011-11-25 02:52:31 EST
Yes(In reply to comment #4)
> I've run App.java from the comment 2 attachment, but I do not see the crash,
> just blue content.  Questions:
> - App.java is the correct thing to run, right?

Yes, App.java is the correct thing. But after the blue content it must load the file /tmp/example.svg Have you copied the example.svg file to /tmp?

> - Can you verify that the crash still happens for you with a JRE from either
> Sun/Oracle or IBM?  OpenJDK is not considered to be supported.
> - I notice that you're on Ubuntu 11.10; which version of webkitgtk is on there?

I'm using the packages of the Ubuntu's standard repository, version 1.4.3
Comment 6 Grant Gayed CLA 2011-11-25 16:31:10 EST
Simplified snippet that reproduces the problem with WebKitGTK 1.4:

public class App {

private static final String JQUERY_FILE = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js";
private static final String CONTENT1_ID = "blucontent0";
private static final String CONTENT2_ID = "blucontent1";
private static final String FRAME_ID = "bluframe";
private static final String HTML = "<!DOCTYPE html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"> <style type=\"text/css\"> * { overflow:hidden; margin: 0px; padding: 0px; } </style> <script type=\"text/javascript\" src=\"" + JQUERY_FILE + "\"></script></head><body style=\"width: 200px; height: 200px; background: #84c5e1;\"><div id=\"" + CONTENT1_ID + "\" style=\"z-index: 1; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;\"></div><div id=\"" + CONTENT2_ID + "\" style=\"z-index: 0; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;display: none\"></div><div id=\"" + FRAME_ID + "\" style=\"z-index: 99; position: absolute; top: 0px; left: 0px;\"></div></body></html>";
private static Browser browser;
private static int nextContent = 0;

public static void main(String[] args) {
    final Display display = new Display();
    Shell shell = new Shell(display);
    FillLayout layout = new FillLayout();
    shell.setLayout(layout);
    browser = new Browser(shell, SWT.NONE);
    browser.setText(HTML, true);
    shell.setBounds(10,10,200,200);
    shell.open();
    Runnable runnable = new Runnable() {
        public void run() {
            final String nextContentId = (nextContent == 0 ? CONTENT1_ID : CONTENT2_ID);
            final String currentContentId = (nextContent == 1 ? CONTENT1_ID : CONTENT2_ID);
            browser.execute(
                "$(\"div#" + nextContentId + ":first\").load(\""
                + "/tmp/example.svg" + "\", null,"
                + "function() {"
                + "$(\"div#" + nextContentId + ":first\").css(\"z-index\",\"1\");"
                + "$(\"div#" + currentContentId + ":first\").css(\"z-index\",\"0\");"
                + "$(\"div#" + nextContentId + ":first\").show(0,"
                + " function() {"
                + "$(\"div#" + currentContentId + ":first\").hide(0);"
                + "}); "
                + "})");
            nextContent = (nextContent == 0 ? 1 : 0);
            display.timerExec(2000, this);
        }
    };
    display.timerExec(2000, runnable);
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    display.dispose();
}

}
Comment 7 Grant Gayed CLA 2011-11-28 12:00:56 EST
Created attachment 207610 [details]
html test case

This is a better test case, it moves all of the functionality into the .html (attached).  Just put it into the same directory as example.svg and view it with a generic Browser snippet like http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet148.java to see the crash.

I suspect that this will resolve to be a problem in native WebKitGTK, but is not yet confirmed.
Comment 8 Grant Gayed CLA 2012-01-09 15:55:50 EST
This is fixed in WebKitGTK 1.6.x.  Closing report since it turned out to not be an swt issue.