View Issue Details

IDProjectCategoryView StatusLast Update
0016327ScribusBuild Systempublic2021-03-23 06:25
Reportererictapen Assigned Tojghali  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5.6 
Fixed in Version1.5.7.svn 
Summary0016327: libhunspellplugin.so fails to load
DescriptionI'm maintaining Scribus on NixOS. When building Scribus 1.5.6, I get an error message at startup:

> There is a problem loading 1 of 48 plugins.
> libhunspellplugin.so
> This is probably caused by some kind of dependency issue or old plugins existing in your install directory. If you clean out your install directory and reinstall and this still occurs, please report it on bugs.scribus.net.

Any idea what causes this?
Steps To ReproduceWhen using nixUnstable with flakes support you can run

  nix build github:erictapen/Nixpkgs/scribus-1.5.6#scribusUnstable

to build the same closure I'm testing. Then run

  ./result/bin/scribus

to observe the error.
TagsNo tags attached.
PatchNo

Activities

erictapen

2020-11-11 10:56

reporter   ~0048375

Just one more note: I already deleted ~/.scribus prior to testing to make sure I have no hidden system state what causes this. And this is the terminal output:

$ ./result/bin/scribus
Cannot find plugin: /nix/store/9fxi23s82djnq1nswligkavghhhb10lw-scribus-1.5.6/lib/scribus/plugins//libhunspellplugin.so: undefined symbol: _ZN14ScWordIteratorC1ER9StoryText
Cannot find plugin: /nix/store/9fxi23s82djnq1nswligkavghhhb10lw-scribus-1.5.6/lib/scribus/plugins//libhunspellplugin.so: undefined symbol: _ZN14ScWordIteratorC1ER9StoryText
pathForIcon: Unable to load icon /nix/store/9fxi23s82djnq1nswligkavghhhb10lw-scribus-1.5.6/share/scribus/icons/1_5_1/lab.png: File not found
pathForIcon: Unable to load icon /nix/store/9fxi23s82djnq1nswligkavghhhb10lw-scribus-1.5.6/share/scribus/icons/1_5_1/spot.png: File not found
pathForIcon: Unable to load icon /nix/store/9fxi23s82djnq1nswligkavghhhb10lw-scribus-1.5.6/share/scribus/icons/1_5_1/register.png: File not found
qt.gui.icc: Unsupported ICC profile class 70727472
qt.gui.icc: fromIccProfile: failed general sanity check
QPngHandler: Failed to parse ICC profile

ale

2020-11-11 11:05

manager   ~0048376

when compiling scribus, did you do a clean build? (by removing the old build directory before compiling...)

erictapen

2020-11-11 11:30

reporter   ~0048377

@ale Yes, it's impossible to keep any old build directories with Nix.

ale

2020-11-12 19:31

manager   ~0048385

the debian/ubuntu packaging seems to have the same issue.

mattia suggests that it might be related to the "-Wl,--as-needed" options in gcc....
untested.

erictapen

2020-11-12 23:06

reporter   ~0048392

Mh do you have a link for that?

Neither supplying `--as-needed` nor `--no-as-needed`as a ld flag solves the problem.

mjg

2020-11-13 10:38

reporter   ~0048396

I have the same problem on Fedora (since a few svn versions, cannot say which one yet).

It may be related to -Wl,-E: If I remove that from the CMakeLists.txt at the root of the tree then all plugins fail to load with the same error.

Now, I checked that the hunspell plugin is indeed compiled with -Wl,-E (unless I remove that flag, of course); but maybe something that the plugin links against dynamically is not, I have not checked all the dependencies. But this might give a clue (suspecting something in thirdparty but I dunno).

jghali

2020-11-13 11:18

administrator   ~0048399

For some reason, it seems the linker is removing the ScWordIterator class from scribus main binary while the class is clearly specified as exported. MSVC linker export ScWordIterator as expected. It seems the patch below is sufficient to workaround this issue. It adds an unused function to StoryText class which makes use of ScWordIterator class. Please test.
16327_libhunspellplugin_fails_to_load.diff (1,253 bytes)   
Index: Scribus/scribus/text/storytext.cpp
===================================================================
--- Scribus/scribus/text/storytext.cpp	(révision 24231)
+++ Scribus/scribus/text/storytext.cpp	(copie de travail)
@@ -32,6 +32,7 @@
 #include "scfonts.h"
 #include "scribusdoc.h"
 #include "sctext_shared.h"
+#include "scworditerator.h"
 #include "selection.h"
 #include "storytext.h"
 //
@@ -2029,6 +2030,11 @@
 		d->selLast += 1;
 }
 
+ScWordIterator* StoryText::createWordIterator()
+{
+	return new ScWordIterator(*this);
+}
+
 BreakIterator* StoryText::m_graphemeIterator = nullptr;
 
 BreakIterator* StoryText::getGraphemeIterator()
Index: Scribus/scribus/text/storytext.h
===================================================================
--- Scribus/scribus/text/storytext.h	(révision 24231)
+++ Scribus/scribus/text/storytext.h	(copie de travail)
@@ -46,6 +46,7 @@
 class PageItem;
 class ScribusDoc;
 class ScText_Shared;
+class ScWordIterator;
 class ResourceCollection;
 class ShapedTextCache;
 
@@ -266,6 +267,8 @@
 	static icu::BreakIterator* getWordIterator();
 	static icu::BreakIterator* getSentenceIterator();
 	static icu::BreakIterator* getLineIterator();
+	
+	ScWordIterator* createWordIterator();
 
 // layout helpers
 

jghali

2020-11-13 11:36

administrator   ~0048400

If there is a different solution which involves modifying linker flags, it take it!

erictapen

2020-11-13 12:43

reporter   ~0048402

Thanks @jghali, I can confirm that your patch solves the issue for me.

jghali

2020-11-13 22:12

administrator   ~0048405

Thanks for testing. I have consequently applied this patch to 1.5.7.svn.

mjg

2020-11-13 22:22

reporter   ~0048406

Same success for a test build on Fedora of 1.5.6 witth the patch from here. Thanks!

jghali

2020-11-14 18:05

administrator   ~0048415

We discovered another serious issue in spellchecker, so please do not package 1.5.6, we will release 1.5.6.1 pretty soon.

cbradney

2020-11-14 23:29

administrator   ~0048419

1.5.6.1 is done... uploaded to sourceforge

Issue History

Date Modified Username Field Change
2020-11-11 10:42 erictapen New Issue
2020-11-11 10:56 erictapen Note Added: 0048375
2020-11-11 11:05 ale Note Added: 0048376
2020-11-11 11:30 erictapen Note Added: 0048377
2020-11-12 19:31 ale Note Added: 0048385
2020-11-12 23:06 erictapen Note Added: 0048392
2020-11-13 10:38 mjg Note Added: 0048396
2020-11-13 11:18 jghali File Added: 16327_libhunspellplugin_fails_to_load.diff
2020-11-13 11:18 jghali Note Added: 0048399
2020-11-13 11:36 jghali Note Added: 0048400
2020-11-13 12:43 erictapen Note Added: 0048402
2020-11-13 22:12 jghali Assigned To => jghali
2020-11-13 22:12 jghali Status new => resolved
2020-11-13 22:12 jghali Resolution open => fixed
2020-11-13 22:12 jghali Fixed in Version => 1.5.7.svn
2020-11-13 22:12 jghali Note Added: 0048405
2020-11-13 22:22 mjg Note Added: 0048406
2020-11-14 18:05 jghali Note Added: 0048415
2020-11-14 23:29 cbradney Note Added: 0048419
2021-03-23 06:25 cbradney Status resolved => closed