Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "Scalars leaked: 1" mean?

Tags:

perl

I just got the warning "Scalars leaked: 1" nine times.

I'm guessing it came from a threaded upload program that uses 9 threads with modules threads, threads::shared and Thread::Queue. This is on WinXP, Active State 5.8.8.

Any idea what this means? This program has been running a while with no such warnings, and I reran the program with the same (light) work that caused the warnings, but no warnings this time.

I'm not trying to start the threads at compile time, unless this is something that Thread::Queue does internally. My first threaded call is after Getopt::Long processing.

like image 280
Bill Ruppert Avatar asked Jan 05 '12 14:01

Bill Ruppert


1 Answers

From this website:

Scalars leaked: 1 Yikes! What is that! "Scalars leaked: 1". Well, yes, that's one of the remaining problems/features/bugs of the Perl ithreads implementation. This particularly seems to happen when you start threads at compile time. From practical experience, I must say it seems to be pretty harmless. And compared to all of the other "leaking" of memory that happen because data-structures are copied, a single leaked scalar is presumably not a lot. And the error message is probably in error in this case anyway."

like image 164
Gabriel Avatar answered Sep 17 '22 16:09

Gabriel