Generated SimpleFilter plugin crashed

Typically: "How do I... ", "How can I... " questions
ferdianap
Posts: 11
Joined: 08 Nov 2013, 06:24

Generated SimpleFilter plugin crashed

Post by ferdianap »

Hello,

I am trying to develop my own image processing plugin, and I have looked at the v_repExtSimpleFilter Qt project.
When I tried to compile it as it is in Qt Creator, using Qt 4.7.4 for GCC (Release) (since I am using VREP V3.0.4 on MacOS 10.6.8), it showed 9 warnings and eventually generated a folder with some files including 2 aliases (libv_repExtSimpleFilter.1.dylib and libv_repExtSimpleFilter.1.0.dylib) and one dylib file (libv_repExtSimpleFilter.1.0.0.dylib).
Since I suppose that libv_repExtSimpleFilter.1.0.0.dylib is the same with libv_repExtSimpleFilter.dylib (the one in the vrep/Contents/MacOS Folder), when I replaced it with the newly generated libv_repExtSimpleFilter.1.0.0.dylib, and restarted vrep, it crashed.

Could somebody explain what is wrong during the compilation process?

--
Regards,

Ferdian

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Generated SimpleFilter plugin crashed

Post by coppelia »

Hello Ferdian,

actually what happens is following:

on Mac and using Qt, the application is bundled, and Qt will automatically do some magic on the libraries contained in the bundle. The magic happens with the macdeployqt command, so I am afraid you cannot simply add your library like that.
On the other hand we have never tried to add a library after a call to macdeployqt. Maybe you can try to duplicate your V-REP folder, copy the new library as you did into the copy, call macdeployqt on that, and copy the library back to the original folder? I would be surprised if that worked, but you can give it a shot. Otherwise the provided link may give an answer to your question.

Cheers

ferdianap
Posts: 11
Joined: 08 Nov 2013, 06:24

Re: Generated SimpleFilter plugin crashed

Post by ferdianap »

Hmm..but calling macdeployqt requires the build directory of the v-rep to be exist in the same directory of the plugins, right? Then isn't that means I should compile and deploy the whole v-rep bundle app from the source code using QtCreator, just to get one new single plugin to work?

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Generated SimpleFilter plugin crashed

Post by coppelia »

Hello Ferdian,

I just tested (for V-REP 3.0.5 though) and copying the macdeployqt-unprocessed library and overwriting the existing library in the bundle works fine here. So I am not sure... Maybe first try to make the library as simple as possible, possibly some other code in it is causing the crash. Because my first thought would be that otherwise, V-REP would simply not be able to load the plugin.
V-REP plugins are loaded and bound dynamically, which means that V-REP doesn't know at compile time what it will load.

Cheers

ferdianap
Posts: 11
Joined: 08 Nov 2013, 06:24

Re: Generated SimpleFilter plugin crashed

Post by ferdianap »

I haven't modified the library yet, I just opened the project file and compiled as it is.
So that means I can deploy only the plugins, right?
Could you give me a step-by-step procedure how to get that macdeployqt-unprocessed library?
Because as I described from the first post, I got multiple .dyld files, so I thought something must be wrong during the process.

Thanks!

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Generated SimpleFilter plugin crashed

Post by coppelia »

you already have the macdeployqt-unprocessed file, i.e. the raw file: that's what you compiled.
Actually I don't know exectly what (or if) macdeployqt will do inside that plugin library. Simply removing all aliases, and renaming the library to v_repExtSimpleFilter.dylib should do the trick. Make sure to have exactly the same Qt version as the one that was used to compile V-REP, otherwise you will have crashes or the load will fail.

Cheers

ferdianap
Posts: 11
Joined: 08 Nov 2013, 06:24

Re: Generated SimpleFilter plugin crashed

Post by ferdianap »

I just tested in V-REP V3.0.5c with the same Qt version and it worked fine as you mentioned. The failure of V3.0.4 might be because of older Qt version, since I tried your method exactly on V3.0.4 and V-REP still crashed, not sure what's going on.
I should've upgrade the V-REP earlier, since I'm afraid the V3.0.5c still buggy on mac. My bad.
Anyway, thanks a lot!

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Generated SimpleFilter plugin crashed

Post by coppelia »

No worries. It is true that Qt5.1.1 on MAc is causing a lot of headache, we hope to be able to switch to Qt 5.2 for next release and that all problems will simply wanish ;)

Cheers

ferdianap
Posts: 11
Joined: 08 Nov 2013, 06:24

Re: Generated SimpleFilter plugin crashed

Post by ferdianap »

Just a quick update, I'm using the qt-mac-opensource-5.1.1-clang-offline with GCC compiler set, and V-REP was able to load the plugin. The filter 1(Noise) worked fine, filter 2 also displayed well, but I realized when I double-click to modify the parameter of it, V-REP crashed, and I got this message in my terminal:
QWidget: Must construct a QApplication before a QPaintDevice
Abort trap: 6

am I using the wrong Qt version? because it seems the only one available in the official download page for Version 5.1.1

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Generated SimpleFilter plugin crashed

Post by coppelia »

you are right, same happens here.

Calling macdeployqt on vrep.app will generate errors (because it was already called for all the libs inside except for the newly added one), but finally it will touch the newly added lib, and after that, it works fine here.

Cheers

Post Reply