Issue 107283 - xmlhelp: looks for idx*.xsl in wrong path
Summary: xmlhelp: looks for idx*.xsl in wrong path
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOO320m6
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 3.2
Assignee: ab
QA Contact: issues@framework
URL:
Keywords: regression
Depends on:
Blocks: 99999
  Show dependency tree
 
Reported: 2009-11-28 16:55 UTC by rene
Modified: 2017-05-20 10:29 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch file for module transex3 (5.06 KB, text/plain)
2009-12-02 15:36 UTC, ab
no flags Details
Patch file for module desktop (911 bytes, text/plain)
2009-12-02 15:37 UTC, ab
no flags Details
Corrected desktop patch (1.02 KB, text/plain)
2009-12-03 18:09 UTC, ab
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description rene 2009-11-28 16:55:10 UTC
[ filing this against xmlhelp, as I think it is where it belongs, if
the extension manager is at fault please reassign, but I doubt so ]

Hi,

we move our help to /usr/share/openoffice/basisX.Y/help/xx etc. with the
appropriate path changes in 
This worked until m5, in m6 it broke (seen when installing the wiki-publisher
extension which tried to register help):

Copying: wiki-publisher.oxt
Enabling: Wiki Publisher
 Enabling: help
error
xsltParseStylesheetFile : cannot parse
/usr/lib/openoffice/program/../basis-link/help/idxcaption.xsl
error
xsltParseStylesheetFile : cannot parse
/usr/lib/openoffice/program/../basis-link/help/idxcontent.xsl
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f4895ed5dd2, pid=14595, tid=139949907818256
#
# JRE version: 6.0-b16
# Java VM: OpenJDK 64-Bit Server VM (14.0-b16 mixed mode linux-amd64 )
# Distribution: Debian GNU/Linux unstable (sid), package 6b16-1.6.1-2
# Problematic frame:
# C  [libhelplinkerlx.so+0x6dd2]
#
# An error report file with more information is saved as:
# /home/rene/Debian/Pakete/openoffice.org/hs_err_pid14595.log
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
#

[error occurred during error reporting , id 0xb]

Aborted

As we see it looks in the wrong path. Did some new property so specify the help
path get added or does new code not honour the setting?
Comment 1 rene 2009-11-28 16:55:53 UTC
regression...
Comment 2 rene 2009-11-28 17:22:33 UTC
oops, apparently I forgot to actually complete Summary, sorry...
Comment 3 rene 2009-11-28 18:08:34 UTC
The only occurances of idxcaption.xsl I see in helpcontent2 and transex3, but
how is  this accessed later? By lucene?

grep -r idxcaption *
helpcontent2/source/auxiliary/.svn/entries:idxcaption.xsl
helpcontent2/util/makefile.mk:ZIP1LIST=main_transform*.xsl idxcaption.xsl
idxcontent.xsl
helpcontent2/util/target.pmk:	$(HELPLINKER) @$(mktmp -mod $(LINKNAME) -hid
$(PRJ)$/helpers$/hid.lst -src $(COMMONMISC) -sty
$(PRJ)$/source$/auxiliary$/embed.xsl -zipdir $(MISC)$/ziptmp$(@:b) -idxcaption
$(PRJ)$/source$/auxiliary$/idxcaption.xsl -idxcontent
$(PRJ)$/source$/auxiliary$/idxcontent.xsl -lang {$(subst,$(LINKNAME)_, $(@:b))}
$(subst,LANGUAGE,{$(subst,$(LINKNAME)_, $(@:b))} $(LINKADDEDFILES))
$(foreach,i,$(LINKLINKFILES) $(COMMONMISC)$/{$(subst,$(LINKNAME)_, $(@:b))}/$i)
-o $@)
transex3/source/help/HelpLinker.cxx:        else if
(args[i].compare("-idxcaption") == 0) 
transex3/source/help/HelpLinker.cxx:				aStrStream << "idxcaption stylesheet
missing" << std::endl;
transex3/source/help/HelpLinker.cxx:		aIdxCaptionPathFileURL +=
rtl::OUString::createFromAscii( "/idxcaption.xsl" );


Comment 4 Olaf Felka 2009-11-30 06:38:54 UTC
reassigned
@ ab: something for you?
Comment 5 ab 2009-11-30 14:21:03 UTC
STARTED, I see no obvious reason so far...
Comment 6 uwe.luebbers 2009-11-30 16:09:59 UTC
Adjusted target
Comment 7 ab 2009-12-01 11:02:15 UTC
ab->rene:
idxcaption.xsl and idxcontent.xsl are needed in the context of
creating the Lucene index, but they are not directly accessed
by Lucene. Lucene just processes a set of files stripped down
from the original help files using xslt. This is done in C++.

The helpcontent2 stuff is only used for building helpcontent2.
For the extension case the code in transex3 is used. The path
addressing the xsl files is calculated there using the help
base path $OOO_BASE_DIR/help. The failing calls to xsltParse-
StylesheetFile are done in HelpLinker.cxx / line 88 in the
IndexerPreProcessor ctor. The Java problem probably is only a
subsequent error.

As there is no change in transex3 from m5 to m6 the problem
must be located somewhere else. In a m6 StarOffice I had no
problem installing an extension containing help, but there
of course the help path is the default one.

So what exactly are the appropriate path changes you've mentio-
ned above? I think the fastest way to reproduce the problem
would be to patch my m6 StarOffice to behave in a similar way
and check if something goes wrong with the macro expansion.
Comment 8 rene 2009-12-01 11:38:09 UTC
> idxcaption.xsl and idxcontent.xsl are needed in the context of
> creating the Lucene index, but they are not directly accessed
> by Lucene. Lucene just processes a set of files stripped down
> from the original help files using xslt. This is done in C++.

OK

> For the extension case the code in transex3 is used. The path
> addressing the xsl files is calculated there using the help
> base path $OOO_BASE_DIR/help.

bad.

> The failing calls to xsltParse-
> StylesheetFile are done in HelpLinker.cxx / line 88 in the
> IndexerPreProcessor ctor. The Java problem probably is only a
> subsequent error.

That I guessed. :)

> As there is no change in transex3 from m5 to m6 the problem
> must be located somewhere else. In a m6 StarOffice I had no
> problem installing an extension containing help, but there
> of course the help path is the default one.

I would have bet m5 worked, but maybe either only by chance or because it was
a en-US only build and m6 with all languages...?

> So what exactly are the appropriate path changes you've mentio-
> ned above? I think the fastest way to reproduce the problem
> would be to patch my m6 StarOffice to behave in a similar way
> and check if something goes wrong with the macro expansion.

No macro expansion involved :)

rengelhard@lxrengelhard:/usr/lib/openoffice/basis3.1/share/registry$ grep -r
\/help *
data/org/openoffice/Office/Paths.xcu:        <node oor:name="$(instpath)/help"
oor:op="fuse"/>
schema/org/openoffice/Office/Common.xcs:          <value>$(instpath)/help</value>
schema/org/openoffice/Office/Common.xcs:          <value>$(instpath)/help</value>

Those I change to /usr/share/openoffice/basisX.Y/help.

Works in 3.1.1
Comment 9 ab 2009-12-01 14:33:42 UTC
> > For the extension case the code in transex3 is used. The path
> > addressing the xsl files is calculated there using the help
> > base path $OOO_BASE_DIR/help.

> bad.

Indeed, the configuration path should be used. Unfortunately
HelpLinker.cxx has been moved from xmlhelp to transex3 which
is a tooling project trying to avoid any dependency to other
libs as far as possible. It doesn't even use UNO, so acces-
sing the configuration is a problem. I will check this.


> I would have bet m5 worked, but maybe either only by chance or because it was
> a en-US only build and m6 with all languages...?

The xsl files are placed in .../help and that's also the root
for the language folders, e.g. .../help/en. So the problem
should not depend on languages.


> So what exactly are the appropriate path changes you've mentio-
> ned above? I think the fastest way to reproduce the problem
> would be to patch my m6 StarOffice to behave in a similar way
> and check if something goes wrong with the macro expansion.

> data/org/openoffice/Office/Paths.xcu:        <node oor:name="$(instpath)/help"

> Those I change to /usr/share/openoffice/basisX.Y/help.

> Works in 3.1.1

