public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/51662] New: Temporary objects gets garbage collected in cc1
@ 2011-12-23 10:35 max at duempel dot org
  2011-12-23 10:41 ` [Bug other/51662] " max at duempel dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: max at duempel dot org @ 2011-12-23 10:35 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51662
           Summary: Temporary objects gets garbage collected in cc1
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: max@duempel.org


Created attachment 26170
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26170
Workaround

After rebasing cegcc/mingw32ce on gcc 4.6.2, I found cc1 crashing.
locate_fn_flags() creates an object "ob" that is not yet inserted into the root
tree, and lookup_fnfields() eventually causes a garbage collection. This may
kill the page where "ob" lives in, causing a segmentation fault.

I found a kludge to work around it: I increase function_depth to inhibit
garbage collection. See attached patch.

Another idea would be to call lookup_fnfields() before allocating "ob", but
since I don't know the code base, I don't know if this is safe.

Also note that this may or may not be caused / triggered by cegcc specific
patches. Just in case you want to review these:
http://git.xcsoar.org/cgit/max/cegcc-gcc.git/log/?h=ice


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

* [Bug other/51662] Temporary objects gets garbage collected in cc1
  2011-12-23 10:35 [Bug other/51662] New: Temporary objects gets garbage collected in cc1 max at duempel dot org
@ 2011-12-23 10:41 ` max at duempel dot org
  2011-12-23 19:15 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: max at duempel dot org @ 2011-12-23 10:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Max Kellermann <max at duempel dot org> 2011-12-23 10:34:50 UTC ---
Created attachment 26171
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26171
Backtrace of garbage collector; #19 is the allocation


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

* [Bug other/51662] Temporary objects gets garbage collected in cc1
  2011-12-23 10:35 [Bug other/51662] New: Temporary objects gets garbage collected in cc1 max at duempel dot org
  2011-12-23 10:41 ` [Bug other/51662] " max at duempel dot org
@ 2011-12-23 19:15 ` pinskia at gcc dot gnu.org
  2011-12-30  6:34 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-23 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-23 19:02:55 UTC ---
Can you attach the testcase?


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

* [Bug other/51662] Temporary objects gets garbage collected in cc1
  2011-12-23 10:35 [Bug other/51662] New: Temporary objects gets garbage collected in cc1 max at duempel dot org
  2011-12-23 10:41 ` [Bug other/51662] " max at duempel dot org
  2011-12-23 19:15 ` pinskia at gcc dot gnu.org
@ 2011-12-30  6:34 ` pinskia at gcc dot gnu.org
  2012-07-30 23:25 ` steven at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-30  6:34 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011-12-30
     Ever Confirmed|0                           |1

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-30 06:31:55 UTC ---
Waiting for a testcase.


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

* [Bug other/51662] Temporary objects gets garbage collected in cc1
  2011-12-23 10:35 [Bug other/51662] New: Temporary objects gets garbage collected in cc1 max at duempel dot org
                   ` (2 preceding siblings ...)
  2011-12-30  6:34 ` pinskia at gcc dot gnu.org
@ 2012-07-30 23:25 ` steven at gcc dot gnu.org
  2012-07-31  0:59 ` [Bug c++/51662] Temporary objects gets garbage collected in cc1plus jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu.org @ 2012-07-30 23:25 UTC (permalink / raw)
  To: gcc-bugs

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

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #4 from Steven Bosscher <steven at gcc dot gnu.org> 2012-07-30 23:25:09 UTC ---
>From the backtrace, this looks like a real bug. A test case would still be much
appreciated, but someone familiar with G++ can probably construct something and
trigger the bug with a GCAC-enabled compiler. Adding Jason to CC: for that.


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

* [Bug c++/51662] Temporary objects gets garbage collected in cc1plus
  2011-12-23 10:35 [Bug other/51662] New: Temporary objects gets garbage collected in cc1 max at duempel dot org
                   ` (3 preceding siblings ...)
  2012-07-30 23:25 ` steven at gcc dot gnu.org
@ 2012-07-31  0:59 ` jason at gcc dot gnu.org
  2012-09-13 14:53 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-07-31  0:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-07-31 00:58:50 UTC ---
Created attachment 27902
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27902
Fix?

Does this fix the bug?  The call to instantiate_decl was removed for 4.7, so
this issue should only affect 4.6.


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

* [Bug c++/51662] Temporary objects gets garbage collected in cc1plus
  2011-12-23 10:35 [Bug other/51662] New: Temporary objects gets garbage collected in cc1 max at duempel dot org
                   ` (4 preceding siblings ...)
  2012-07-31  0:59 ` [Bug c++/51662] Temporary objects gets garbage collected in cc1plus jason at gcc dot gnu.org
@ 2012-09-13 14:53 ` jason at gcc dot gnu.org
  2012-11-29 21:58 ` jason at gcc dot gnu.org
  2012-11-29 22:08 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-13 14:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-13 14:52:42 UTC ---
Have you had a chance to test the fix?


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

* [Bug c++/51662] Temporary objects gets garbage collected in cc1plus
  2011-12-23 10:35 [Bug other/51662] New: Temporary objects gets garbage collected in cc1 max at duempel dot org
                   ` (5 preceding siblings ...)
  2012-09-13 14:53 ` jason at gcc dot gnu.org
@ 2012-11-29 21:58 ` jason at gcc dot gnu.org
  2012-11-29 22:08 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-11-29 21:58 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-11-29 21:58:10 UTC ---
Author: jason
Date: Thu Nov 29 21:58:04 2012
New Revision: 193969

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193969
Log:
    PR c++/51662
    * method.c (process_subob_fn): Increment function_depth around call to
    instantiate_decl.

Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/method.c


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

* [Bug c++/51662] Temporary objects gets garbage collected in cc1plus
  2011-12-23 10:35 [Bug other/51662] New: Temporary objects gets garbage collected in cc1 max at duempel dot org
                   ` (6 preceding siblings ...)
  2012-11-29 21:58 ` jason at gcc dot gnu.org
@ 2012-11-29 22:08 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-11-29 22:08 UTC (permalink / raw)
  To: gcc-bugs


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.6.4

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2012-11-29 22:08:02 UTC ---
I went ahead and checked in the patch.


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

end of thread, other threads:[~2012-11-29 22:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-23 10:35 [Bug other/51662] New: Temporary objects gets garbage collected in cc1 max at duempel dot org
2011-12-23 10:41 ` [Bug other/51662] " max at duempel dot org
2011-12-23 19:15 ` pinskia at gcc dot gnu.org
2011-12-30  6:34 ` pinskia at gcc dot gnu.org
2012-07-30 23:25 ` steven at gcc dot gnu.org
2012-07-31  0:59 ` [Bug c++/51662] Temporary objects gets garbage collected in cc1plus jason at gcc dot gnu.org
2012-09-13 14:53 ` jason at gcc dot gnu.org
2012-11-29 21:58 ` jason at gcc dot gnu.org
2012-11-29 22:08 ` jason at gcc dot gnu.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).