Bug 20613 - __attribute__((malloc)) causes segfault in GCC 3.4
Summary: __attribute__((malloc)) causes segfault in GCC 3.4
Status: RESOLVED DUPLICATE of bug 15443
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.4
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-24 02:55 UTC by Lukasz Kosewski
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
The attached .i file and original source. (766 bytes, application/x-tar)
2005-03-24 02:58 UTC, Lukasz Kosewski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukasz Kosewski 2005-03-24 02:55:43 UTC
I have a very simple program here, namely:
----------
#include <malloc.h>

void __attribute__((malloc)) intersect(int list)
{
    int* shite = (int *)malloc(sizeof(int));
}

int main()
{
    intersect(5);
}
----------

Attempting to compile this using GCC 3.4 with `gcc bug.c` causes a segmentation
fault.

Output of `gcc -v --save-temps bug.c`:
----------
Reading specs from /usr/lib/gcc/i486-linux/3.4.4/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--libexecdir=/usr/lib --with-gxx-include-dir=/usr/include/c++/3.4
--enable-shared --with-system-zlib --enable-nls --without-included-gettext
--program-suffix=-3.4 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt
--enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm
--enable-java-awt=gtk --disable-werror i486-linux
Thread model: posix
gcc version 3.4.4 20050209 (prerelease) (Debian 3.4.3-9ubuntu3)
 /usr/lib/gcc/i486-linux/3.4.4/cc1 -E -quiet -v bug.c -mtune=i486 -o bug.i
ignoring nonexistent directory
"/usr/lib/gcc/i486-linux/3.4.4/../../../../i486-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/i486-linux/3.4.4/include
 /usr/include
End of search list.
 /usr/lib/gcc/i486-linux/3.4.4/cc1 -fpreprocessed bug.i -quiet -dumpbase bug.c
-mtune=i486 -auxbase bug -version -o bug.s
GNU C version 3.4.4 20050209 (prerelease) (Debian 3.4.3-9ubuntu3) (i486-linux)
	compiled by GNU C version 3.4.4 20050209 (prerelease) (Debian 3.4.3-9ubuntu3).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64543
bug.c: In function `main':
bug.c:10: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-3.4/README.Bugs>.
----------

This interface for bug submissions is horrible (no offense).  If I can figure
out how to attach files to this bug, I will attach the .i file.
Comment 1 Lukasz Kosewski 2005-03-24 02:58:58 UTC
Created attachment 8442 [details]
The attached .i file and original source.

This contains the original source which produced the error, as well as the .i
file which I get out of it.
Comment 2 Andrew Pinski 2005-03-24 03:02:24 UTC
Yes but this is a dup of bug 15443.  A simple seach would have found it

*** This bug has been marked as a duplicate of 15443 ***