Smoking CPAN in one line
I'm using CPAN::SQLite. I don't like it and I'm trying to improve the locking issues with concurrent process all trying to read from cpandb.sql by writing a new CPAN::UnQLite. But this is something else.
Today I want to smoke whole CPAN in one line to check the new experimental return-or check by Niels Thykier for "Possible precedence issue with control flow", for which we filed several bug reports in the last two days. See https://paste.debian.net/16932/ and perl #59802. To repro add this patch from Niels to latest blead, if it's not already included.
$ cd ~/.cpan
$ alias p='perl5.19.2d-nt@1292fdb2'; alias ppan='AUTOMATED_TESTING=1 PERL_MM_USE_DEFAULT=1 PERL_EXTUTILS_AUTOINSTALL=--defaultdeps p -S cpan'
$ cat allmods.sh
#!/bin/sh
sqlite3 cpandb.sql 'select mod_name from mods group by dist_id order by mod_name;'
$ for m in `./allmods.sh`; do echo $m; ppan -t $m 2>&1 | tee -a log.cpan | grep "Possible precedence issue with control"; done
And in a 2nd term watch it flow, and react on keyboard input.
$ tail -f log.cpan
Note this is just a oneliner, not a real smoker, which needs to setup some environment variables and disable STDIN. For smokers see http://wiki.cpantesters.org/wiki/QuickStart
Addendum, keep some dependencies
cpan -t does only testing, but not installing. Major dependencies get built and tested all over again, if they are not installed. This costs some unnecessary minutes. So I added this in a seperate term to keep the most prominent deps.
$ alias jpan='ppan -j ~/.cpan/CPAN/nosqlite.pm'
$ jpan `grep -a "Warning: prerequisite" log.cpan|cut -d' ' -f3|sort |uniq -c|sort -rn|perl -alne'print $F[1] if $F[0] > 5'`'
I need to use a version without use_sqlite to avoid the CPAN::SQLite locking bug. Yes, I've tried to fix it, but some writing codepath still holds a reference to a stmt handle which prevents the readers to be shared.
cd ~/.cpan/CPAN/
sed -e"s,'use_sqlite' => q[1],'use_sqlite' => q[0]," <MyConfig.pm >nosqlite.pm
Found bugs
I filed RT tickets for all found instances and keep the patches in my distroprefs which you can easily git clone
into ~/.cpan
.
- DBI [cpan #87029] (fixed)
- Git-CPAN-Patch [cpan #86950] (fixed)
- Parse-CPAN-Meta (fixed)
- Lingua-PT-Abbre cpan #87199 (fixed)
- Rose-HTML-Objects cpan #87253 (fixed)
- App-Addex cpan #87207 (fixed)
- DOCSIS-ConfigFile cpan #87301 (fixed)
- WebService-Dropbox cpan #87212 (fixed)
- Hash-Type cpan #87309 (fixed)
- XML-XSS cpan #87196 (fixed)
- Class-Usul cpan #87258 (fixed)
- File-DataClass cpan #87255 (fixed)
- Perl-Critic-Pulp cpan #87307 (fixed)
- fat comma quoting fixed with 5.19.2
WebService-Google-Reader cpan #87211 (fixed)
DBIx-Class-Helpers cpan #87311 (fix in git)
- Perl-Critic cpan #87032 (fixed soon)
IO-Async cpan #87051 (in work)
YAML-Syck cpan #87034
- Apache-SWIT cpan #86949
- JSON-PP cpan #86948
- HTML-Mason cpan #87050
- IO-Socket-SSL cpan #87052
- ACME-QuoteDB cpan #87203
- Alien-wxWidgets cpan #87202
- Any-Template cpan #87201
- App-DoubleUp cpan #87208
- App-GitGot cpan #87210
- Auth-GoogleAuthenticator cpan #87228
- Basset cpan #87233
- BatchSystem-SBS cpan #87231
- Catalyst-Plugin-Authorization-Abilities cpan #87229
- Class-Meta-Declare cpan #87256
- Database-Migrator cpan #87205
- DBR cpan #87223
- File-Copy-Link cpan #87216
- GBrowse cpan #87252
- IO-All cpan #87200
- IO-Async cpan #87051
- IO-Socket-SSL-1.51 cpan #87052
- Lingua-PT-Abbre cpan #87199
- Mail-Sender cpan #87198
- Module-Locate cpan #87204
- Perlbal cpan #87050
- Qudo cpan #87216
- Rose-HTML-Objects cpan #87253
- Spark-Form cpan #87232
- Tangram cpan #87223
- TheSchwartz cpan #87222
- Tie-Util cpan #87230
- Video-Manip cpan #87212
- WebService-Hatena-Bookmark-Lite cpan #87209
- WebService-Rackspace-CloudFiles cpan #87213
- XML-Simple-DTDReader cpan #87197
- CatalystX-Usul cpan #87257
- Class-Scaffold cpan #87259
- Net-Async-IRC cpan #87260
- Curses-UI cpan #87273
- DBICx-Modeler cpan #87274
- Dist-Zilla-Plugins-CJM cpan #87277
- DBIx-Browse cpan #87275
- IPsonar cpan #87298
- Data-RuledValidator cpan #87299
- Elastic-Model cpan #87300
- Ekahau cpan #87303
- Dist-Zilla-Role-ModuleIncluder cpan #87305
- Database-Migrator cpan #87205
- DJabberd cpan #87306
- Dotiac cpan #87304
- DBD-Fulcrum cpan #87308
- JavaScript-MochiKit cpan #87310
- DBIx-Cursor cpan #87312
- DBIx-DR cpan #87313
- JSON-Pointer cpan #87314 +hashorder
- File-PathInfo-Ext cpan #87316
- Dancer-Plugin-ElasticSearch cpan #87353
Setup
Done on my desktop machine with 2.8Ghz, 4 cores, 16GB RAM and 15GB free space on my SSD drive. I used 3 cores in parallel, dividing the workload (~26835) by 3. The 4th core for my daytime work. The perl was with DEBUGGING, -g3 and no threads. An optimized perl would have been much faster to run, but would have not detected assertions and would disallow gdb stepping into harder bugs. The only hard bug I found was Data-Alias invalid realloc, so an optimized perl would have been better. At all I needed a week, but it should be doable in 2-3 days with an improved setup. I constantly ran out of disc space after night runs, and rebuilt some popular distros more than 10x. Installing them permanently and checking for discspace would save a lot of time. My distroprefs contains 128 yamls with patches, andy's CPAN prefs contain 449 yamls.
Restarts done like this:
$ wc -l allmods
26835 allmods
$ echo $((26835 / 3))
$ grep -n LastModule mods.1 => 4000
$ for m in `tail -n$((8945-4000)) mods.1`; do echo $m; jpan -t $m 2>&1 | tee -a log.cpan1 | grep "Possible precedence issue with control"; done
See Steffen's Steffen's CPAN explanation and tsee/cpanperlbranch_smoke for smoker setup. He had 25GB and 7 parallel processes on 4 cores.
SQLite shouldn't be using exclusive locking for multiple concurrent reads, only writes, surely? Wouldn't excessive locks in SQLite mean time to a database system with a server, not another serverless solution?