Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8833157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:42:45+00:00 2026-06-14T08:42:45+00:00

General : I always receive SIGSEGV on Linux when invoke the XRE_InitEmbedding2 function with

  • 0

General:

I always receive SIGSEGV on Linux when invoke the XRE_InitEmbedding2 function with XULRunner 15.

Details:

I’m trying to embed Mozilla (XULRunner 15.05b 64-bit) browser component into my GTK application on Fedora 12 64-bit. I created Eclipse project, configured it to use all required XULRunner libraries and include files and successfully built it.

Here’s the application code:

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <gtk/gtk.h>

#include "nsXPCOM.h"
#include "nsXPCOMGlue.h"
#include "nsEmbedString.h"
#include "nsXULAppAPI.h"
#include "nsILocalFile.h"

using namespace std;

XRE_InitEmbedding2Type XRE_InitEmbedding2Delegate;

int main(int argc, char** argv) {

    nsDynamicFunctionLoad kXRESymbols[] = {
        {"XRE_InitEmbedding2", (NSFuncPtr*) &XRE_InitEmbedding2Delegate},
        {0, 0}
    };

    GtkWidget *window;
    gtk_init(&argc, &argv);

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_widget_show(window);

    nsresult rv = XPCOMGlueStartup("/home/Victor/Projects/JavaXPCOM/xulrunner-sdk/bin/libxpcom.so");
    if (NS_FAILED(rv)) {
        return rv;
    }

    rv = XPCOMGlueLoadXULFunctions(kXRESymbols);
    if (NS_FAILED(rv)) {
        return rv;
    }

    nsILocalFile *libXULDir;
    rv = NS_NewNativeLocalFile(nsEmbedCString("/home/Victor/Projects/JavaXPCOM/xulrunner-sdk/bin"), PR_FALSE, &libXULDir);
    if (NS_FAILED(rv)) {
        return rv;
    }

    rv = XRE_InitEmbedding2Delegate(libXULDir, libXULDir, nsnull);
    if (NS_FAILED(rv)) {
        return rv;
    }
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return 0;
}

I compiled this application with the following command line:

make all 
Building file: ../src/JavaXPCOMTest.cpp
Invoking: GCC C++ Compiler
g++ -DXPCOM_GLUE_USE_NSPR=1 -DXPCOM_GLUE=1 -I/home/Victor/Projects/JavaXPCOM/xulrunner-sdk/include -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -O0 -g3 -Wall -c -fmessage-length=0 -std=gnu++0x `pkg-config --cflags --libs gtk+-2.0` -MMD -MP -MF"src/JavaXPCOMTest.d" -MT"src/JavaXPCOMTest.d" -o"src/JavaXPCOMTest.o" "../src/JavaXPCOMTest.cpp"
Finished building: ../src/JavaXPCOMTest.cpp

Building target: JavaXPCOMTest
Invoking: GCC C++ Linker
g++ -L/home/Victor/Projects/JavaXPCOM/xulrunner-sdk/lib -L/home/Victor/Projects/JavaXPCOM/xulrunner-sdk/bin -Wl,-rpath-link,/home/Victor/Projects/JavaXPCOM/xulrunner-sdk/bin -o"JavaXPCOMTest"  ./src/JavaXPCOMTest.o   -lxpcomglue -lstdc++ `pkg-config --cflags --libs gtk+-2.0`
Finished building target: JavaXPCOMTest

When I run this application I receive SIGSEGV when invoke the XRE_InitEmbedding2Delegate function with the following call stack:

Thread [1] 15449 (Suspended : Signal)   
    _dl_fixup() at 0x3dbd60dbec 
    _dl_runtime_resolve() at 0x3dbd614315   
    0x7fffee4031d3  
    0x7fffee429209  
    0x7fffee429223  
    0x7fffee42a943  
    0x7fffee42b7ae  
    0x7fffee42bb25  
    NS_InitXPCOM2_P() at 0x7fffee4063a9 
    XRE_InitEmbedding2() at 0x7fffed998ce7  
    <...more frames...>

Does anybody reproduced similar issue on Linux platform with XULRunner 15? Maybe I use some wrong command line parameters or forget to include something in command line.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:42:46+00:00Added an answer on June 14, 2026 at 8:42 am

    It might be related to this unanswered bug report:

    Since Firefox 10 we get a crash while creating (constructor) the MozApp-object. More precisely the crash is by calling the API ‘XRE_InitEmbedding2()’ (its function-
    pointer is valid!) … Up to version 9 of Firefox we do not have this crash – only since version 10. You can find details in the following bug report here:
    https://bugzilla.mozilla.org/show_bug.cgi?id=724822

    You might be able to use the Embedded API. But using gtkmozembed is doomed anyway, as the authors are withdrawing all support for it, so any problems that you find will not be fixed:

    • The future of binary embedding announcement in mozilla.dev.embedding
    • Ubuntu withdraws gtkmozembed

    WebKitGTK is often used as an alternative browser component (based on WebKit), although I found it unstable for running the Adobe Flash plugin through NPAPI. If you can live with its limitations, gtkhtml is simpler and therefore more reliable, and may work better for you.

    Finally, for anyone who arrived here looking for solutions to gtkmozembed crashing with SIGSEGV in xulrunner (as I did), the answer may be that you forgot to run your app through run-mozilla.sh, which tells Mozilla where to find its components.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wonder if the objective function of a general dynamic programming problem can always
This is a general question, It has always been a nightmare to me trying
As I always type I am new to rails and programming in general so
just a general question, do you ALWAYS have to handle error? i was just
In my controller, I always end up with something like: [HttpPost] public ActionResult General(GeneralSettingsInfo
While I understand what simulation and emulation mean in general, I almost always get
General use case I am trying to implement a basic shell. Description I need
I have general question that if an asp.net webmethod always returns data in 'json'
I'm new to OpenGL and graphics programming in general, though I've always been interested
I have always felt that in general the main work of a class should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.