Re: Bad free() with perl, DBI, Informix and blobs
Posted in 1998
Topics: Platform-Specific Issues
"Steven Primrose-Smith" <smith@avl.com> writes: > After much playing about, I finally managed to get blobs > in and out of an Informix database using DBI. However, > there is a problem. I have a function that returns the blob > as a scalar. Whenever I have a script that calls it, I get > the following error: > > Bad free() ignored at <program name> line <x> > > where program name is the name of the script calling the > function and x is the line number. This always occurs > whenever I try to extract a blob from the database. The > error occurs (according to the line number) on the line > *immediately after* the function call even if the scalar is not > used within that line. The scalar contains the blob as > required but this error message is littering my web pages. > I don't know whether this is a perl, DBI or Informix problem - > can anyone help? According to Chapter 9 of the (second) camel book, this message means "An internal routine called free(3) on something that had never been malloc(3)ed in the first place" and describes it as "a severe warning (mandatory). I've encountered this problem on a Solaris 2.6 machine when I set variables in %ENV before making a call to system() so I think it's actually a perl problem. From the research I did when I found this problem, it seems to be a bug on some platforms in perl5.004_04 as well as in perl5.005_02. I've lost the references for this though, but there was some discussion in the perl-porters mailing list. If you're feeling game, try using the following code to suppress the warning: local $SIG{__WARN__} = sub { print(STDERR @_) unless $_[0] =~ m/Bad free/; }; Tim. > > Best wishes, > Steven > smith@avl.com >