Fri, 19 Jan 2007

STURM AND ... oh.

It's been quite a week, with my boss out of the country. But at the end of it, it's important to focus on the things which really matter. Like my lovely wife. And the board game she bought for me today.

It's called Thurn and Taxis and it looks like a lovely little German board game. It's about strategically delivering the mail. No, I don't know what that means, either. But I'm looking forward to playing it sometime when I've got a couple people with an hour to spend on it.

posted at 22:39 PST (-0800)     (comments disabled)   permanent link  
AUTOFOIL

It's possible I just accidentally gave myself a reason to do something I have put off for a decade.

That is, start using Python.

I know, I know. Python is the first choice of many people. It's great for rapid development; just like Perl. It's good with objects; just like Perl. It's got stellar extensibility; just like Perl. It's ubiquitous on the platforms I work with; just like Perl. That's the problem. In the space where I might hang Python off of my tool-belt, Perl has already got a lock. I've been waiting for someone to show me something I can only do in Python to give me a reason to add it to my repertoire.

That hasn't quite happened, yet. But I did run across this startling state of affairs recently.

binder@fortune:/tmp$ valgrind --leak-check=full perl -e '1'
==13518== Memcheck, a memory error detector.
==13518== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==13518== Using LibVEX rev 1471, a library for dynamic binary translation.
==13518== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==13518== Using valgrind-3.1.0-Debian, a dynamic binary instrumentation framework.
==13518== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==13518== For more details, rerun with: -v
==13518== 
==13518== 
==13518== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 19 from 1)
==13518== malloc/free: in use at exit: 242,924 bytes in 617 blocks.
==13518== malloc/free: 4,030 allocs, 3,413 frees, 385,702 bytes allocated.
==13518== For counts of detected errors, rerun with: -v
==13518== searching for pointers to 617 not-freed blocks.
==13518== checked 567,912 bytes.
==13518== 
==13518== 5 bytes in 1 blocks are definitely lost in loss record 2 of 10
==13518==    at 0x401C422: malloc (vg_replace_malloc.c:149)
==13518==    by 0x80AC4AD: Perl_savesharedpv (in /usr/bin/perl)
==13518==    by 0x8066831: (within /usr/bin/perl)
==13518==    by 0x8068BB7: perl_parse (in /usr/bin/perl)
==13518==    by 0x805FCB0: main (in /usr/bin/perl)
==13518== 
==13518== 
==13518== 72,329 (1,557 direct, 70,772 indirect) bytes in 11 blocks are definitely lost in loss record 8 of 10
==13518==    at 0x401C422: malloc (vg_replace_malloc.c:149)
==13518==    by 0x80AB5B8: Perl_safesysmalloc (in /usr/bin/perl)
==13518==    by 0x80E7E86: Perl_new_stackinfo (in /usr/bin/perl)
==13518==    by 0x806182F: Perl_init_stacks (in /usr/bin/perl)
==13518==    by 0x8061C28: perl_construct (in /usr/bin/perl)
==13518==    by 0x805FC6E: main (in /usr/bin/perl)
==13518== 
==13518== 
==13518== 131,716 bytes in 1 blocks are possibly lost in loss record 10 of 10
==13518==    at 0x401C422: malloc (vg_replace_malloc.c:149)
==13518==    by 0x80AB5B8: Perl_safesysmalloc (in /usr/bin/perl)
==13518==    by 0x80B5A4B: Perl_reentrant_init (in /usr/bin/perl)
==13518==    by 0x8061E46: perl_construct (in /usr/bin/perl)
==13518==    by 0x805FC6E: main (in /usr/bin/perl)
==13518== 
==13518== LEAK SUMMARY:
==13518==    definitely lost: 1,562 bytes in 12 blocks.
==13518==    indirectly lost: 70,772 bytes in 586 blocks.
==13518==      possibly lost: 131,716 bytes in 1 blocks.
==13518==    still reachable: 38,874 bytes in 18 blocks.
==13518==         suppressed: 0 bytes in 0 blocks.
==13518== Reachable blocks (those to which a pointer was found) are not shown.
==13518== To see them, rerun with: --show-reachable=yes

