Closed
Bug 208027
Opened 22 years ago
Closed 18 years ago
xlib embedded api - crash in nsIBaseWindow.create
Categories
(Core Graveyard :: GFX: Xlib, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: christophe_cornu, Assigned: roland.mainz)
Details
(Keywords: crash)
Attachments
(3 files)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830
I am trying to embed Mozilla into an xlib/motif application.
I built an xlib version of Mozilla 1.3.1 on Linux RH8.0.
I wrote a simple xlib/motif test case which crashes at:
baseWindow->InitWindow(handle, ....)
baseWindow->Create(); // Crash
handle is an X top level shell created with XtAppCreateShell
baseWindow is a NsIBaseWindow.
Similar test cases work fine on Windows, GTK and Carbon.
Can the Xlib Mozilla port be embedded into an Xlib/Motif application? Which
native handle should I pass on to NsIBaseWindow.InitWindow?
If the embedded api is known not to be working for Xlib builds, please let me know.
Thanks,
Chris
Reproducible: Always
Steps to Reproduce:
1. build xlib mozilla (1.3.1) on linux RH8.0
2. build the test case (see Makefile and source nsTestSample.cpp
The way I do it is:
- create a folder mytest in <mozilla>/xpcom/
- copy all the content from <mozilla>/xpcom/sample into <mozilla>/xpcom/mytest
- copy over the Makefile and nsTestSample.cpp in the mytest folder
- do a make in the mytest folder
- run nsTestSample
Actual Results:
new native local file /usr/local/mozilla2swt/1.3.1/x11/mozilla/dist/bin
InitXPCOM 0
InitWindow with handle 134607392
Create
Segmentation fault (core dumped)
Expected Results:
Expected to see a top level Shell with an embedded Mozilla.
| Reporter | ||
Comment 1•22 years ago
|
||
| Reporter | ||
Comment 2•22 years ago
|
||
Makefile for the test case.
Chris,
Looking at what's currently in CVS (6/5/03), the crash in Create() you're
seeing begins on line 130 in nsWidget.cpp
(http://lxr.mozilla.org/seamonkey/source/widget/src/xlib/nsWidget.cpp#130):
mXlibRgbHandle = nsAppShell::GetXlibRgbHandle();
An nsAppShell has not been instantiated in your code so mXlibRgbHandle receives
junk from the static function nsAppShell::GetXlibRgbHandle(). On the following
line:
mBackgroundPixel = xxlib_rgb_xpixel_from_rgb(mXlibRgbHandle, mBackground);
When xxlib_rgb_xpixel_from_rgb() dereferences the mXlibRgbHandle (which is
null) passed into it, it crashes Mozilla.
The Mozilla Xlib widgets depend on the Xlib nsIAppShell implementation. Without
rewriting a bunch of the Xlib widget code, you're stuck creating an nsAppShell
and running it in main().
Try the attached file in place of your nsTestSample.cpp test case. You'll still
need to add window event handlers, but this gets you started.
| Reporter | ||
Comment 4•22 years ago
|
||
Many thanks for the reply. I'm trying it and will update the PR.
| Reporter | ||
Comment 5•22 years ago
|
||
Using the nsIAppShell as described by Keith in comment 3 does work. So this
provides a workaround to this bug report (aka, this requires running
the 'embedded' mozilla into its own top level window and in its own separate
event loop).
Is there a way to embed an Xlib Mozilla as a child of an existing (Xlib) top level
shell (as it is possible on the other platforms with baseWindow->InitWindow
(handle,...)?
Comment 6•20 years ago
|
||
This is an automated message, with ID "auto-resolve01".
This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.
While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.
If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.
The latest beta releases can be obtained from:
Firefox: http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey: http://www.mozilla.org/projects/seamonkey/
Comment 7•20 years ago
|
||
.
Comment 9•18 years ago
|
||
Gtk1/xlib widget code has been removed on trunk and this bug doesn't seem
like a branch candidate.
-> WONTFIX
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → WONTFIX
Updated•17 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•