Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in perldiag #175

Closed
p5pRT opened this issue Jul 9, 1999 · 5 comments
Closed

Bug in perldiag #175

p5pRT opened this issue Jul 9, 1999 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 9, 1999

Migrated from rt.perl.org#980 (status was 'resolved')

Searchable as RT980$

@p5pRT
Copy link
Author

p5pRT commented Jul 9, 1999

From jdporter@sprint.net

perldiag appears to have a tiny -- but important error.
Currently, it says​:

  Bad free() ignored
  (S) An internal routine called free() on something that
  had never been malloc()ed in the first place. Mandatory,
  but can be disabled by setting environment variable
  PERL_BADFREE to 1.

But, AFAICT, that should be 0 (zero), not 1.
I base this on the code in malloc.c​:

  if (bad_free_warn == -1) {
  char *pbf = PerlEnv_getenv("PERL_BADFREE");
  bad_free_warn = (pbf) ? atoi(pbf) : 1;
  }
  if (!bad_free_warn)
  return;

And indeed, setting PERL_BADFREE to 0 *DOES* silence the warning,
while setting it to 1 does *NOT*.

The documentation goes on to say​:

  This message can be quite often seen with DB_File on systems with
  "hard" dynamic linking, like AIX and OS/2. It is a bug of
  Berkeley DB which is left unnoticed if DB uses forgiving
  system malloc().

But I experienced it (on Solaris 2.6) when attempting to set an
environment variable in %ENV.

Perl Info


Site configuration information for perl 5.00502:

Configured by pgduda at Thu Oct 22 18:12:42 EDT 1998.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris-thread
    uname='sunos prod5 5.6 generic_105181-08 sun4u sparc sunw,ultra-enterprise '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc -B/usr/ccs/bin/', optimize='-O', gccversion=2.8.1
    cppflags='-D_REENTRANT -I/usr/local/include'
    ccflags ='-D_REENTRANT -I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc -B/usr/ccs/bin/', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lposix4 -lpthread -lc -lcrypt
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.00502:
    /export/home/jdporter/perl
    /usr/local/lib/perl5/5.00502/sun4-solaris-thread
    /usr/local/lib/perl5/5.00502
    /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread
    /usr/local/lib/perl5/site_perl/5.005
    .


Environment for perl 5.00502:
    HOME=/export/home/jdporter
    LANG=en_US
    LC_COLLATE=en_US
    LC_CTYPE=en_US
    LC_MESSAGES=C
    LC_MONETARY=en_US
    LC_NUMERIC=en_US
    LC_TIME=en_US
    LD_LIBRARY_PATH=/usr/local/lib:/usr/local/oracle/product/8.0.5/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/pgplot:/usr/local/rvplayer5.0
    LOGDIR (unset)
    PATH=/usr/local/bin:/usr/bin:/etc:/usr/sbin:/export/home/jdporter/bin:/usr/dt/bin:/usr/openwin/bin:/usr/local/apache/bin:.:/usr/ccs/bin:/usr/ucb:/usr/local/oracle/product/8.0.5/bin
    PERL5LIB=/export/home/jdporter/perl
    PERL_BADLANG (unset)
    SHELL=/bin/sh

@p5pRT
Copy link
Author

p5pRT commented Jul 27, 2000

From @rspier

fixing old bugs....

http​://bugs.perl.org/admin/perlbug.cgi?req=tid&tid=19990709.002

for rationale.

-R

[against perl-current]

Inline Patch
--- perldiag.pod.1      Thu Jul 27 09:43:43 2000
+++ perldiag.pod        Thu Jul 27 09:47:46 2000
@@ -261,9 +261,9 @@
 
 (S malloc) An internal routine called free() on something that had never
 been malloc()ed in the first place. Mandatory, but can be disabled by
-setting environment variable C<PERL_BADFREE> to 1.
+setting environment variable C<PERL_BADFREE> to 0.
 
-This message can be quite often seen with DB_File on systems with "hard"
+This message can be seen quite often with DB_File on systems with "hard"
 dynamic linking, like C<AIX> and C<OS/2>. It is a bug of C<Berkeley DB>
 which is left unnoticed if C<DB> uses I<forgiving> system malloc().

@p5pRT
Copy link
Author

p5pRT commented Jul 27, 2000

From @jhi

On Thu, Jul 27, 2000 at 09​:49​:35AM -0400, Robert Spier wrote​:

fixing old bugs....

http​://bugs.perl.org/admin/perlbug.cgi?req=tid&tid=19990709.002

for rationale.

-R

[against perl-current]
--- perldiag.pod.1 Thu Jul 27 09​:43​:43 2000
+++ perldiag.pod Thu Jul 27 09​:47​:46 2000
@​@​ -261,9 +261,9 @​@​

Thanks, applied.

@p5pRT p5pRT closed this as completed Nov 28, 2003
@p5pRT
Copy link
Author

p5pRT commented Nov 28, 2003

From The RT System itself

marked [on hold] pending patch approval

@p5pRT
Copy link
Author

p5pRT commented Nov 28, 2003

From The RT System itself

closed​: patch accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant