uwiger / gproc

Extended process registry for Erlang
Apache License 2.0
1.07k stars 232 forks source link

aggregated counter can leak #166

Closed leoliu closed 4 years ago

leoliu commented 5 years ago

Just discovered a way to leak an aggregated counter.

step 1:

open two shells connect to the same node: shell1 and shell2 and execute the following in shell1 and shell2 in order:

gproc:reg({a,l,test}, undefined).

step 2:

In shell1 eval an expression that crashes: 1 / 0.

Now we have a dangling {a,l,test} in gproc.

> gproc:lookup_value({a,l,test}).
0
> gproc:unreg({a,l,test}).
** exception error: bad argument
     in function  gproc:unreg/1
        called as gproc:unreg({a,l,test})
leoliu commented 4 years ago

This is not a bug but my misunderstanding of the feature.