Bug 395661 - Chmsee crashes on given chm file (with xulrunner)
Chmsee crashes on given chm file (with xulrunner)
Product: Fedora
Classification: Fedora
Component: chmsee (Show other bugs)
All Linux
low Severity high
: ---
: ---
Assigned To: Yijun Yuan
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-11-22 08:59 EST by Martin Stransky
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-11-25 03:54:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
test chm file (2.40 MB, application/octet-stream)
2007-11-22 08:59 EST, Martin Stransky
no flags Details

  None (edit)
Description Martin Stransky 2007-11-22 08:59:17 EST
Description of problem:

I built the latest devel version against xulrunner (gecko-libs 1.9) which is in
rawhide now. Chmsee is built and starts but when I try to open a test file,
chmsee crashes in gecko-libs.

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

How reproducible:

Steps to Reproduce:
1. compile agains xulrunner
2. open an attached file
Actual results:

Expected results:

Additional info:


#0  0x0000003264bcf548 in nsEmbedStream::AppendToStream (this=0xacfb60,
aData=<value optimized out>, aLen=42)
    at nsEmbedStream.cpp:199
#1  0x00000032646025f3 in EmbedPrivate::AppendToStream (this=0x729870, 
    aData=0x410388 "<html><body bgcolor=\"white\"></body></html>", aLen=42) at
#2  0x00000032645fd5ef in gtk_moz_embed_render_data (embed=<value optimized out>, 
    data=0x410388 "<html><body bgcolor=\"white\"></body></html>", len=42,
base_uri=0x4101a0 "file:///", 
    mime_type=0x410196 "text/html") at gtkmozembed2.cpp:980
#3  0x000000000040986b in new_tab (chmsee=0x64c000, location=0x0) at chmsee.c:1255
#4  0x000000000040b204 in chmsee_open_file (chmsee=0x64c000, filename=0xa56060
    at chmsee.c:1083
#5  0x000000000040b533 in open_response_cb (widget=0x91b000, response_id=<value
optimized out>, chmsee=0x64c000)
    at chmsee.c:232

Comment 1 Martin Stransky 2007-11-22 08:59:17 EST
Created attachment 266891 [details]
test chm file
Comment 2 Yijun Yuan 2007-11-24 22:05:03 EST
I installed chmsee-debuginfo and xulrunner-debuginfo, got a similar trace info,
but still cannot find a reason :(

#0  0x015a5af0 in nsEmbedStream::AppendToStream (this=0x8704088, 
    aData=0x8057584 "<html><body bgcolor=\"white\"></body></html>", aLen=42) at
#1  0x0159f4fb in nsWebBrowser::AppendToStream (this=0x86f0c60, aData=0x8057584
"<html><body bgcolor=\"white\"></body></html>", 
    aLen=42) at nsWebBrowser.cpp:1913
#2  0x00f3e0a4 in EmbedPrivate::AppendToStream (this=0x86f00d0, aData=0x8057584
"<html><body bgcolor=\"white\"></body></html>", 
    aLen=42) at EmbedPrivate.cpp:933
#3  0x00f38d2e in gtk_moz_embed_render_data (embed=0x861b8c0, data=0x8057584
"<html><body bgcolor=\"white\"></body></html>", 
    len=42, base_uri=0x80573fc "file:///", mime_type=0x80573f2 "text/html") at
#4  0x080535df in html_clear (html=0x86eca30) at html.c:324
#5  0x0805028b in new_tab (chmsee=0x8484018, location=0x0) at chmsee.c:1255
#6  0x08051e58 in chmsee_open_file (chmsee=0x8484018, filename=0x8693400
    at chmsee.c:1083
#7  0x080521c3 in open_response_cb (widget=0x85ee010, response_id=-5,
chmsee=0x8484018) at chmsee.c:232
Comment 3 Yijun Yuan 2007-11-24 22:18:47 EST
The function in html.c looks like:

317 void
318 html_clear(Html *html)
319 {
320         static const char *data = "<html><body
322         g_return_if_fail(IS_HTML (html));
324         gtk_moz_embed_render_data(html->gecko, data, strlen(data),
"file:///", "text/html");
325 }

I guess this might have something to do with firefox if chmsee tried to use
existing firefox config? I'll remove firefox config and try again (of course
close firefox for now)
Comment 4 Yijun Yuan 2007-11-24 23:11:37 EST
in nsEmbedStream::AppendToStream, 

194       // notify our listeners
195       rv = mStreamListener->OnDataAvailable(mChannel,
196                                             NULL,
197                                             static_cast<nsIInputStream *>(this),
198                                             mOffset, /* offset */
199                                             aLen); /* len */

(gdb) p mStreamListener
$54 = {<nsCOMPtr_base> = {mRawPtr = 0x0}, <No data fields>}

So I think chmsee is not initializing xpcom? or initialize failed in some way.
What should I change here?
Comment 5 Yijun Yuan 2007-11-24 23:19:54 EST
So here it is: in src/gecko_utils.h it assumes gecko-1.9 will use a different
way to initialize. Is this the case?

189 extern "C" void
190 gecko_utils_init(void)
191 {
192   if (!g_thread_supported())
193     g_thread_init(NULL);
195 #ifdef HAVE_GECKO_1_9
196   NS_LogInit();
197   gtk_moz_embed_set_path(GECKO_LIB_ROOT);
198 #else
199   gtk_moz_embed_set_comp_path(GECKO_LIB_ROOT);
200 #endif

Comment 7 Yijun Yuan 2007-11-25 01:54:14 EST
I am wrong. in the above init code, HAVE_GECKO_1_9 is not defined, this means
configure.ac needs some modification and configure be rebuilt I think, but I
cannot get the AM_PATH_CHMLIB macro.

any idea? /me contacting upstream for that, and now will get a copy of chmlib first.
Comment 8 Yijun Yuan 2007-11-25 03:54:10 EST
I don't know how to modify configure.ac so just added HAVE_GECKO_1_9 to make
commandline, now building. I will contact upstream for a fix.
Comment 9 Martin Stransky 2007-11-26 03:59:55 EST
Great job to trace it down! HAVE_GECKO_1_9 should be added to configure.ac and I
can do it if you want.
Comment 10 Martin Stransky 2007-11-27 04:45:18 EST
I've just checked the gtk_moz_embed_set_path and works fine with XUL Runner.
Anyway, there's an another issue - XUL Runner doesn't seem to use CSS from the
pages, BZ is already filed for it.

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