[erlang-questions] erl_ddll bugfixes

Jean-Sébastien Pédron <>
Wed Oct 18 17:33:41 CEST 2006

Hash: SHA1


Note: I posted a mail a week ago on erlang-patches@ about a bug in
erl_ddll but didn't get any feedback so I try again here.

erl_ddll contains a bug with reference count. You'll find an example of
it in my first mail:

To sum up quickly the problem, ddll_server will only keep a reference
for the first and the last processes who loaded a library. Every
in-between process references will be dropped with each call to

The consequence is that if the first and the last processes unload the
driver, the library will be effectively unloaded and every still running
port drivers will become unusable.

Since then, I found another bug regarding the link established between
ddll_server and the process who called erl_ddll:load_driver/2. This link
exists only between ddll_server and the first process. Following
processes who load the same library won't have a link and if they exit
without calling erl_ddll:unload_driver/1, their reference in ddll_server
will remain there until ddll_server terminates.

These two bugs exist at least from R10B-7 up to R11B-1.

- --
Jean-Sébastien Pédron
Meetic Corp.
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: otp_src_R11B-1-erl_ddll-reference_count.patch
Type: text/x-patch
Size: 604 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20061018/7719927c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: otp_src_R11B-1-erl_ddll-process-link.patch
Type: text/x-patch
Size: 461 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20061018/7719927c/attachment-0001.bin>

More information about the erlang-questions mailing list