Created attachment 149297 [details] Small docx related to the error messages When I run the attached Java code with the doc attached. I got the following messages: CE> E: file lt-string.c: line 189: assertion `string != ((void *)0)' failed CE> E: l)file lt-string.c: line 189: assertion `string != ((void *)0)' failed CE> E: l)file lt-string.c: line 189: assertion `string != ((void *)0)' failed CE> E: l)file lt-string.c: line 189: assertion `string != ((void *)0)' failed On different runs the message differ a little bit: CE> E: file lt-string.c: line 189: assertion `string != ((void *)0)' failed CE> E: l)file lt-string.c: line 189: assertion `string != ((void *)0)' failed CE> E: l)file lt-string.c: line 189: assertion `string != ((void *)0)' failed CE> E: sfile lt-string.c: line 189: assertion `string != ((void *)0)' failed It looks like a memory corruption. Below the Java code calling the SDK: -------------------------------------------------------- import java.util.Date; import java.io.File; import com.sun.star.beans.PropertyValue; import com.sun.star.comp.helper.Bootstrap; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XDesktop; import com.sun.star.frame.XStorable; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.util.XReplaceDescriptor; import com.sun.star.util.XReplaceable; public class LibreOffice { public static void main(String[] args) { XDesktop xDesktop = null; int exitCode = 0; try { // Initialise XComponentContext xContext = Bootstrap.bootstrap(); XMultiComponentFactory xMCF = xContext.getServiceManager(); Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext); xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, oDesktop); documentConvert(xDesktop, "D:/MyData/pdf/docx/toto.docx", "D:/MyData/pdf/pdf/toto.pdf"); } catch (Exception e) { e.printStackTrace(); exitCode = 1; } if(xDesktop != null) xDesktop.terminate(); System.exit(exitCode); } public static void documentConvert (XDesktop xDesktop, String inputPath, String outputPath) throws Exception { // Load the Document File inputFile = new File (inputPath); if (!inputFile.canRead()) { throw new RuntimeException("Cannot load document:" + inputFile); } XComponentLoader xCompLoader = (XComponentLoader) UnoRuntime.queryInterface(com.sun.star.frame.XComponentLoader.class, xDesktop); PropertyValue[] propertyValues = new PropertyValue[0]; propertyValues = new PropertyValue[1]; propertyValues[0] = new PropertyValue(); propertyValues[0].Name = "Hidden"; propertyValues[0].Value = new Boolean(true); XComponent xComp = xCompLoader.loadComponentFromURL("file:///" + inputPath, "_blank", 0, propertyValues); /* // save as a PDF XStorable xStorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xComp); propertyValues = new PropertyValue[2]; propertyValues[0] = new PropertyValue(); propertyValues[0].Name = "Overwrite"; propertyValues[0].Value = new Boolean(true); propertyValues[1] = new PropertyValue(); propertyValues[1].Name = "FilterName"; propertyValues[1].Value = "writer_pdf_Export"; // Appending the favoured extension to the origin document name String outputFile = outputPath; System.out.println("before"); System.out.println(xStorable + "-" + "file:///" + outputFile + "-" + propertyValues); xStorable.storeToURL("file:///" + outputFile, propertyValues); System.out.println("Saved " + outputFile); */ } }
In the docx file, there is a reference to a missing style. Heading2Char is not defined. This leads to a memory corruption: <w:style w:type="paragraph" w:styleId="Heading2"> <w:name w:val="heading 2"/> <w:aliases w:val="2"/> <w:basedOn w:val="Normal"/> <w:next w:val="Normal"/> <w:link w:val="Heading2Char"/><!-- bad ref -->
Word skips this style when it loads the document.
My previous assertion about missing ref is wrong. It seems that the pb for LibreOffice is related to <!--<w:lang w:val="x-none" w:eastAsia="x-none"/>-->
it looks like "x-none" is not supported.
Confirmed in Version: 6.3.0.0.alpha0+ Build ID: 7c7a4675ad5d61add70dd073f680ea37012962ce CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US Calc: threaded but not in Version: 5.2.0.0.alpha0+ Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53 Threads 4; Ver: 4.15; Render: default; no need to run the java code, I get the warning just by opening the file...
Created attachment 150158 [details] console logs On pc Debian x86-64 with master sources updated today, I could reproduce this but had a lot of messages on console.
these logs appear too here: https://bugs.documentfoundation.org/show_bug.cgi?id=79069#c5 https://bugs.documentfoundation.org/show_bug.cgi?id=115630#c3
Argh, I don't have exactly the same thing, I've got: E: lt_string_value: assertion `string != ((void *)0)' failed whereas this bug indicates: CE> E: file lt-string.c: line 189: assertion `string != ((void *)0)' failed or CE> E: l)file lt-string.c: line 189: assertion `string != ((void *)0)' failed
file lt-string.c: line 189: assertion `string != ((void *)0)' failed come from workdir/UnpackedTarball/liblangtag/liblangtag/lt-string.c 178 /** 179 * lt_string_value: 180 * @string: a #lt_string_t 181 * 182 * Returns the buffer in @string. 183 * 184 * Returns: a string which @string has. 185 */ 186 const char * 187 lt_string_value(const lt_string_t *string) 188 { 189 lt_return_val_if_fail (string != NULL, NULL); 190 191 return string->string; 192 }
Created attachment 150160 [details] bt with debug symbols
*** Bug 131890 has been marked as a duplicate of this bug. ***
(In reply to Xisco Faulí from comment #11) > *** Bug 131890 has been marked as a duplicate of this bug. *** This Bug did not be fixed for over a year?