stevieb9 / ipc-shareable

Share Perl variables across processes and scripts
GNU General Public License v2.0
3 stars 2 forks source link

Accidentally using a hash ref will burn all shm slots (clarify 'tidy' in docs) #30

Open stevieb9 opened 10 months ago

stevieb9 commented 10 months ago

In nhl::api, used a scalar instead of hash without cleanup, and it exhausted all slots.

Repro- use a hash ref instead of a hash with many changes

stevieb9 commented 10 months ago

Actually, this isn't completely accurate. There are a few things at play here. Each time a reference underneath of the top-level tied object has a new slot added, it actually creates a new reference inside of a new SHM slot. We need to clarify this in documentation in the CAVEATS section, as well as greatly enhance and clarify the tidy documentation.

See the tidy/untidy test files for examples. Also, add new tests along the following lines:

# Multiple script runs

$href->{a} = {x => $var};

That should continuously add new segments each time the script runs. tidy should prevent that from happening, so we need to test it.