bugmake - Bugs: bug #2888, recursive make fails on AIX...

 
 

bug #2888: recursive make fails on AIX (virtual memory exhausted)

Submitted by:  Invalid User ID <Invalid User ID>
Submitted on:  Fri 21 Mar 2003 09:20:50 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.80Operating System: POSIX-Based
Fixed Release: 3.81Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 22 Aug 2003 08:54:49 PM UTC, comment #6:

Ouch. According to the C89 standard, malloc() must return a valid (non-NULL) pointer when passed a size of 0. That pointer must also be legal to pass to free(), although if the size is zero it might not be legal to indirect through the pointer. It's sad that in 2003 we can't expect our systems to even conform to a standard ratified worldwide 14 years before :(.

Anyway, a patch to create a new malloc() is overkill: GNU make already always uses xmalloc() so we can just make the change to test for 0 there. However, I don't think any normal processing of GNU make should ever ask for a malloc() with size of 0; I wonder who's calling that. If you can reproduce I'm interested in a small makefile that shows the problem and even a stack trace from the debugger when it happens.

Thanks!

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Mon 30 Jun 2003 11:50:22 AM UTC, comment #5:

This bug should be fixed by patch #1684. I've tested it on HP-UX 11 (cc), AIX 4.3.3 (gcc-3.0.4) and SunOS 5.8 (gcc-3.0.4). In all cases, "make check" passes and the test case described by Velo passes as well. Note that malloc.c (in the patch) has been taken from coreutils-5.0.

Jérôme Zago <Agt>
Mon 30 Jun 2003 07:27:57 AM UTC, comment #4:

Indeed, from the HP-UX 11 malloc man page:
-----
The only external difference between the old malloc(3X) allocator and the malloc(3C) allocator is that the old allocator would return a NULL pointer for a request of zero bytes. The malloc(3C) allocator returns a valid memory address. This is not a concern for most applications.
-----

Whereas from the AIX 4.3.3 malloc man page:
-----
If the malloc or valloc subroutine is called with a size of 0, the subroutine returns a null pointer.
-----

Jérôme Zago <Agt>
Mon 30 Jun 2003 07:06:38 AM UTC, comment #3:

I don't have this problem on HP-UX 11 either, with the same versions of make, both built with CC=cc and --disable-nls.

I could reproduce it on AIX 4.3.3 though, with the same versions of make, both built with gcc 3.0.4 and --disable-nls:

$ ~/opt/make-3.81a2/arch/laursf8/bin/make
/users/ie/jza/opt/make-3.81a2/arch/laursf8/bin/make -R -f SubMakefile
make[1]: Entering directory `/users_main/ie/jza/src/tmp'
make[1]: *** virtual memory exhausted. Stop.
make[1]: Leaving directory `/users_main/ie/jza/src/tmp'
make: *** [all] Error 2

$ ~/opt/make-3.80/arch/laursf8/bin/make
/users/ie/jza/opt/make-3.80/arch/laursf8/bin/make -R -f SubMakefile
make[1]: Entering directory `/users_main/ie/jza/src/tmp'
make[1]: *** virtual memory exhausted. Stop.
make[1]: Leaving directory `/users_main/ie/jza/src/tmp'
make: *** [all] Error 2

I have attached configure, make and make check traces for make-3.81a2 on AIX 4.3.3. Please tell me if you need more details.

Jérôme Zago <Agt>
Mon 30 Jun 2003 07:01:05 AM UTC, comment #2:

I already found the bug. It is a malloc with a size of 0. This returns at least on AIX a NULL pointer.

Note: This is not related to recursive make as I first wrote.

In my case this happens here in function pattern_search:

/* List of dependencies found recursively. */
struct file **intermediate_files
= (struct file *) xmalloc (max_pattern_deps sizeof (struct file *));

where max_pattern_deps is 0.

I know in practice this case will never happen, i think.

The other bug i mentioned was related to eval and its already fixed (cvs) memory error.

Anonymous
Fri 27 Jun 2003 06:32:14 PM UTC, comment #1:

For your information, I don't have this problem on Mandrake Linux 9.1, whether with default make (3.80) or with latest make built from CVS (3.81a2, first date in ChangeLog: 2003-04-30):

$ cat -T Makefile
# Makefile
all:
^I$(MAKE) -R -f SubMakefile

$ cat -T SubMakefile
# SubMakefile
all:

$ make --version | head -1
GNU Make 3.81a2

$ make
make -R -f SubMakefile
make[1]: Entering directory `/home/agt/tmp/make'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/agt/tmp/make'

I'll try to perform the same tests on AIX 4.3.3 next week.

Jérôme Zago <Agt>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #500:  trace-3.81a2-AIX.bz2 added by Agt (5KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 01 Apr 2006 07:06:58 AM UTCpsmithFixed Release4.0=>3.81
Fri 22 Aug 2003 08:54:49 PM UTCpsmithOpen/ClosedOpen=>(Error - Not Found)
  Fixed ReleaseNone=>(Error - Not Found)
Fri 22 Aug 2003 08:54:48 PM UTCpsmithStatusNone=>(Error - Not Found)
  Assigned toNone=>NA

Back to the top


Powered by Savane 3.1-cleanup1