Well. That's not great. Not terrible but not great. Then compare.

binder@fortune:/tmp$ valgrind --leak-check=full python -c '1'
==31768== Memcheck, a memory error detector.
==31768== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.  
==31768== Using LibVEX rev 1471, a library for dynamic binary translation.
==31768== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==31768== Using valgrind-3.1.0-Debian, a dynamic binary instrumentation framework.
==31768== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==31768== For more details, rerun with: -v
==31768== 
==31768== Conditional jump or move depends on uninitialised value(s)
==31768==    at 0x807F4EE: PyObject_Free (in /usr/bin/python2.4)
==31768==    by 0x8079DD5: (within /usr/bin/python2.4)
==31768==    by 0x8081146: PyString_InternInPlace (in /usr/bin/python2.4)
==31768==    by 0x8082C35: PyString_InternFromString (in /usr/bin/python2.4)
==31768==    by 0x808E8A9: PyType_Ready (in /usr/bin/python2.4)
==31768==    by 0x808F8BA: PyType_Ready (in /usr/bin/python2.4)
==31768==    by 0x807D930: _Py_ReadyTypes (in /usr/bin/python2.4)
==31768==    by 0x80DA1F5: Py_InitializeEx (in /usr/bin/python2.4)
==31768==    by 0x80DA788: Py_Initialize (in /usr/bin/python2.4)
==31768==    by 0x80553CE: Py_Main (in /usr/bin/python2.4)
==31768==    by 0x40AD31E: __libc_start_main (libc-start.c:237)
==31768== 
==31768== Use of uninitialised value of size 4
==31768==    at 0x807F4F7: PyObject_Free (in /usr/bin/python2.4)
==31768==    by 0x8079DD5: (within /usr/bin/python2.4)
==31768==    by 0x8081146: PyString_InternInPlace (in /usr/bin/python2.4)
==31768==    by 0x8082C35: PyString_InternFromString (in /usr/bin/python2.4)
==31768==    by 0x808E8A9: PyType_Ready (in /usr/bin/python2.4)
==31768==    by 0x808F8BA: PyType_Ready (in /usr/bin/python2.4)
==31768==    by 0x807D930: _Py_ReadyTypes (in /usr/bin/python2.4)
==31768==    by 0x80DA1F5: Py_InitializeEx (in /usr/bin/python2.4)
==31768==    by 0x80DA788: Py_Initialize (in /usr/bin/python2.4)
==31768==    by 0x80553CE: Py_Main (in /usr/bin/python2.4)
==31768==    by 0x40AD31E: __libc_start_main (libc-start.c:237)
==31768== 
==31768== Invalid read of size 4
==31768==    at 0x807F4E4: PyObject_Free (in /usr/bin/python2.4)
==31768==    by 0x8090265: (within /usr/bin/python2.4)
==31768==    by 0x80903A4: (within /usr/bin/python2.4)
==31768==    by 0x808E01D: PyType_Ready (in /usr/bin/python2.4)
==31768==    by 0x808F8BA: PyType_Ready (in /usr/bin/python2.4)
==31768==    by 0x807D958: _Py_ReadyTypes (in /usr/bin/python2.4)
==31768==    by 0x80DA1F5: Py_InitializeEx (in /usr/bin/python2.4)
==31768==    by 0x80DA788: Py_Initialize (in /usr/bin/python2.4)
==31768==    by 0x80553CE: Py_Main (in /usr/bin/python2.4)
==31768==    by 0x40AD31E: __libc_start_main (libc-start.c:237)
==31768==  Address 0x41F5010 is 120 bytes inside a block of size 384 free'd
==31768==    at 0x401CFCF: free (vg_replace_malloc.c:235)
==31768==    by 0x8079DD5: (within /usr/bin/python2.4)
==31768==    by 0x808EBA1: PyType_Ready (in /usr/bin/python2.4)
==31768==    by 0x808F8BA: PyType_Ready (in /usr/bin/python2.4)

[and so on until]

