Erlang Mailing Lists

Author Message

<  Erlang patches mailing list  ~  Reference count bugfix in erl_ddll

Guest
Posted: Wed Oct 11, 2006 1:30 pm Reply with quote
Guest
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

erl_ddll may contain a bug with reference count, here is an example:

1. Load a port driver on node `node1':
(node1@viking)1> self().
<0.37.0>
(node1@viking)2> erl_ddll:load_driver("/path/to/libs", my_drv).
ok

2. Start another shell on this same node and load the same driver:
(node1@viking)1> self().
<0.44.0>
(node1@viking)2> erl_ddll:load_driver("/path/to/libs", my_drv).
ok

The purpose here is to have separate processes using the same driver.
This can be verified by looking at the ddll_server status on `node1':
(node1@viking)3> sys:get_status(ddll_server).
{status,<0.46.0>,
{module,gen_server},
[[{'$ancestors',[<0.37.0>]},
{'$initial_call',{gen,init_it,
[gen_server,
<0.37.0>,
self,
{local,ddll_server},
erl_ddll,
[],
[]]}}],
running,
<0.46.0>,
[],
[ddll_server,
{#Port<0.101>,[{my_drv,[{<0.44.0>,1},{<0.37.0>,1}]}]},
erl_ddll,
infinity]]}
We can see shell's PID listed with `my_drv'.

3. Now another shell on this same node and load the driver a third time:
(node1@viking)1> self().
<0.55.0>
(node1@viking)2> erl_ddll:load_driver("/path/to/libs", my_drv).
ok

If we look again at ddll_server's status:
(node1@viking)4> sys:get_status(ddll_server).
{status,<0.46.0>,
{module,gen_server},
[[{'$ancestors',[<0.37.0>]},
{'$initial_call',{gen,init_it,
[gen_server,
<0.37.0>,
self,
{local,ddll_server},
erl_ddll,
[],
[]]}}],
running,
<0.46.0>,
[],
[ddll_server,
{#Port<0.101>,[{expat_drv,[{<0.55.0>,1},{<0.37.0>,1}]}]},
erl_ddll,
infinity]]}
The second shell (<0.44.0>) isn't listed anymore.

The consequence is that if the first and the last unload the driver, the
library `my_drv.so' will be unloaded and shell #2 port driver will
become unusable.

Attached is a patch that should fix this.

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

iD8DBQFFLPC1a+xGJsFYOlMRAqhtAKDHqFf4FL2bRrWtrlqYqa8waXFFLgCfe8g6
1NKNvNQJzZIzFN+HUGw9q7s=
=5JqK
-----END PGP SIGNATURE-----
_______________________________________________
erlang-patches mailing list
erlang-patches@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-patches

Post recived from mailinglist
Guest
Posted: Wed Oct 11, 2006 1:32 pm Reply with quote
Guest
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Attached is a patch that should fix this.

Sorry, forgot to attach the patch to the first mail.

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

iD8DBQFFLPJNa+xGJsFYOlMRAlkHAJ9TvuA14n2JVNQKy56SBqOuhL4jHwCgyLSV
o8w6w/dowYmWchqaqqGFAy8=
=sioZ
-----END PGP SIGNATURE-----


Post recived from mailinglist
Deadlystrawberry
Posted: Thu Apr 12, 2007 8:39 am Reply with quote
Guest
Mel Gibson Spanking!
http://Mel-Gibson-spanking.info/WindowsMediaPlayer.php?movie=231891

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum