bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #27143] Crash in a pair of mutually recursive macros


From: Timothy N Murphy
Subject: [bug #27143] Crash in a pair of mutually recursive macros
Date: Thu, 30 Jul 2009 16:42:12 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.1.1) Gecko/20090717 Fedora/3.5.1-1.fc11 Firefox/3.5.1

URL:
  <http://savannah.gnu.org/bugs/?27143>

                 Summary: Crash in a pair of mutually recursive macros
                 Project: make
            Submitted by: tnmurphy
            Submitted on: Thu 30 Jul 2009 16:42:11 GMT
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 3.81
        Operating System: Any
           Fixed Release: None

    _______________________________________________________

Details:

This crash happens on win32 with mingw make 3.81 for us and on Redhat 4 (32)
with custom built gnu make 3.81 (32-bit), also CentOS 5.3 (64) using gnu make
3.81 (32).

It appears to succeed on Fedora 11 with make 3.81 (64) but fail with a custom
built 32-bit make (linked to compat-glibc).

Sorry for the confusion there.  

My example is a bit big at the moment.

I used valgrind to see what was happening:



==24453== 
==24453== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 14 from 1)
==24453== malloc/free: in use at exit: 44,167 bytes in 1,216 blocks.
==24453== malloc/free: 2,785 allocs, 1,569 frees, 93,301 bytes allocated.
==24453== For counts of detected errors, rerun with: -v
==24453== searching for pointers to 1,216 not-freed blocks.
==24453== checked 147,452 bytes.
==24453== 
==24453== LEAK SUMMARY:
==24453==    definitely lost: 0 bytes in 0 blocks.
==24453==      possibly lost: 0 bytes in 0 blocks.
==24453==    still reachable: 44,167 bytes in 1,216 blocks.
==24453==         suppressed: 0 bytes in 0 blocks.
==24453== Rerun with --leak-check=full to see details of leaked memory.
address@hidden t]cd ~/tmp/
address@hidden tmp]valgrind make -f t.mk
==24462== Memcheck, a memory error detector.
==24462== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==24462== Using LibVEX rev 1884, a library for dynamic binary translation.
==24462== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==24462== Using valgrind-3.4.1, a dynamic binary instrumentation framework.
==24462== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==24462== For more details, rerun with: -v
==24462== 
==24462== Warning: client switching stacks?  SP change: 0xbefbba80 -->
0xbd5fbc50
==24462==          to suppress, use: --max-stackframe=27000368 or greater
==24462== 
==24462== Process terminating with default action of signal 11 (SIGSEGV)
==24462==  Access not within mapped region at address 0xBD5FBC48
==24462==    at 0x804D4FC: expand_argument (expand.c:439)
==24462==  If you believe this happened as a result of a stack overflow in
your
==24462==  program's main thread (unlikely but possible), you can try to
increase
==24462==  the size of the main thread stack using the --main-stacksize=
flag.
==24462==  The main thread stack size used in this run was -1.
==24462== 
==24462== Process terminating with default action of signal 11 (SIGSEGV)
==24462==  Access not within mapped region at address 0xBD5FBC44
==24462==    at 0x40005A3: _vgnU_freeres (vg_preloaded.c:56)
==24462==  If you believe this happened as a result of a stack overflow in
your
==24462==  program's main thread (unlikely but possible), you can try to
increase
==24462==  the size of the main thread stack using the --main-stacksize=
flag.
==24462==  The main thread stack size used in this run was -1.
==24462== 
==24462== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 14 from 1)
==24462== malloc/free: in use at exit: 137,065,676 bytes in 699 blocks.
==24462== malloc/free: 2,031,760 allocs, 2,031,061 frees, 2,078,692,395 bytes
allocated.
==24462== For counts of detected errors, rerun with: -v
==24462== searching for pointers to 699 not-freed blocks.
==24462== checked 137,170,860 bytes.
==24462== 
==24462== LEAK SUMMARY:
==24462==    definitely lost: 0 bytes in 0 blocks.
==24462==      possibly lost: 0 bytes in 0 blocks.
==24462==    still reachable: 137,065,676 bytes in 699 blocks.
==24462==         suppressed: 0 bytes in 0 blocks.
==24462== Rerun with --leak-check=full to see details of leaked memory.


The makefile contains:

# Crash in a recursing macro 


# AllSuffixSubst
## Converting a list of source files to a list of object files without
altering
## their relative order. Also deals with multiple file types mapping to the
same
## object type e.g. .CPP and .cpp and .c++ all map to .o

# $1 - the list of suffixes to replace
# $2 - the suffix to replace them with
# $3 - the list of strings to perform the replacement on
define allsuffixsubst_internal
    $(if $1,$$(patsubst %$(firstword $1),%$2,$(call
allsuffixsubst_internal,$(wordlist 2,$(words $1),$1),$2,$3)),$3)
    endef
    define allsuffixsubst
        $(eval allsuffixsubst_RESULT:=$(call
allsuffixsubst_internal,$1,$2,$3))$(allsuffixsubst_RESULT)
        endef

        x10:=1 2 3 4 5 6 7 8 9 0
        x100:=$(foreach i,$(x10),$(x10))
        x10000:=$(foreach i,$(x100),$(x100))
        x1000000:=$(foreach i,$(x10000),$(x100))

        somefiles:=$(foreach f,$(x1000000),fred.cia fred.cpp fred.c++)
        objects:=$(call allsuffixsubst,.Cia .CiA .cIA. .CpP .cPp .CC .C++
.cia .cpp .c++ .cc .CPP .CIA .Cpp,.o,$(somef
iles))





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27143>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]