[Bug fortran/67567] resolve.c: gfc_error called with iface->module == NULL

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Sep 14 10:14:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67567

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-09-14
                 CC|                            |manu at gcc dot gnu.org
            Summary|pretty-print.h sanitizer    |resolve.c: gfc_error called
                   |detects NULL pointer passed |with iface->module == NULL
                   |to obstack_grow             |
     Ever confirmed|0                           |1

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Vittorio Zecca from comment #0)
> but I believe it best to fix it by prefixing the statement with "if(length)"

That would hide the real bug, which is that:

          gfc_error ("%s between the MODULE PROCEDURE declaration "
                     "in module %s and the declaration at %L in "
                     "SUBMODULE %s", errmsg, iface->module,
                     &sym->declared_at, sym->ns->proc_name->name);

is called with iface->module == NULL.

(I think you are doing a nice job at finding and reporting all these sanitizer
issues, but it would be better to figure out the real causes in order to
implement the best solution, and for that you need to master GDB. Otherwise,
developers eager to close as many issues as fast as possible may end up slowing
down the compiler with unnecessary checks while hiding real bugs).


More information about the Gcc-bugs mailing list