Menu

#9 Malloc errors

open
nobody
None
5
2005-08-23
2005-08-23
Anonymous
No

I'm using Mac OS X (version 10.3.9). With versions 1.1.5 - 1.1.8 of
the code, I am getting the following errors when I try to run
perlprimer.pl:

*** malloc[854]: Deallocation of a pointer not malloced: 0x722f6269;
This could be a double free(), or free() called with the middle of an
allocated block; Try setting environment variable MallocHelp to see
tools to help debug
*** malloc[854]: Deallocation of a pointer not malloced: 0x6e2f7065;
This could be a double free(), or free() called with the middle of an
allocated block; Try setting environment variable MallocHelp to see
tools to help debug
*** malloc[854]: Deallocation of a pointer not malloced: 0x726c0000;
This could be a double free(), or free() called with the middle of an
allocated block; Try setting environment variable MallocHelp to see
tools to help debug
Segmentation fault

Versions 1.1.1 - 1.1.4a seem to work. Do you have any
suggestions for getting the latest versions to work?

Thanks!
-Greg Boggy

Discussion

  • Owen Marshall

    Owen Marshall - 2005-08-23

    Logged In: YES
    user_id=874762

    This is probably related to bug 1111107 - that was caused by
    OS X persisting in using a buggy and years-out-of-date
    version of Perl (5.6); the errors apparently go when you
    upgrade to the current version of Perl (5.8.6). Whether or
    not there's an easy way to do this in OS X, I don't know ...
    Have a look at that bug report for more details ...

    Alternatively, if you are using version 5.8 of Perl (you can
    find out the version number by running perl -v from the
    command line), let me know.

    Hope this helps, and let me know if the above fixes the
    problem ...
    Owen

     
  • Nobody/Anonymous

    Logged In: NO

    Hi Owen,
    I updated Perl to 5.8, but I still get the errors. I will look into the bug you
    mentioned. Please let me know if you have other ideas.
    Thanks for your help!
    -Greg

     
  • Owen Marshall

    Owen Marshall - 2005-08-24

    Logged In: YES
    user_id=874762

    Greg,

    I don't know why this should be happening; unfortunately,
    it's a problem with the way Perl is allocating memory: in
    theory you should never see these sorts of errors! You
    could try running the debugger:

    perl -d perlprimer.pl

    and then type 's' and just hold the return key down, and see
    what line number the script stops at when you get the error.
    I'd be interested in knowing!

    It might also be worth checking, if you haven't already,
    that the command

    /usr/bin/perl -v

    shows version 5.8, not 5.6, just to make sure that the old
    version of perl got uninstalled, as opposed to the new
    version being installed in /usr/local and the old in /usr

    That's about all I can think of at the moment - let me know
    if you've had any success?

    Owen

     
  • Nobody/Anonymous

    Logged In: NO

    Hi Owen,
    While debugging, I discovered the source of the problem: lines 510-516,
    which are for Spidey. If I comment these lines out, the PerlPrimer window
    opens. Here is what comes up when debugging:

    DB<1>
    main::(perlprimer.pl:512): my @spidey_files =
    glob("$program_directory*pidey.*");
    DB<1>
    File::Glob::glob(/System/Library/Perl/5.8.1/darwin-thread-multi-2level/File/
    Glob.pm:128):
    128: goto &bsd_glob;
    DB<1>
    File::Glob::bsd_glob(/System/Library/Perl/5.8.1/darwin-thread-multi-2level/
    File/Glob.pm:120):
    120: my ($pat,$flags) = @_;
    DB<1>
    File::Glob::bsd_glob(/System/Library/Perl/5.8.1/darwin-thread-multi-2level/
    File/Glob.pm:121):
    121: $flags = $DEFAULT_FLAGS if @_ < 2;
    DB<1>
    File::Glob::bsd_glob(/System/Library/Perl/5.8.1/darwin-thread-multi-2level/
    File/Glob.pm:122):
    122: return doglob($pat,$flags);
    DB<1>
    main::(perlprimer.pl:513): @spidey_files =
    glob("$program_directory*pidey*") unless @spidey_files;
    DB<1>
    File::Glob::glob(/System/Library/Perl/5.8.1/darwin-thread-multi-2level/File/
    Glob.pm:128):
    128: goto &bsd_glob;
    DB<1>
    File::Glob::bsd_glob(/System/Library/Perl/5.8.1/darwin-thread-multi-2level/
    File/Glob.pm:120):
    120: my ($pat,$flags) = @_;
    DB<1>
    File::Glob::bsd_glob(/System/Library/Perl/5.8.1/darwin-thread-multi-2level/
    File/Glob.pm:121):
    121: $flags = $DEFAULT_FLAGS if @_ < 2;
    DB<1>
    File::Glob::bsd_glob(/System/Library/Perl/5.8.1/darwin-thread-multi-2level/
    File/Glob.pm:122):
    122: return doglob($pat,$flags);
    DB<1>

    -Greg

     
  • Nobody/Anonymous

    Logged In: NO

    Hi Owen,
    Actually, I isolated the problem to one line of code: line 513.
    This is:
    spidey_files = glob("$program_directory*pidey*") unless @spidey_files;

    Any ideas how I could get this to work?
    Thanks,
    -Greg

     
  • Nobody/Anonymous

    Logged In: NO

    Hi Owen,
    For some reason, the glob command was the problem. If it is replaced
    with bsd_glob, everything runs. Great program!
    Thanks,
    -Greg

     
  • Owen Marshall

    Owen Marshall - 2005-08-25

    Logged In: YES
    user_id=874762

    Thanks Greg,

    Presumably the other glob lines in the program also cause
    problems (try using the "add cloning sequences" menu
    command, for example?) ... I did notice that you were using
    version 5.8.1 of Perl, and I wonder if 5.8.6 still has this
    error? How easy is it to upgrade Perl on OSX?

    Hmmm ... looks like I might need to release a separate
    version at this rate ...

    Owen

     
  • Nobody/Anonymous

    Logged In: NO

    Hi Owen,
    It's not hard at all to upgrade. I downloaded what was listed as version
    5.8.7 from perl.com, but it was actually 5.8.1. I don't know why that is.
    Thanks,
    -Greg

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.