public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: 1008 segfaults in genattr
@ 1997-11-21 14:09 Mike Stump
  1997-11-21 21:50 ` Robert Lipe
  0 siblings, 1 reply; 47+ messages in thread
From: Mike Stump @ 1997-11-21 14:09 UTC (permalink / raw)
  To: egcs

> To: Robert Lipe <robertl@dgii.com>
> Cc: egcs@cygnus.com
> From: Jason Merrill <jason@cygnus.com>
> Date: 20 Nov 1997 22:03:51 -0800

> >>>>> Robert Lipe <robertl@dgii.com> writes:

> > 4) Make the test case call _exit() instead of exit(), but just 
> > 	let code in the field learn this the hard way.

> I think I'm going to go with #4.

I'd prefer either a fixed atexit, or if we can stick in code to the
testcase to detect infinite looping, if that is the problem, and call
abort (or _exit in that case).

The reason is that the compiler uses atexit internally by itself to
implement C++ semantics, and if it doesn't work well enough, the
semantics it presents to the user will be flawed (in my opinion).
Now, the ANSI C++ may state the users program is flawed, and it is,
they should not be calling exit from global dtors, but under the label
of quality of implementation, we have a chance to do what I think is
the right thing, and it is reasonable to have a testcase for it.

Is it sufficient to change the testcase like the below?  If it is,
then that is the solution I prefer, along with a // execution test
fails - XFAIL *-*-sco*, or whatever is needed to mark it.

// prms-id: 9732

int count;
int bail = 0;

struct base {
  base () { ++count; }
  ~base () { --count; }
  base(const base&o) { ++count; }
};

class D {
public:
  ~D() {
    if (bail++)
      {
	// On some Linux boxes, we run the dtor for d twice,
	// once before exit, and once after!
	abort ();
      }
    else
      {
	if (count != 0)
	  abort ();
	exit (0);
      }
  }
} d;

base base_object;

base base_returning_function ();

const base& base_ref = base_returning_function ();

int main () {
}

base base_returning_function () {
  base local_base_object;
  return local_base_object;
}

^ permalink raw reply	[flat|nested] 47+ messages in thread
* 1008 segfaults in genattr
@ 1997-10-09 14:56 acs
  1997-11-16 23:01 ` Jeffrey A Law
  0 siblings, 1 reply; 47+ messages in thread
From: acs @ 1997-10-09 14:56 UTC (permalink / raw)
  To: egcs

When doing 'make bootstrap' under UnixWare 2.1.2 (i386-pc-sysv4.2uw2.1.2),
with the 1008 snapshot, genattr dumps core:


...
stage1/xgcc -Bstage1/  -DIN_GCC    -O2 -g -O2  -DHAVE_CONFIG_H   -o genattr genattr.o rtl.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "stage1/xgcc -Bstage1/"@"alloca.o" in "cc"@?*) echo alloca.o ;; esac ` ` case "" in ?
*) echo  ;; esac ` 
./genattr ./config/i386/i386.md > tmp-attr.h
Abort - core dumped
make[2]: *** [stamp-attr] Error 134
make[2]: Leaving directory `/syjet/src/egcs-971008/gcc'
make[1]: *** [bootstrap] Error 2
make[1]: Leaving directory `/syjet/src/egcs-971008/gcc'
make: *** [bootstrap] Error 2

Here's a backtrace:

#0  0xbffb3783 in kill ()
#1  0xbffe3528 in abort ()
#2  0x80487be in __do_global_dtors_aux ()
#3  0x804b0d5 in _fini ()
#4  0x8048755 in _start ()


The last snapshot I built was 970910, in case that matters.

vin shelton


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

end of thread, other threads:[~1997-11-25 11:19 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-21 14:09 1008 segfaults in genattr Mike Stump
1997-11-21 21:50 ` Robert Lipe
  -- strict thread matches above, loose matches on Subject: below --
1997-10-09 14:56 acs
1997-11-16 23:01 ` Jeffrey A Law
1997-11-17  5:04   ` acs
1997-11-17  8:12     ` Jeffrey A Law
1997-11-17 12:30     ` Robert Lipe
1997-11-17  9:50       ` acs
1997-11-17 11:19         ` H.J. Lu
1997-11-17 12:30         ` Robert Lipe
1997-11-17 13:49           ` H.J. Lu
1997-11-17 14:21             ` Robert Lipe
1997-11-17 15:03               ` H.J. Lu
1997-11-18 23:29               ` Jeffrey A Law
1997-11-18 23:53                 ` Robert Lipe
1997-11-18 23:47                   ` Jeffrey A Law
1997-11-19 10:45                     ` H.J. Lu
1997-11-19 16:32                       ` Jeffrey A Law
     [not found]               ` <14025.879923259.cygnus.egcs@hurl.cygnus.com>
1997-11-19 10:41                 ` Jason Merrill
1997-11-19 21:06                   ` Jeffrey A Law
1997-11-19 22:16                   ` Robert Lipe
1997-11-20  0:22                     ` Jason Merrill
1997-11-19 23:57                       ` Robert Lipe
1997-11-20  6:22                       ` acs
1997-11-20 12:23                         ` H.J. Lu
1997-11-21 21:50                           ` Jeffrey A Law
1997-11-21 21:09                             ` H.J. Lu
1997-11-21 21:33                               ` Jeffrey A Law
1997-11-22 12:17                                 ` J. Kean Johnston
1997-11-21 21:50                             ` Robert Lipe
1997-11-21 23:31                               ` Jeffrey A Law
1997-11-21 23:31                                 ` Jason Merrill
1997-11-21 23:32                                 ` Robert Lipe
1997-11-22 22:15                             ` acs
1997-11-24  0:32                               ` Jeffrey A Law
1997-11-24 21:07                                 ` acs
1997-11-24 23:03                                   ` Robert Lipe
1997-11-25 11:19                                   ` Jeffrey A Law
     [not found]                       ` <19971120010603.06910@dgii.com>
     [not found]                         ` <u9aff0koxr.fsf@yorick.cygnus.com>
     [not found]                           ` <19971120020607.39419@dgii.com>
     [not found]                             ` <u990ukkmop.fsf@yorick.cygnus.com>
     [not found]                               ` <19971120230937.47324@dgii.com>
1997-11-20 21:44                                 ` Jason Merrill
1997-11-20 22:03                                   ` Robert Lipe
1997-11-20 22:03                                     ` Jason Merrill
1997-11-21  6:15                                       ` Robert Lipe
1997-11-21  9:15                                         ` Jeffrey A Law
     [not found]           ` <19971117162101.41289.cygnus.egcs@dgii.com>
1997-11-17 18:32             ` Jason Merrill
1997-11-17 21:11               ` Robert Lipe
1997-11-17 21:47                 ` Jason Merrill
1997-11-17 12:30         ` David McWherter

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).