Bug 395661 - Chmsee crashes on given chm file (with xulrunner)
Summary: Chmsee crashes on given chm file (with xulrunner)
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: chmsee
Version: rawhide
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Yijun Yuan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-22 13:59 UTC by Martin Stransky
Modified: 2007-11-30 22:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-25 08:54:10 UTC
Type: ---
Embargoed:


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

Description Martin Stransky 2007-11-22 13:59:17 UTC
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
3.
  
Actual results:
crash

Expected results:


Additional info:

Backtrace:

#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
EmbedPrivate.cpp:933
#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
"/home/komat/tmp342/myman-5.0.0-alpha.chm")
    at chmsee.c:1083
#5  0x000000000040b533 in open_response_cb (widget=0x91b000, response_id=<value
optimized out>, chmsee=0x64c000)
    at chmsee.c:232

[snip]

Comment 1 Martin Stransky 2007-11-22 13:59:17 UTC
Created attachment 266891 [details]
test chm file

Comment 2 Yijun Yuan 2007-11-25 03:05:03 UTC
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
nsEmbedStream.cpp:199
#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
gtkmozembed2.cpp:980
#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
"/home/yuan/Desktop/myman-5.0.0-alpha.chm")
    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-25 03:18:47 UTC
The function in html.c looks like:

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

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-25 04:11:37 UTC
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-25 04:19:54 UTC
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);
194 
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 06:54:14 UTC
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 08:54:10 UTC
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 08:59:55 UTC
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 09:45:18 UTC
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.