public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/41635]  New: inappropriate assertion that fopen succeeds
@ 2009-10-08 21:59 jsm28 at gcc dot gnu dot org
  2009-10-09  9:39 ` [Bug lto/41635] " rguenth at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-10-08 21:59 UTC (permalink / raw)
  To: gcc-bugs

As noted in my review of the LTO front end,

      resolution = fopen (resolution_file_name, "r");
      gcc_assert (resolution != NULL);

is not an appropriate use of an assertion because the fopen could
fail through system resource exhaustion even if you know the file
exists and is readable and has proper contents.  A normal error or
fatal error needs to be given instead.


-- 
           Summary: inappropriate assertion that fopen succeeds
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org


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


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

* [Bug lto/41635] inappropriate assertion that fopen succeeds
  2009-10-08 21:59 [Bug lto/41635] New: inappropriate assertion that fopen succeeds jsm28 at gcc dot gnu dot org
@ 2009-10-09  9:39 ` rguenth at gcc dot gnu dot org
  2009-10-09 13:25 ` rguenth at gcc dot gnu dot org
  2009-10-09 13:37 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-09  9:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2009-10-09 09:39 -------
Mine.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-10-09 09:39:03
               date|                            |


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


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

* [Bug lto/41635] inappropriate assertion that fopen succeeds
  2009-10-08 21:59 [Bug lto/41635] New: inappropriate assertion that fopen succeeds jsm28 at gcc dot gnu dot org
  2009-10-09  9:39 ` [Bug lto/41635] " rguenth at gcc dot gnu dot org
@ 2009-10-09 13:25 ` rguenth at gcc dot gnu dot org
  2009-10-09 13:37 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-09 13:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-10-09 13:25 -------
Subject: Bug 41635

Author: rguenth
Date: Fri Oct  9 13:24:59 2009
New Revision: 152588

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152588
Log:
2009-10-09  Richard Guenther  <rguenther@suse.de>

        PR driver/41637
        * lto-wrapper.c (ltrans_output_file, flto_out, args_name): New
        globals.
        (lto_wrapper_exit): New function.
        (fatal): Use it.
        (fatal_perror): Likewise.
        (fork_execute): Use global args_name, do not free it.
        (run_gcc): Use global ltrans_output_file, flto_out, do not free them.
        * lto-streamer.h: Remove duplicate prototypes.

        PR lto/41635
        PR lto/41636
        lto/
        * lto.c (read_cgraph_and_symbols): Do not assert we can open
        a file.
        * lto-elf.c (init_shdr##BITS): Fix i18n problems.
        (init_ehdr##BITS): Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-streamer.h
    trunk/gcc/lto-wrapper.c
    trunk/gcc/lto/ChangeLog
    trunk/gcc/lto/lto-elf.c
    trunk/gcc/lto/lto.c


-- 


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


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

* [Bug lto/41635] inappropriate assertion that fopen succeeds
  2009-10-08 21:59 [Bug lto/41635] New: inappropriate assertion that fopen succeeds jsm28 at gcc dot gnu dot org
  2009-10-09  9:39 ` [Bug lto/41635] " rguenth at gcc dot gnu dot org
  2009-10-09 13:25 ` rguenth at gcc dot gnu dot org
@ 2009-10-09 13:37 ` rguenth at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-09 13:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2009-10-09 13:36 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-10-09 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-08 21:59 [Bug lto/41635] New: inappropriate assertion that fopen succeeds jsm28 at gcc dot gnu dot org
2009-10-09  9:39 ` [Bug lto/41635] " rguenth at gcc dot gnu dot org
2009-10-09 13:25 ` rguenth at gcc dot gnu dot org
2009-10-09 13:37 ` rguenth 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).