Skip Menu |

This queue is for tickets about the GnuPG CPAN distribution.

Report information
The Basics
Id: 118079
Status: open
Priority: 0/
Queue: GnuPG

People
Owner: yanick+cpan [...] babyl.dyndns.org
Requestors: KNAYAN [...] cpan.org
Cc: frajulac [...] contre.com
MFROST [...] cpan.org
yanick [...] cpan.org
AdminCc:

Bug Information
Severity: Important
Broken in: 0.19
Fixed in: (no value)



CC: MFROST [...] cpan.org, frajulac [...] contre.com, yanick [...] cpan.org
Subject: `import_keys` forks too many processes and changes loop behaviour
Hey All, I noticed that this module dies in case of any error, so stopping our main program. Rather, it should send the error message to the caller and let caller decide what to do. However, I handled the errors using `eval`. While handling the `import_keys`, I found a nasty bug in it (when filename is passed instead of arrayref). Below is my simplified program. use GnuPG qw( :algo ); my $gpg = new GnuPG; for (1..3) { print "Loop count: $_\n"; eval { $gpg->import_keys( keys => '/home/kamal-pub.ascaaa' ); }; # This is invalid path so as to generate error if ($@) { print "Error found: $@\n"; } else { print "Success.\n"; } } ====================================== Output: Right now I am printing only loop count to focus on real bug. Please notice, it has executed loop multiple times for the same values, instead of running just 5 times. Loop count: 1 Loop count: 2 Loop count: 3 Loop count: 4 Loop count: 5 Loop count: 2 Loop count: 3 Loop count: 4 Loop count: 5 Loop count: 5 Loop count: 4 Loop count: 5 Loop count: 5 Loop count: 3 Loop count: 4 Loop count: 5 Loop count: 5 Loop count: 4 Loop count: 5 Loop count: 5 ====================================== I tried to debug it but the debugger stops on this eval line saying " ######### Forked, but do not know how to create a new TTY. ######### Since two debuggers fight for the same TTY, input is severely entangled. I know how to switch the output to a different window in xterms and OS/2 consoles only. For a manual switch, put the name of the created TTY in $DB::fork_TTY, or define a function DB::get_fork_TTY() returning this. On UNIX-like systems one can get the name of a TTY for the given window by typing tty, and disconnect the shell from TTY by sleep 1000000." ====================================== As far as I could understand, module is forking too many threads of the same program, which leads to quite different behaviour of the loops. However, when I used arrayref as parameter to import_keys, everything seemed fine.
I have updated loop to run five times and missed to update in ticket. Please update loop to for (1..5) { } Thanks, Kamal Nayan