[Scribus] Bus error on Mac OSX, again (long)
Martin Costabel
costabel
Thu Jul 31 12:47:08 CEST 2003
Hi,
this is a belated update on the thread "Bus error starting scribus" from
3 weeks ago. Being the maintainer of Fink's scribus package, I was
unfortunately absent for 3 weeks, so I wasn't aware of this thread on
the Scribus list. The bus error is still there, although I found a
workaround, see point 1 below.
I have now narrowed this problem down to something where I am at my
wit's end, and I am hoping for some idea from the Scribus list. Here is
what I found:
1. The bus error at the startup of Scribus 1.0 on MacOSX happens when
the environment variable LANG is set. When LANG is unset, scribus starts
up normally. This gives a workaround: Unset LANG and start scribus with
the option --lang to get localized versions. Not really satisfactory, of
course.
2. The bus error comes from the QTextCodec::locale() method used in
scribus/main.cpp.
3. The problem is not a bug in qt alone. It only appears in the scribus
context. When the above method is used alone, it works as it should,
i.e. when LANG is set, it gives its value.
4. As a proof for 3, I replaced the scribus/main.cpp by the following
minimal one-line program:
/********************/
/* Minimal main.cpp to illustrate the bus error */
#include <qapplication.h>
#include <qfont.h>
#include <qstring.h>
#include <qtranslator.h>
#include <qfileinfo.h>
#include <qdir.h>
#include <qtextcodec.h>
#include "splash.h"
#include "scribus.h"
#include "config.h"
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout << "\n\n >" << QTextCodec::locale() << "<\n\n\n";
return 0;
}
/********************/
Now one observes the following strange behavior:
5. When this main.cpp is compiled in the scribus environment, i.e.
scribus with the new "main.cpp" is built using "make" with the standard
Makefile, the result is a "scribus" binary that exhibits the bus error
just as the true scribus program, i.e. bus error if and only if the LANG
environment variable is set.
6. When main.cpp is compiled alone, i.e the final linking command of
scribus is replaced by a variant of the exact same command, namely
/bin/sh ../libtool --mode=link --tag=CXX g++ -O2
-Ddlsym=dlsym_auto_underscore -I/sw/include -fno-exceptions
-fno-check-new -L/sw/lib -o scribus -L/usr/X11R6/lib -L/sw/lib
fontcombo.o scpreview.o
[long list of *.o files omitted]
scribus.o main.o -L/sw/lib -lfreetype -lcups -llcms -ldl -ltiff -lm
-lqt-mt -lpng -lz -lm -lXext -lX11 -lSM -lICE -lpthread -lXext -lX11
but with all other *.o files except main.o removed, then there is no bus
error. The "scribus" program then does what it is supposed to do, i.e.
it prints >C< if LANG is unset, and >en_GB< if LANG is set to en_GB, etc.
I cannot understand how linking with a bunch of object files that have
nothing to do with the main program can cause a crash of this main
program. I would be grateful for any idea about what kind of mechanism
could cause such a behavior.
Since this may, after all, be a problem with the Mac OSX compiler,
linker, or dynamic library system, or even a problem specific to Fink's
version of qt-3, I am crossposting this to the fink-devel mailing list.
Maybe someone with experience with Mac OSX and qt, kde (or even scribus,
rangerrick?) has an idea?
--
Martin
More information about the scribus
mailing list