From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8072 invoked by alias); 26 Sep 2010 03:33:16 -0000 Received: (qmail 8062 invoked by uid 22791); 26 Sep 2010 03:33:16 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20,MISSING_MID,TW_JV X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 26 Sep 2010 03:33:11 +0000 From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/45793] [4.6 Regressions] Numerous test-suite failures X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sun, 26 Sep 2010 10:27:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-09/txt/msg02817.txt.bz2 Message-ID: <20100926102700.vt-jK179eaMMVcogdnjhbmrjOIwtqFrh94pL48ZyWUc@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45793 --- Comment #4 from Jerry DeLisle 2010-09-26 03:33:09 UTC --- This is the same location I was seeing the failure before. Now I have no segfault, but valgind shows: ==17145== 48 (32 direct, 16 indirect) bytes in 2 blocks are definitely lost in loss record 48 of 459 ==17145== at 0x4A0515D: malloc (vg_replace_malloc.c:195) ==17145== by 0xCCBB27: xmalloc (xmalloc.c:147) ==17145== by 0x4F4504: gfc_getmem (misc.c:37) ==17145== by 0x4F6E0A: create_int_parameter_array.constprop.22 (module.c:5345) ==17145== by 0x4F7629: use_iso_fortran_env_module (iso-fortran-env.def:91) ==17145== by 0x4FBA2E: gfc_use_module (module.c:5541) ==17145== by 0x4FFCF4: accept_statement (parse.c:1574) ==17145== by 0x502A8A: parse_spec (parse.c:2588) ==17145== by 0x504818: parse_progunit (parse.c:3922) ==17145== by 0x50560B: gfc_parse_file (parse.c:4329) ==17145== by 0x53CBF7: gfc_be_parse_file (f95-lang.c:242) ==17145== by 0x83329F: toplev_main (toplev.c:955) ==17145== Look at the code. e is declared in the function as typr gfc_expr * Unfortunately no pointer is ever allocated for it. It is just luck that it is not segfaulting! static void create_int_parameter_array (const char *name, int size, gfc_expr *value, const char *modname, intmod_id module, int id) { gfc_symtree *tmp_symtree; gfc_symbol *sym; gfc_expr *e; tmp_symtree = gfc_find_symtree (gfc_current_ns->sym_root, name); if (tmp_symtree != NULL) { if (strcmp (modname, tmp_symtree->n.sym->module) == 0) return; else gfc_error ("Symbol '%s' already declared", name); } gfc_get_sym_tree (name, gfc_current_ns, &tmp_symtree, false); sym = tmp_symtree->n.sym; sym->module = gfc_get_string (modname); sym->attr.flavor = FL_PARAMETER; sym->ts.type = BT_INTEGER; sym->ts.kind = gfc_default_integer_kind; sym->attr.use_assoc = 1; sym->from_intmod = module; sym->intmod_sym_id = id; sym->attr.dimension = 1; sym->as = gfc_get_array_spec (); sym->as->rank = 1; sym->as->type = AS_EXPLICIT; sym->as->lower[0] = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1); sym->as->upper[0] = gfc_get_int_expr (gfc_default_integer_kind, NULL, size); sym->value = value; e->shape = gfc_get_shape (1); mpz_init_set_ui (e->shape[0], size); }