==31768== Invalid read of size 4
==31768==    at 0x807F4E4: PyObject_Free (in /usr/bin/python2.4)
==31768==    by 0x80F2CD7: PyGrammar_RemoveAccelerators (in /usr/bin/python2.4)
==31768==    by 0x80D8F35: Py_Finalize (in /usr/bin/python2.4)
==31768==    by 0x805579F: Py_Main (in /usr/bin/python2.4)
==31768==    by 0x40AD31E: __libc_start_main (libc-start.c:237)
==31768==  Address 0x422B010 is 56 bytes inside a block of size 916 free'd
==31768==    at 0x401CFCF: free (vg_replace_malloc.c:235)
==31768==    by 0x8055D94: (within /usr/bin/python2.4)
==31768==    by 0x80D9D1D: PyRun_StringFlags (in /usr/bin/python2.4)
==31768==    by 0x80A966D: (within /usr/bin/python2.4)
==31768==    by 0x80B63C6: PyEval_EvalFrame (in /usr/bin/python2.4)
==31768==    by 0x80B713A: PyEval_EvalFrame (in /usr/bin/python2.4)
==31768==    by 0x80B781E: PyEval_EvalCodeEx (in /usr/bin/python2.4)
==31768==    by 0x80B7A64: PyEval_EvalCode (in /usr/bin/python2.4)
==31768==    by 0x80D027E: PyImport_ExecCodeModuleEx (in /usr/bin/python2.4)
==31768==    by 0x80D0605: (within /usr/bin/python2.4)
==31768==    by 0x80D1420: (within /usr/bin/python2.4)
==31768==    by 0x80D1648: (within /usr/bin/python2.4)
==31768== 
==31768== ERROR SUMMARY: 811 errors from 103 contexts (suppressed: 19 from 1)
==31768== malloc/free: in use at exit: 654,054 bytes in 46 blocks.
==31768== malloc/free: 3,504 allocs, 3,458 frees, 1,560,141 bytes allocated.
==31768== For counts of detected errors, rerun with: -v
==31768== searching for pointers to 46 not-freed blocks.
==31768== checked 874,748 bytes.
==31768== 
==31768== LEAK SUMMARY:
==31768==    definitely lost: 0 bytes in 0 blocks.
==31768==      possibly lost: 0 bytes in 0 blocks.
==31768==    still reachable: 654,054 bytes in 46 blocks.
==31768==         suppressed: 0 bytes in 0 blocks.
==31768== Reachable blocks (those to which a pointer was found) are not shown.
==31768== To see them, rerun with: --show-reachable=yes

Seriously? Leak-less? OK, sign me up for your crazy British sketch comedy worshiping code-monkey cult.

UPDATE 2007/12/30: Oh, and lest I forget:
binder@fortune:~$ valgrind --leak-check=full ruby -e '1' ==9637== Memcheck, a memory error detector. ==9637== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al. ==9637== Using LibVEX rev 1471, a library for dynamic binary translation. ==9637== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP. ==9637== Using valgrind-3.1.0-Debian, a dynamic binary instrumentation framework. ==9637== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al. ==9637== For more details, rerun with: -v ==9637== ==9637== ==9637== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 21 from 1) ==9637== malloc/free: in use at exit: 335,613 bytes in 7,248 blocks. ==9637== malloc/free: 7,515 allocs, 267 frees, 338,631 bytes allocated. ==9637== For counts of detected errors, rerun with: -v ==9637== searching for pointers to 7,248 not-freed blocks. ==9637== checked 853,556 bytes. ==9637== ==9637== LEAK SUMMARY: ==9637== definitely lost: 0 bytes in 0 blocks. ==9637== possibly lost: 0 bytes in 0 blocks. ==9637== still reachable: 335,613 bytes in 7,248 blocks. ==9637== suppressed: 0 bytes in 0 blocks. ==9637== Reachable blocks (those to which a pointer was found) are not shown. ==9637== To see them, rerun with: --show-reachable=yes binder@fortune:~$ Poor ol' Perl.

posted at 08:48 PST (-0800)     (comments disabled)   permanent link  
January
Sun Mon Tue Wed Thu Fri Sat
 
19
     
2007
Months
Jan