[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: crash on powerpc-ibm-aix5.1.0.0
From: |
Dan Nicolaescu |
Subject: |
Re: crash on powerpc-ibm-aix5.1.0.0 |
Date: |
Sun, 18 Sep 2005 09:52:46 -0700 |
The cause of the crash is a memory corruption happening in
buffer.c:init_buffer:
[snip]
pwd = get_current_dir_name ();
if (!pwd)
fatal ("`get_current_dir_name' failed: %s\n", strerror (errno));
#ifndef VMS
/* Maybe this should really use some standard subroutine
whose definition is filename syntax dependent. */
rc = strlen (pwd);
if (!(IS_DIRECTORY_SEP (pwd[rc - 1])))
{
/* Grow buffer to add directory separator and '\0'. */
pwd = (char *) xrealloc (pwd, rc + 2);
pwd[rc] = DIRECTORY_SEP;
pwd[rc + 1] = '\0';
}
#endif /* not VMS */
on this powerpc-ibm-aix5.1.0.0 system HAVE_GET_CURRENT_DIR_NAME
is defined to 1 so the libc version of get_current_dir_name is used.
get_current_dir_name returns malloced memory.
On this system the memory allocator in gmalloc.c is used.
So what happens is the xrealloc call corrupts memory because
get_current_dir_name is using a different memory allocator...
If I change the #ifndef HAVE_GET_CURRENT_DIR_NAME in sysdep.c to
#if 1 then everything works OK.
What is the best way to fix this?
--dan
- crash on powerpc-ibm-aix5.1.0.0, Dan Nicolaescu, 2005/09/18
- Re: crash on powerpc-ibm-aix5.1.0.0,
Dan Nicolaescu <=
- Re: crash on powerpc-ibm-aix5.1.0.0, Richard M. Stallman, 2005/09/19
- Re: crash on powerpc-ibm-aix5.1.0.0, Dan Nicolaescu, 2005/09/20
- Re: crash on powerpc-ibm-aix5.1.0.0, Richard M. Stallman, 2005/09/21
- Re: crash on powerpc-ibm-aix5.1.0.0, Dan Nicolaescu, 2005/09/23
- Re: crash on powerpc-ibm-aix5.1.0.0, Richard M. Stallman, 2005/09/23
- Re: crash on powerpc-ibm-aix5.1.0.0, Dan Nicolaescu, 2005/09/23
Re: crash on powerpc-ibm-aix5.1.0.0, Harald Maier, 2005/09/20