Bug 872752 - Embedding xulrunner can be fixed
Summary: Embedding xulrunner can be fixed
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: xulrunner
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Horak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-02 22:02 UTC by Zoltan Boszormenyi
Modified: 2013-08-01 01:13 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-08-01 01:13:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch to fix xulrunner embedding (1.11 KB, patch)
2012-11-02 22:04 UTC, Zoltan Boszormenyi
no flags Details | Diff
Patch to fix xulrunner embedding v2 (1.79 KB, patch)
2012-11-06 18:54 UTC, Zoltan Boszormenyi
no flags Details | Diff
Patch to update mozembed (18.17 KB, patch)
2012-11-06 19:00 UTC, Zoltan Boszormenyi
no flags Details | Diff

Description Zoltan Boszormenyi 2012-11-02 22:02:04 UTC
Description of problem:

Linking to libxul.so (using pkg-config --cflags --libs libxul) and calling NS_InitXPCOM2() or libxpcomglue.so (using pkg-config --cflags --libs libxul-embedding) and calling XRE_InitEmbedding2() results in a segmentation fault. However, observing the libraries that the programs under xulrunner/mozilla-release/xpcom/tests/ are linked to reveals that some extra static libraries are missing from libxul.pc and libxul-embedding.pc which are linked into the application using -Wl,--whole-archive. These are:

  -Wl,--whole-archive -lmozglue -lmemory

This is the detail that defeats every external projects nowadays to properly embed the Gecko engine.

Version-Release number of selected component (if applicable):

xulrunner 16.0.2

How reproducible:

Always.

Steps to Reproduce:
1. Try pulling e.g. mozilla-release/xpcom/tests/TestRacingServiceManager.cpp
   and TestHarness.h out of the xulrunner source and build it using only
   pkgconfig --cflags --libs libxul.
2. Run it.
3.
  
Actual results:

Segfault.

Expected results:

Run successfully.

Additional info:

There is a showstopper to fixing this problem: pkg-config rearranges the libraries and separated the -Wl,... options so the static libraries lose the proper settings. FDO bug to fix this is: https://bugs.freedesktop.org/show_bug.cgi?id=56699

Comment 1 Zoltan Boszormenyi 2012-11-02 22:04:03 UTC
Created attachment 637292 [details]
Patch to fix xulrunner embedding

After fixing pkg-config, this patch adds the missing static libraries to both libxul.pc and libxul-embedding.pc.

Comment 2 Martin Stransky 2012-11-06 09:42:13 UTC
Thanks! 

It looks like something we should move upstream (report it at bugzilla.mozilla.org). Would you like to report it or shall I do so?

Comment 3 Martin Stransky 2012-11-06 14:37:19 UTC
Added to xulrunner-16.0.2-3 for all Fedoras.

Comment 4 Zoltan Boszormenyi 2012-11-06 18:54:08 UTC
Created attachment 639501 [details]
Patch to fix xulrunner embedding v2

After testing the previous patch a lot, it seems it does the wrong thing. E.g. using the libxul-embedding.pc creates by the first patch in both the "mozembed" code and a test program using the mozembed code results in a linker error complaining about duplicate symbols. The resolution is to split the libxul-embedding.pc file into two: one usable by shared object wrapping libxul/libxpcom[glue] and one usable by applications. This avoids the symbols in the "whole archive" linked into both a library and the app. This patch implements this.

Comment 5 Zoltan Boszormenyi 2012-11-06 19:00:14 UTC
Created attachment 639504 [details]
Patch to update mozembed

Just for reference, this patch updates the Embedding/NewApi code to the current xulrunner 16.0.x API and relies on the just posted "v2" patch against xulrunner. Actually, only the common and the gtk/x11 part of it.

The Embedding/NewApi page is here: https://wiki.mozilla.org/Embedding/NewApi
The patch is against this Mercurial repo (current tip, rev 29ac0fe51754):
hg clone http://hg.mozilla.org/incubator/embedding/ mozembed

Comment 6 Zoltan Boszormenyi 2012-11-06 19:02:09 UTC
(In reply to comment #2)
> Thanks! 
> 
> It looks like something we should move upstream (report it at
> bugzilla.mozilla.org). Would you like to report it or shall I do so?

I am only familiar with Fedora developers and I am shy to report it to Mozilla. :-) It would be nice from you to do it as a RedHat representative...

Comment 7 Martin Stransky 2012-11-07 08:30:48 UTC
Okay, not a problem :) It looks more complicated that I expected and I'd like to update it for gtkmozembed too, we still ship it on RHEL. I'll report it at mozilla when it's ready and tested.

Comment 8 Fedora End Of Life 2013-07-03 22:58:01 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Fedora End Of Life 2013-08-01 01:13:36 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.