Skip Menu |
 

This queue is for tickets about the threads-lite CPAN distribution.

Report information
The Basics
Id: 55921
Status: resolved
Priority: 0/
Queue: threads-lite

People
Owner: LEONT [...] cpan.org
Requestors: APOCAL [...] cpan.org
Cc:
AdminCc:

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



Subject: Some warnings/panic happened during Build test?
Download (untitled) / with headers
text/plain 4.5k
Hello, I just saw your blog post describing threads::lite and boy, it fired up my imagination! I always loved Erlang but never dug in deep because it was never Perl(TM) heh... Anyway, trying to run the testsuite resulted in those warnings/errors. However, it passes! :) I then tried to make a small program to play around with and I struggled to get it to work. Turns out passing undef as $options results in a segfault! Also, trying to use self() doesn't work - maybe I am using it wrong? I'm looking forward to playing with this module and seeing it grow over time, so please let me know how I can help you! This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi apoc@blackhole:~/threads-lite-0.021$ ./Build test cc -Isrc -I/usr/lib/perl/5.10/CORE -fPIC -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -o src/mthread.o src/mthread.c cc -Isrc -I/usr/lib/perl/5.10/CORE -fPIC -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -o src/queue.o src/queue.c src/queue.c: In function ‘S_message_push_stack’: src/queue.c:94: warning: format not a string literal and no format arguments src/queue.c: In function ‘message_destroy’: src/queue.c:130: warning: format not a string literal and no format arguments src/queue.c: In function ‘queue_enqueue’: src/queue.c:189: warning: format not a string literal and no format arguments src/queue.c:191: warning: format not a string literal and no format arguments src/queue.c: In function ‘queue_dequeue’: src/queue.c:215: warning: format not a string literal and no format arguments src/queue.c:216: warning: format not a string literal and no format arguments src/queue.c: In function ‘queue_dequeue_nb’: src/queue.c:230: warning: format not a string literal and no format arguments src/queue.c:231: warning: format not a string literal and no format arguments cc -Isrc -I/usr/lib/perl/5.10/CORE -fPIC -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -o src/sync.o src/sync.c src/sync.c: In function ‘readwrite_new’: src/sync.c:10: warning: format not a string literal and no format arguments src/sync.c: In function ‘semaphore_new’: src/sync.c:19: warning: format not a string literal and no format arguments cc -Isrc -I/usr/lib/perl/5.10/CORE -fPIC -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -o src/resources.o src/resources.c src/resources.c: In function ‘mthread_alloc’: src/resources.c:80: warning: format not a string literal and no format arguments src/resources.c: In function ‘queue_alloc’: src/resources.c:105: warning: format not a string literal and no format arguments src/resources.c: In function ‘thread_add_listener’: src/resources.c:176: warning: format not a string literal and no format arguments cc -Isrc -I/usr/lib/perl/5.10/CORE -DXS_VERSION="0.021" -DVERSION="0.021" -fPIC -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -o lib/threads/lite.o lib/threads/lite.c ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/threads/lite/lite.bs') cc -shared -O2 -g -L/usr/local/lib -o blib/arch/auto/threads/lite/lite.so lib/threads/lite.o src/mthread.o src/queue.o src/sync.o src/resources.o t/00-load.t ....... 1/1 # Testing threads::lite 0.021, Perl 5.010000, /usr/bin/perl t/00-load.t ....... ok t/10-basics.t ..... ok t/20-lists.t ...... 1/? Scalars leaked: -1 panic: MUTEX_LOCK (22) [op.c:453]. t/20-lists.t ...... ok t/pod-coverage.t .. ok t/pod.t ........... ok All tests successful. Files=5, Tests=10, 1 wallclock secs ( 0.07 usr 0.01 sys + 0.51 cusr 0.07 csys = 0.66 CPU) Result: PASS apoc@blackhole:~/threads-lite-0.021$ cat testthreads.pl #!/usr/bin/perl use strict; use warnings; use threads::lite; my $thread = threads::lite->spawn( {}, sub { while ( 1 ) { sleep 5; print "Hello from thread: ", self(), "\n"; } return; } ); while ( 1 ) { sleep 10; print "Hello from main loop\n"; } apoc@blackhole:~$ perl testthreads.pl Thread 1 got error Can't locate auto/Storable/self.al in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 10) line 6 Hello from main loop ^C -- ~Apocalypse
Download (untitled) / with headers
text/plain 959b
Hi Apocalypse, It seems you're describing a couple of different issues. I'll try to get over them. 1. The format warnings are a small bug in perl's headers. Annoying but nothing to be worried about. If it isn't fixed already I should probably file a bug in perl's RT. 2. The panic after running t/20-lists.t is more serious. Locking issues are non-deterministic, so if you run the tests a number of times it may only show up part of the time. I'm unhappy to see that one though, as I thought I squashed it. I hope/think I have squashed it for real now. 3. spawn should handle an undefined value properly. It's fixed in the next release. 4. The error in your script is that the self function isn't defined after deserialization. The easiest solution is to use the whole name of the function (threads::lite::self). I agree this behavior and the error is confusing though, so I'm planning to look into changing it, but that may prove tricky. Regards, Leon
Download (untitled) / with headers
text/plain 159b
I finally fixed 'Scalars leaked' warning in 0.028. It involved some reworking of the memory management. I'm closing this ticket now. Regards, Leon Timmermans


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.