Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ethan (3163)

ethan
  reversethis-{ed. ... rap.nov.olissat}

Being a 25-year old chap living in the western-most town of Germany. Stuying communication and information science and being a huge fan of XS-related things.

Journal of ethan (3163)

Monday November 04, 2002
12:16 PM

Two annoying days

[ #8756 ]

I'm afraid I need to hit the rewind-button. My last journal entry about resolving a memory-leak turned out to be premature. Sure, I did fix a memory-leak, but actually a non-existing one. :-/ What I free'd was the return value of "SvPV(sv)"...which, according to perlapi.pod, is a pointer to the string value of "sv". Thus I had blown up all of my Perl scalar's, oups.

I found out that there was nothing wrong with my code so none of my leaks stemmed from it. Instead the underlying mplib leaks very heavily, as I found out in hourly sessions staring into the debugger and logfiles created by dmalloc (an extremely cool thing if you are an occasional C-programmer, by the way). Even worse, the author of the mplib doesn't seem to respond to my emails (probably too ashamed;-).

I then decided to patch mplib wherever I could. I was able to close a few of the leaks, but some serious ones are still lurking around. That's why I now announce MP3::Mplib to be dead. I will skip to the id3lib which is widely enough used so I expect it to be relatively bug- and leak-free. I have to re-register the namespace but this time I'll wait till the first release is actually on my hard-disk waiting to be uploaded in a tested and non-leaking state.

But that's not too urgent. First I need to recover from memory allocating and deallocating strategies. :-)

I'll now play a little with what I read in jjohn's article. Since I am one of those preferring vim over emacs, I can't use all the listings one-by-one. Making the adaptions to vim should be a real pleasure since this time it really just involves Perl and perhaps a little Bash-scripting. :-)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Did you get far with the id3lib module?
    • Did you get far with the id3lib module?

      Actually I never touched it because mplib's author replied to me just in time. There were quite a number of fixes to be made: resolving memory-leaks in mplib and - fixed just yesterday - an issue with (apparently) 64bit machines.

      0.02 will be a rewrite from scratch eventually. My first XS attempt turned out to be a mess but after Mail::Transport::Dbx (another XS) I should be able to do things a little more intelligently.

      Anyway, first I have to get rid of my cold. :-
      • Ah, ok. blech has kindly asked me to code up an id3lib module. I'm a little worried about the C++ interface as I've never coded C++ XS. I guess we'll see ;-)
        • Don't worry. id3lib also comes with a C interface so you don't have to leave familiar tracks. Checking for proper C bindings was actually the first thing I did when looking up the id3lib since I am rather reluctant towards C++/XS as well.