That's what really surprises me. The feature has been introdu-
ced for OOo 3.1 (i83626 "Support full text search in extension
help", http://www.openoffice.org/issues/show_bug.cgi?id=83626)
and, although placed in xmlhelp first, HelpLinker.cxx has al-
ways used this wrong way of getting the help path.

So maybe only the Java crash is new? If I remember correctly
your distribution does not depend on Lucene. Without Lucene
the problem would only become visible if you tried to search
content within the extension's help. The search will always
fail then. Or are you sure that the "xsltParseStylesheetFile
: cannot parse" error did not show up before?

To make sure we don't have a general Java problem here, could
you check if everything works correctly if you place the help
at $OOO_BASE_DIR/help and then install the extension?
Comment 10 rene 2009-12-01 14:44:02 UTC
> So maybe only the Java crash is new? If I remember correctly
> your distribution does not depend on Lucene. Without Lucene

Correct. But in this case I do* have lucene installed.

> the problem would only become visible if you tried to search
> content within the extension's help. The search will always
> fail then. Or are you sure that the "xsltParseStylesheetFile
> : cannot parse" error did not show up before?

It didn't show up before, I am sure, yes.

> To make sure we don't have a general Java problem here, could
> you check if everything works correctly if you place the help
> at $OOO_BASE_DIR/help and then install the extension?

Yes, it does. (It also does with the said symlink
/usr/lib/openoffice/basisX.Y/help -> /usr/share/openoffice/basisX.Y/help)

Regards,

Rene
Comment 11 rene 2009-12-01 14:47:28 UTC
apparently I am too tired...

> > Works in 3.1.1
>
> That's what really surprises me. The feature has been introdu-
> ced for OOo 3.1 (i83626 "Support full text search in extension
> help", http://www.openoffice.org/issues/show_bug.cgi?id=83626)
> and, although placed in xmlhelp first, HelpLinker.cxx has al-
> ways used this wrong way of getting the help path.

This of course is nonsense. In 3.1.1 I still have the help in /usr/lib.
Bad me, sorry.

But still, I amn quite qure the failure did *not* happen with m5
Comment 12 ab 2009-12-01 15:21:47 UTC
> > Works in 3.1.1

> This of course is nonsense. In 3.1.1 I still have the help in /usr/lib.
> Bad me, sorry.

Ok, using the "right" path is a valid explanation... :-)


> But still, I amn quite qure the failure did *not* happen with m5

Anyway, we don't really have to clarify this. In any case
using $OOO_BASE_DIR/help is wrong, so I will focus on fin-
ding a solution for this.
Comment 13 ab 2009-12-02 15:36:32 UTC
Created attachment 66455 [details]
Patch file for module transex3
Comment 14 ab 2009-12-02 15:37:07 UTC
Created attachment 66456 [details]
Patch file for module desktop
Comment 15 ab 2009-12-02 15:38:36 UTC
ab->rene:
I've found a way to fix this without linking transex3 to addi-
tional libraries by passing the Office help path when calling
compileExtensionHelp() from desktop/source/deployment/registry/
help/dp_help.cxx. After learning that changing Common.xcs only
helps after deleting user/registry/cache :-) I tried a diffe-
rent help path and it worked.

For the case you also want to test this in your scenario I've
attached the diffs for module transex3 and desktop. Please
note that the change in desktop depends on the one in transex3,
so transex3 needs to be delivered before building desktop.

I suspect the missing (and now added) if statements in Indexer-
PreProcessor::processDocument() to really cause the crash (at
least it did on Windows). So seeing no crash is not enough to
verify the fix. To be sure after installing the extension fin-
ding something in its help content has to work.
Comment 16 rene 2009-12-03 07:40:41 UTC
now I get

opying: wiki-publisher.oxt
Enabling: Wiki Publisher
 Enabling: help
error
xsltParseStylesheetFile : cannot parse 
error
xsltParseStylesheetFile : cannot parse 
error
xsltParseStylesheetFile : cannot parse 
error
xsltParseStylesheetFile : cannot parse 
error
xsltParseStylesheetFile : cannot parse 
error
xsltParseStylesheetFile : cannot parse 
 Enabling: WikiExtension.xcs
 Enabling: WikiEditor
 Enabling: mediawiki.jar
 Enabling: Addons.xcu
 Enabling: ProtocolHandler.xcu
 Enabling: WikiExtension.xcu
 Enabling: OptionsDialog.xcu
 Enabling: Filter.xcu
 Enabling: Types.xcu
 Enabling: Paths.xcu

unopkg done.

(yes, it really returns with 0 although there was an error, but that's not a bug
here but unopkg madness)
Comment 17 rene 2009-12-03 07:43:45 UTC
(the help does appear in the OOo help, but searching for Wiki, WikiPublisher,
"Verbindung Wiki" or anything else doesn't find something unsurprisingly)
Comment 18 ab 2009-12-03 14:52:05 UTC
ab->rene:
Short update: I switched to Linux and could exactly reproduce
what you have seen, including the Java error message. This ob-
viously is only because Java registered as signal handler.
I don't understand yet why it does work on Windows but not on
Linux. Debugging this now, stay tuned... :-)
Comment 19 ab 2009-12-03 18:08:02 UTC
The problem was: Surprisingly SvtPathOptions().GetHelpPath()
does not return a file URL (some SvtPathOptions().GetXXX do
so, some don't) but a system path. For reasons I don't under-
stand this doesn't matter on Windows. Obviously the xslt API
accepts this path there. This doesn't work on Linux, so the
help compilation still fails, but the crash is avoided by
the previously added if statements. The solution of course
was to convert the system path to a file URL.

Tested successfully on Windows and Linux -> FIXED
Comment 20 ab 2009-12-03 18:09:53 UTC
Created attachment 66479 [details]
Corrected desktop patch
Comment 21 carsten.driesner 2009-12-04 15:45:03 UTC
cd->ab: Please send to QA or verify issue yourself.
Comment 22 rene 2009-12-04 22:30:12 UTC
rene->cd: no need to; pmladek and me can confirm the fix (with the updated
desktop.diff) works