post mortem

Jonas Sundström jonas at
Mon Jan 31 00:18:37 CET 2005

Scott Wheeler <wheeler at> wrote:
> > > Given the trace that you gave my guess would be that
> > > your C-string that you're passing to the TagLib::String
> > > constructor is actually invalid.
> >
> > Would it be wrong to pass on a UTF8 encoded
> > pathname to the FileRef constructor?
> Well, no -- if the system locale is utf8.  

BeOS is UTF8 all throughout the system.

> But that has little to do with memory corruption.
> By memory corruption I mean that whatever string that you're passing 
> in -- 
> whatever "char *" is likely no longer valid.  It's been freed or 
> isn't 
> properly terminated or something of the sort.

Yes, I understand. The same strings are used in a parallell part of the 
application (though not concurrently), without error, and the 
application has been stable for quite some time, so I think it's 
unlikely that there would be an invalid string, but who knows. 

At first I didn't see a pattern, but the bad extension -> isNull() -> 
crash is reproducable, the real error being too little error checking 
on my part. (Not that these filenames are too unlikely to ignore. When 
duplicating files in BeOS, the filename mutation is appended to the 
filename after the extension. Possibly in MacOS as well, since that's 
where BeOS got much of it's desktop behaviour.)

Not sure how it relates to the first stack trace I posted though.

/Jonas Sundström.   

More information about the taglib-devel mailing list