1. David Naval
  2. Valentina Database ADK
  3. Dienstag, September 21 2021, 07:13 AM
  4.  Abonnieren via E-Mail
Hi, I made a upgrade from Valentina ADK C++ from version 9 to version 11 to compile my application as Mac universal (x86_64 and arm64).

I just replaced the dylib's and update the serials in my application and I get a crash on call 'ValentinaInit'.

It's necessary any extra init?

Thanks in advanced.
Anhänge
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Hi Sergey,
Updated to Valentina ADK 11.4.6 and issues fixed!.
Thanks.
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Hi David,

Could you please try a new version (if you haven't done it yet)?
ValentinaInit doesn't need vcomponents at fixed paths, it uses already loaded libraries.


Hi Sergey, I will try. Thanks for your quick changes.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hi David,

Could you please try a new version (if you haven't done it yet)?
ValentinaInit doesn't need vcomponents at fixed paths, it uses already loaded libraries.
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Hi David,

I see that serial starts as VR4SDK - this is Reports.
But you sending it to Valentina Init - this is VDB


Hi Ruslan.
I tried to contact with Lynn Fredricks by mail without answer about the order: 210917 00160084 (I want to renew Valentina DB ADK and I bought Valentina Reports ADK).
Could you help me?
Thanks in advanced.
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Hi David,

Yes, in some sense it is fixed.
Currenlty, ValentinaInit tries to find libraries to perform some internal initialization in the following places:
1. Check APP/Contents/Frameworks/vcomponents_x64
2. Check APP/Contents/vcomponents_x64
3. Check APP/Contents/vresources and if it exists - try to find librabires from APP/Contents/
4. Check /usr/local/lib/vcomponents_x64

But APP in the case of Photoshop plugin is Photoshop.app itself, not a plugin. (The path is returned by CFBundleGetMainBundle)
In version 9.5 we added Check 1, APP was always used as a root for search.

We need to understand how it worked with the previous versions. Maybe you have some working build with version 9 so we can check it?


Hi Sergey,

I can't send a small sample of executable Photoshop plugin with ValentinaDB, but the idea is to use ValentinaDB in a plugin (at the end the plugin is a bundle).
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hello David,

A new version 11.4.6 with changes for this issue is available for download.
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Yes, installing to Photoshop/Contents is not an option.
Of course, we'll try to fix it ASAP.

Do you change rpath in some script or Xcode does it automatically?


Thanks in advanced.
Sure, I'm sending our script.
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Yes, installing to Photoshop/Contents is not an option.
Of course, we'll try to fix it ASAP.

Do you change rpath in some script or Xcode does it automatically?
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Hi Sergey

In our case, we can't install inside Photoshop/Contents and the only solution is install a copy in /usr/local/lib/vcomponents_x64.....
Could more logical use @loader_path or @rpath in ValentinaInit if any ones needs Valentina in a DYLIB as a suggestion.
This is a bad new for us.

Thanks for the support.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hi David,

Yes, in some sense it is fixed.
Currenlty, ValentinaInit tries to find libraries to perform some internal initialization in the following places:
1. Check APP/Contents/Frameworks/vcomponents_x64
2. Check APP/Contents/vcomponents_x64
3. Check APP/Contents/vresources and if it exists - try to find librabires from APP/Contents/
4. Check /usr/local/lib/vcomponents_x64

But APP in the case of Photoshop plugin is Photoshop.app itself, not a plugin. (The path is returned by CFBundleGetMainBundle)
In version 9.5 we added Check 1, APP was always used as a root for search.

We need to understand how it worked with the previous versions. Maybe you have some working build with version 9 so we can check it?
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Hi,
I made some test in Mac intel with VSDK 11.4.5.

If I make the sdk installation and compile our Photoshop plugin without changes in Valentina libraries (using the original installation path) I can execute ValentinaInit.

David ~ % otool -L /Users/davidnaval/Documents/Proyectes-Git/licensedBinaries/ValentinaADK/macOS/libvclient_fat_release_x64.dylib
/Users/davidnaval/Documents/Proyectes-Git/output/macOS/Debug/Debug/nT_Colorations.plugin/Contents/MacOS/libvclient_fat_release_x64.dylib:
/usr/local/lib/vcomponents_x64/libvclient_fat_release_x64.dylib (compatibility version 11.4.5, current version 11.4.5)
/usr/local/lib/vcomponents_x64/libvshared_fat_release_x64.dylib (compatibility version 11.4.5, current version 11.4.5)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)


If I use 'install_name_tool' to embed the libraries in plugin 'Contents' (changing '/usr/local/lib/vcomponents_x64' by @rpath (or @loader_path) ValentinaInit crashes

David ~ % otool -L /Users/davidnaval/Documents/Proyectes-Git/licensedBinaries/ValentinaADK/macOS/libvclient_fat_release_x64.dylib
/Users/davidnaval/Documents/Proyectes-Git/licensedBinaries/ValentinaADK/macOS/libvclient_fat_release_x64.dylib:
@rpath/libvclient_fat_release_x64.dylib (compatibility version 11.4.5, current version 11.4.5)
@rpath/libvshared_fat_release_x64.dylib (compatibility version 11.4.5, current version 11.4.5)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)


There is any internal dlopen with fixed path '/usr/local/lib/vcomponents_x64'?
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Also, in version 9, vcomponents where in "Some.plugin/Contents/vcomponents_x64", right?
After checking /usr/local/lib/vcomponents (as Ruslan suggested) - let's leave it here for version 11.

We can continue the conversation in the email:


version 9 : Some.plugin/Contents/MacOS
version 11 : Some.plugin/Contents/Frameworks

and

removed all versions in /usr/local/lib/vcomponents
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
And it is on Apple Silicon Mac, Photoshop is running natively without Rosetta, correct?


Intel Mac and Apple Silicon Mac (natively) same result
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Hi David,

let's try step by step


* so you work on MAC with Xcode and VSDK v9 -- all right here.

Yes

* you place to your computer VSDK v11
you say you have replaced DLLs - where exactly?

v9:
We change /usr/local/lib/vcomponents_x64 by @loader_path using install_name_tool
PLUGIN/Contents/MacOS/VALENTINA.dylibs
v11:
No changes because libraries have @rpath and our plugin resolve ../Frameworks
PLUGIN/Contents/Frameworks/VALENTINA.dylibs

* on your mac you have
/usr/local/lib/vcomponents ?
No
it contains v11 all files?
No
there is no any v9 files on computer?
No

Libraries are inside the Photoshop plugin and we can load and call the functions (as previous versions).

* you compile Xcode DEBUG app now?
Yes.
Does your scripts copy components inside of YourApp.debug.app ?
Yes
OR DEBUG app loads them from /usr/local/lib/vcomponents ?
No

* xcode on start of app shows in the console paths where from DLLs was loaded.

In Mac no, but if the library not found, the message appears in the console and the plugin can't start.
I'm calling:
printf ("VDK kernel version: %s\n", GetKernelVersionString());
and the console shows:
VDK kernel version: 11.4.5
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
And it is on Apple Silicon Mac, Photoshop is running natively without Rosetta, correct?
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Also, in version 9, vcomponents where in "Some.plugin/Contents/vcomponents_x64", right?
After checking /usr/local/lib/vcomponents (as Ruslan suggested) - let's leave it here for version 11.

We can continue the conversation in the email.
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
Hi David,

let's try step by step

* so you work on MAC with Xcode and VSDK v9 -- all right here.

* you place to your computer VSDK v11
you say you have replaced DLLs - where exactly?

* on your mac you have
/usr/local/lib/vcomponents ?
it contains v11 all files?
there is no any v9 files on computer?

* you compile Xcode DEBUG app now?
Does your scripts copy components inside of YourApp.debug.app ?
OR DEBUG app loads them from /usr/local/lib/vcomponents ?


* xcode on start of app shows in the console paths where from DLLs was loaded.
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Hi David,


Could you send me it?


1) So previously vcomponents_x64 was inside the Contents folder, right?
Let's try to make it how it was in v.9 - we saved both ways.

