【发布时间】:2015-03-02 10:35:36
【问题描述】:
我正在开发使用 libedataserver.so 的 Thunderbird 插件。
Addon 使用 js-ctypes 从上述库中调用 e_source_registry_new_sync。见以下代码:
var lib = ctypes.open("libedataserver-1.2.so.18");
var GCancellable = {};
GCancellable.cls = new ctypes.StructType("GCancellable");
var GError = {};
GError.cls = new ctypes.StructType("GError");
var ESourceRegistry = {};
ESourceRegistry.cls = new ctypes.StructType("ESourceRegistry");
ESourceRegistry.e_source_registry_new_sync =
lib.declare(
"e_source_registry_new_sync",
ctypes.default_abi,
ESourceRegistry.cls.ptr,
GCancellable.cls.ptr,
GError.cls.ptr.ptr);
//below line causes an error
var sourceRegistry = ESourceRegistry.e_source_registry_new_sync(null, null);
它在 Ubuntu 上运行良好,但在 Fedora 21 上它打印在输出下方并挂起:
(thunderbird:2735): GLib-GObject-WARNING **: cannot register existing type 'EDBusSource'
(thunderbird:2735): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed
(thunderbird:2735): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
(thunderbird:2735): GLib-GObject-WARNING **: invalid cast from 'EDBusSourceProxy' to '<invalid>'
我正在使用 Fedora 21 和进化数据服务器 3.12.11-1.fc21。
Ubuntu 使用 Evolution-data-server 3.12.10。
我开发了一个简单的 C 应用程序,它调用 e_source_registry_new_sync 并且运行良好。
有人可以提出这个问题的原因吗?
@更新: 我提出了Fedora bug。根据 Fedora 维护者的说法,问题是由两次加载 libedataserver 引起的(我的代码和 evolution-ews):
问题似乎是 Thunderbird 自己加载 libedataserver-1.2.so.18,而 libcamelews.so 对 libedataserver-1.2.so 有运行时依赖,但这不是(在运行时)thunderbird 满足的-loaded libedataserver-1.2.so.18,因此再次加载,破坏了GLib类型系统。
如果我可以从插件方面做些什么,请发表评论。
【问题讨论】:
-
嘿@Mateusz 这是个好问题。它没有引起太多关注,因为标签在 jsctypes 人中并不流行。粘贴 firefox-addon 标签,您将获得更快的响应 :) 您可以发布您的代码,以便我可以在 ubuntu 和 fedora 上进行测试
-
感谢 Fedora 团队分享您的评论。我想我们可以解决这个问题。你知道检查哪些库被加载到雷鸟中的方法吗?如果没有,我们可以找到,我们也会运行一个东西来找到你所有的 libedataserver-1.2.so 的路径,并从所有这些路径中尝试。可能是 Thunderbird 已经加载了该库,但路径不同,所以它被双重加载请尝试进入 #jsctypes 频道,我们可以将其淘汰
标签: firefox-addon gtk3 thunderbird-addon jsctypes