realbasic-plugins
[Top] [All Lists]

Re: dylibs, function loading and getting the wrong one called

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: dylibs, function loading and getting the wrong one called
From: Alfred Van Hoek <vanhoek at mac dot com>
Date: Sun, 10 Dec 2006 11:52:23 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <FF8466A2-36B7-4475-B1D8-3CAA6CDFEC1E at great-white-software dot com> <9098A1BD-4056-438C-938E-02FCCE3D16B5 at realsoftware dot com> <66EFC441-94D9-4A82-91DA-A3AB94F1A193 at great-white-software dot com> <5AE32349-26CB-474A-91A3-4BF496A55B41 at realsoftware dot com> <F12AC1FD-8A98-47B6-B85F-FD4FB81DEE33 at mac dot com>

On Dec 9, 2006, at 10:35 AM, Alfred Van Hoek wrote:


Well, here's the issue. It turns out this is the problem. We use NSAddImage and NSLookupSymbolInImage because dyld isn't available in anything prior to 10.3. NSAddImage has no notion of adding an image to a private namespace, even if two level namespaces are used. So, whichever library loads the symbol first will be used for the rest of the run.

We can use dyld on 10.3 and higher though, so if possible, please file a report against this. One workaround might be to package the dylib into a bundle and declare against the bundle. This should work.


Does this still holds? I mean it is an issue that I have. If REALbasic is adding an image to a private namespace, our code will fail to add it's own image, and when we call a symbol, it is the symbol owned by the rbframework that will crash our app. (Using the current RB version in 10.4.8).

Given your workaround suggestion, is there a shell command or such that can put the dylib in a bundle, or do we need to use Xcode for that?


Even if we wrap our dylib into a bundle, providing an Info.plist, it does not matter, declaring leads to the same problem: there is no private namespace. Another idea, short of filing a report against it?

Alfred
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>