public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18391] New: internal error: Segmentation fault for valid code segment
@ 2004-11-09  6:12 asachdeva at gmail dot com
  2004-11-09  6:15 ` [Bug c++/18391] " asachdeva at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: asachdeva at gmail dot com @ 2004-11-09  6:12 UTC (permalink / raw)
  To: gcc-bugs

Try to compile the following code in a cpp file, gcc crashes. Working on Redhat 7.2.

#include <assert.h>

#define b 5
int f;
int foobar(int foo, int bar = (assert(f>=b), funcPtr)(), int foob=some_int);

Reading specs from
/shared/i80386linux/compiler/gcc3.2/linux2.4/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ../configure
--prefix=/user/unicore/i80386linux/compiler/gcc3.2/linux2.4
--enable-languages=c,c++ --enable-threads=posix --enable-shared
--enable-__cxa_atexit
Thread model: posix
gcc version 3.2

-- 
           Summary: internal error: Segmentation fault for valid code
                    segment
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: asachdeva at gmail dot com
                CC: asachdeva at gmail dot com,gcc-bugs at gcc dot gnu dot
                    org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/18391] internal error: Segmentation fault for valid code segment
  2004-11-09  6:12 [Bug c++/18391] New: internal error: Segmentation fault for valid code segment asachdeva at gmail dot com
@ 2004-11-09  6:15 ` asachdeva at gmail dot com
  2004-11-09  6:17 ` asachdeva at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: asachdeva at gmail dot com @ 2004-11-09  6:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From asachdeva at gmail dot com  2004-11-09 06:15 -------
Created an attachment (id=7496)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7496&action=view)
Preprocessed file demonstrating the crash.

It was just 48 lines, I havent bzip'd it

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/18391] internal error: Segmentation fault for valid code segment
  2004-11-09  6:12 [Bug c++/18391] New: internal error: Segmentation fault for valid code segment asachdeva at gmail dot com
  2004-11-09  6:15 ` [Bug c++/18391] " asachdeva at gmail dot com
@ 2004-11-09  6:17 ` asachdeva at gmail dot com
  2004-11-09  6:21 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: asachdeva at gmail dot com @ 2004-11-09  6:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From asachdeva at gmail dot com  2004-11-09 06:16 -------
Created an attachment (id=7497)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7497&action=view)
when compiled with -v -save-temps


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/18391] internal error: Segmentation fault for valid code segment
  2004-11-09  6:12 [Bug c++/18391] New: internal error: Segmentation fault for valid code segment asachdeva at gmail dot com
  2004-11-09  6:15 ` [Bug c++/18391] " asachdeva at gmail dot com
  2004-11-09  6:17 ` asachdeva at gmail dot com
@ 2004-11-09  6:21 ` pinskia at gcc dot gnu dot org
  2004-11-09  6:39 ` asachdeva at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-09  6:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-09 06:20 -------
Fixed already in 3.3.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/18391] internal error: Segmentation fault for valid code segment
  2004-11-09  6:12 [Bug c++/18391] New: internal error: Segmentation fault for valid code segment asachdeva at gmail dot com
                   ` (2 preceding siblings ...)
  2004-11-09  6:21 ` pinskia at gcc dot gnu dot org
@ 2004-11-09  6:39 ` asachdeva at gmail dot com
  2004-11-09  9:26 ` asachdeva at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: asachdeva at gmail dot com @ 2004-11-09  6:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From asachdeva at gmail dot com  2004-11-09 06:39 -------
Subject: Re:  internal error: Segmentation fault for valid code segment

Was this bug filed earlier ? if yes, please send me the original bug number.

Thanks
-Arvind Sachdeva.


On 9 Nov 2004 06:20:51 -0000, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
> 
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-09 06:20 -------
> Fixed already in 3.3.
> 
> --
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>            Severity|critical                    |normal
>              Status|UNCONFIRMED                 |RESOLVED
>          Resolution|                            |FIXED
>    Target Milestone|---                         |3.3
> 
> 
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
> You are on the CC list for the bug, or are watching someone who is.
>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/18391] internal error: Segmentation fault for valid code segment
  2004-11-09  6:12 [Bug c++/18391] New: internal error: Segmentation fault for valid code segment asachdeva at gmail dot com
                   ` (3 preceding siblings ...)
  2004-11-09  6:39 ` asachdeva at gmail dot com
@ 2004-11-09  9:26 ` asachdeva at gmail dot com
  2004-11-09  9:28 ` asachdeva at gmail dot com
  2004-11-09 12:55 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: asachdeva at gmail dot com @ 2004-11-09  9:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From asachdeva at gmail dot com  2004-11-09 09:26 -------
The following code also crashes. Can somebody suggest a workaround while I am
using gcc 3.2

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

extern bool cond;

int (*funcPtr)();
#define printf 

int foobar(int foo, int bar = ((cond?funcPtr:(fprintf(stderr, "problem at
%s:%s\n", __FILE__, __LINE__), abort()))()), int foob=8);


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/18391] internal error: Segmentation fault for valid code segment
  2004-11-09  6:12 [Bug c++/18391] New: internal error: Segmentation fault for valid code segment asachdeva at gmail dot com
                   ` (4 preceding siblings ...)
  2004-11-09  9:26 ` asachdeva at gmail dot com
@ 2004-11-09  9:28 ` asachdeva at gmail dot com
  2004-11-09 12:55 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: asachdeva at gmail dot com @ 2004-11-09  9:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From asachdeva at gmail dot com  2004-11-09 09:28 -------
I am planning to use the following code as workaround, which does not crash.

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

extern bool cond;

typedef int (*FuncPtr)();

FuncPtr funcPtr;

int foobar(int foo, int bar = ((cond?funcPtr:(fprintf(stderr, "problem at
%s:%s\n", __FILE__, __LINE__), (FuncPtr)0))()), int foob=8);

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/18391] internal error: Segmentation fault for valid code segment
  2004-11-09  6:12 [Bug c++/18391] New: internal error: Segmentation fault for valid code segment asachdeva at gmail dot com
                   ` (5 preceding siblings ...)
  2004-11-09  9:28 ` asachdeva at gmail dot com
@ 2004-11-09 12:55 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-09 12:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-09 12:55 -------
3.2.x is so old and not maintained any more and ther other one is fixed also already in 3.3, I think it is 
time to update.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-11-09 12:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-09  6:12 [Bug c++/18391] New: internal error: Segmentation fault for valid code segment asachdeva at gmail dot com
2004-11-09  6:15 ` [Bug c++/18391] " asachdeva at gmail dot com
2004-11-09  6:17 ` asachdeva at gmail dot com
2004-11-09  6:21 ` pinskia at gcc dot gnu dot org
2004-11-09  6:39 ` asachdeva at gmail dot com
2004-11-09  9:26 ` asachdeva at gmail dot com
2004-11-09  9:28 ` asachdeva at gmail dot com
2004-11-09 12:55 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).