codenode

DB<3> x $code

Devel::Size::total_size() fix/patch coderef segfault

Posted on April 21st, 2010 by Daniel Nichter

Devel::Size v0.71 and older causes Perl to segfault if you total_size() any non-trivial coderef. This was known as bug 29238 and bug 26781. I fixed/patched this. The patch (for 0.71; probably works on other version, if not, just make the two simple changes manually) is simply:


48c48
<     if ((o->op_type = OP_TRANS)) {
---
>     if ((o->op_type == OP_TRANS)) {
309a310
>     break;

Program in the morning

Posted on April 9th, 2010 by Daniel Nichter

I’m a morning person. 8am is late to me. I’m also a late-evening person. I sometimes work from 8am to 10pm (with breaks for eating). I’ve learned time and time again that programming late-day, or whenever you’re tired, is truly a waste. I spent 7 hours late yesterday trying to perfect ReportFormatter–a rolled-my-own Perl module for generating columnized reports of insanely variable-width data. I was close, but whenever I’d fix X, Y would break, and vice-versa. I forced myself to quit, go home, eat, drink, sleep and in 3 hours this morning I redesigned the module and it works. The design and code is also nicer, unlike the hackish code I was desperately trying to munge into working order yesterday. All that wasted effort for,

Variable                  ...figs/mysqldhelp001.txt ...figs/mysqldhelp002.txt
========================= ========================= =========================
character_sets_dir        /home/daniel/mysql_bin... /usr/share/mysql/chars...
pid_file                  /tmp/12345/data/mysql_... /mnt/data/mysql/sl1.pid
ssl_key                                             /opt/mysql.pdns/.cert/...
report_host               127.0.0.1
log_bin                   mysql-bin                 sl1-bin
innodb_file_per_table     FALSE                     TRUE
datadir                   /tmp/12345/data/          /mnt/data/mysql/

That looks simple, but so do many things which are complex under the hood. It’s amazing how simple it is to do in ones mind. Perhaps that’s why coding such a thing is difficult when one’s mind is fatigued, when the idea-code translations come out as logical as dreams.

Copyright © 2009 codenode. Theme by THAT Agency powered by WordPress.