Skip Menu |

This queue is for tickets about the Crypt-U2F-Server CPAN distribution.

Report information
The Basics
Id: 129435
Status: resolved
Priority: 0/
Queue: Crypt-U2F-Server

People
Owner: Nobody in particular
Requestors: NEWELLC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.44
Fixed in: (no value)



Subject: Using multiple instances of the Crypt::U2F::Server::Simple object results in lots of "refCount error! Aborting everything!" errors
I'm creating a new instance of the object per request I get on my server. After the first object when they are destroyed I'm seeing the warning 'refCount error! Aborting everything!'. It looks like the intention is to keep track of how many objects are in scope, and when they have all gone run the teardown. You're not incrementing the refcount on subsequent object creations so it ends up with the refcount going negative triggering that warning and allowing things to be in a weird state where the initialisation hasn't run (and never will again) and objects try to do stuff. It looks like simply moving the refcount increment should fix the issue.
Subject: refcount.patch
diff -Naur Crypt-U2F-Server-0.44/lib/Crypt/U2F/Server/Simple.pm Crypt-U2F-Server-0.45/lib/Crypt/U2F/Server/Simple.pm --- Crypt-U2F-Server-0.44/lib/Crypt/U2F/Server/Simple.pm 2019-04-28 14:37:27.000000000 +0100 +++ Crypt-U2F-Server-0.45/lib/Crypt/U2F/Server/Simple.pm 2019-05-04 13:53:56.371420332 +0100 @@ -44,8 +44,8 @@ $errstr = Crypt::U2F::Server::u2fclib_getError(); return; } - $refCount++; } + $refCount++; my $ctx = Crypt::U2F::Server::u2fclib_get_context(); if ( !defined($ctx) || !$ctx ) {
I should perhaps clarify that that is more than one instance at the same time. Using one, destroying it, then creating another is probably fine.
Fixed in 0.45. Thanks !
Le Sam 04 Mai 2019 08:58:26, NEWELLC a écrit : Show quoted text
> I should perhaps clarify that that is more than one instance at the > same time. Using one, destroying it, then creating another is > probably fine.
You're right!