Hi Robert,


> >> > after the ZynAddSubFX issue is fixed,

> >> > I still am try to get muse2 up and running.

> >> > I am running into another problem, now.

> >> > However, I get the next runtime error at muse/widgets/mtrackinfo.cpp

> >> > It looks like the config.fonts array contains no valid fonts!

>

> Indeed we get the same issue. Puzzling


I found the reason for the problems at


muse/widgets/mtrackinfo.cpp: line 72: setFont(museConfig.fonts[2]);

in the muse file gconfig.h and gconfig.cpp

there is declared the classs

extern GlobalConfigValues config;

this (muse) class name "config" collides with the (ZynAddSubFX) class name "config".

zynaddsubfx file Config.cpp

in the moment where the shared object

/usr/lib/dssi/zynaddsubfx.so

is loaded, the Muse class name "config" is overruled with

ZynAddSubFx-2.4.1/src/Misc/Config.h

in the moment zynaddsubfx.so 's Config.cpp is loaded by the shared object with this code:

static void loadPluginLib(QFileInfo* fi) // for /usr/lib/dssi/zynaddsubfx.so

{

void* handle = dlopen(fi->filePath().toAscii().constData(), RTLD_NOW); // Muse's config is overwritten at this point

Q_OBJECT

\\...

}

This problem appears only at the zynadddsubfx.so shared object!!!

// but it might happen with any other shared object

The solution is one of:

1.) either remove shared object /usr/lib/dssi/zynaddsubfx.so

Then there is no class name collision with same name "config" appearing!!!

This way is bad, as we want to use zynaddsubfx as synthi's

or

2.) rename the class config inside muse to something less obvious.

I used refactoring to rename all config names to museConfig.

This solved the problem.

BEST SOLUTION

As problems like this might happen with any shared objects and any muse's global vars!

PERHAPS we should use a general Namespace "Muse::"

for all global variables inside Muse.

In my Eyes, this should be the way to solve this problem!

Bye,

Willy

Am Montag 30 Mai 2011, 15:40:13 schrieb Robert Jonsson:

> Hi Willy,

>

> 2011/5/30 WillyFoobar <WillyFoobar@gmx.de>:

> > Hi Robert,

> >

> > Hello to all,

> >

> > I AGREE to your REPLY:

> >

> >> I tried this too now and I fear ZynAdd (or MusE) still causes some

> >

> >> memory corruption.

> >

> > THIS WAS MY EARLIER statement:

> >> > after the ZynAddSubFX issue is done,

> >> > I still am try to get muse2 up and running.

> >> > I am running into another problem, now.

> >> > However, I get the next runtime error at muse/widgets/mtrackinfo.cpp

> >> > It looks like the config.fonts array contains no valid fonts!

>

> Indeed we get the same issue. Puzzling

>

> > when I read your stack memory dump,

> > .. the problem is not any more inside the shared library:

> > /usr/lib/dssi/zynaddsubfx .so

> > The problem before with thy zynaddsubfx.so

> > happened to be much earlier at the file plugin.cpp

> > This was the calling stack:

> >

> >> #2 0x017d15a7 in QWidget::setFont(QFont const&) () from

> >> /usr/lib/libQtGui.so.4

> >> #3 0x009323aa in MidiTrackInfo::MidiTrackInfo(QWidget*, Track*) ()

> > The constructor of the

> > config.fonts[2]

> > seems to NEVER have been filled with valid data!

> > // see the listing below:

> >

> >> > MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) :

> >> > QWidget(parent)

>

> I didn't look at the code, normally this does work, right?

> It looks to me this could be memory corruption, zynaddsubfx.so takes a

> piece of our memory without allocating it... in which case all bets

> are off...

>