The place is different because the installation path now is @rpath than /usr/local/vcomponents of the v9.
We load the libraries because we can call other functions as GetKernelVersionString (if the libraries are not in the correct place, we can't run the plugin)

2) What if you pass nullptr to ValentinaInit? It should work in demo mode.


We bought licenses for Mac and Win but I made a mistake in the order, but its not relevant, the crash appears just running the plugin in Photoshop (less than 1 minute).

There is a conflict with this version and our Photoshop plugin in ValentinaInit.
We use some open source as wxWidgets, POCO, libvips..... (I don't know if this can help you)

In the crash log:
0 ??? 000000000000000000 0 + 0
1 libvshared_fat_release_x64.dylib 0x0000000234f23bb6 void std::__1::__call_once_proxy<std::__1::tuple<fbl::Converter_UTF8_Singleton* fbl::SingletonEternal<fbl::Converter_UTF8_Singleton>::GetSingletonPtrHelper<fbl::GetConverter_UTF8()::$_0&>(fbl::GetConverter_UTF8()::$_0&;)::'lambda'()&&> >(void*) + 41
2 libc++.1.dylib 0x00007fff203c0a8a std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*)) + 139
3 libvshared_fat_release_x64.dylib 0x0000000234f22fb2 fbl::GetConverter_UTF8() + 66
4 libvshared_fat_release_x64.dylib 0x0000000234ef2287 fbl::CreateDiskLocationFromFSRef(__CFURL const*) + 79
5 libvkernel_fat_release_x64.dylib 0x0000000235466faf fbl::FindVComponents() + 58
6 libvkernel_fat_release_x64.dylib 0x00000002354670a1 fbl::ValentinaInit_imp(unsigned int, char const*, char const*, char const*) + 49

it seems CreateDiskLocationFromFSRef return a invalid FSRef and GetConverter_UTF8 crashes.
Is trying this functions to open or create a file locally?
It's a localize problem?
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
Hi David,


Could you send me it?


1) So previously vcomponents_x64 was inside the Contents folder, right?
Let's try to make it how it was in v.9 - we saved both ways.

2) What if you pass nullptr to ValentinaInit? It should work in demo mode.
Kommentar
There are no comments made yet.
David Naval Akzeptierte Antwort
Checked a screenshot again, so it is a Photoshop plugin.
Where do you place vcomponents_x64?


I can execute ValentinaInit() in a desktop unit test app, but something produce a conflict in the execution in a Photoshop plugin.
We used Valentina ADK in our Photoshop plugin in previous versions (VDK version 3, 5, 8 and 9) from years.
Libraries are loaded correctly (I tried to call GetKernelVersionString() and IsKernelDLLAvailable() with no problem) but we get a crash on call ValentinaInit().
Any idea how to fix?
Kommentar
There are no comments made yet.
  • Seite :
  • 1
  • 2


There are no replies made for this post yet.
However, you are not allowed to reply to this post.