public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "juergen.reuter at desy dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/94788] Severe regression leading to double free in tcache
Date: Mon, 27 Apr 2020 09:46:20 +0000	[thread overview]
Message-ID: <bug-94788-4-bBcL0jQUwn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94788-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Jürgen Reuter <juergen.reuter at desy dot de> ---
This is our unit test, we now confirmed that this is the only problem, so the
only failing test: it really looks like that the finalizer for the subroutine
crashes, all routines inside the subroutine get executed correctly:
  subroutine simulations_10 (u)
    integer, intent(in) :: u
    type(string_t) :: libname, procname1, expr_text
    type(rt_data_t), target :: global
    type(rt_data_t), dimension(1), target :: alt_env
    type(ifile_t) :: ifile
    type(stream_t) :: stream
    type(parse_tree_t) :: pt_weight
    type(simulation_t), target :: simulation
    type(event_sample_data_t) :: data

    write (u, "(A)")  "* Test output: simulations_10"
    write (u, "(A)")  "*   Purpose: reweight event"
    write (u, "(A)")

    write (u, "(A)")  "* Initialize processes"
    write (u, "(A)")

    call syntax_model_file_init ()
    call syntax_pexpr_init ()

    call global%global_init ()
    call global%set_log (var_str ("?omega_openmp"), &
         .false., is_known = .true.)
    call global%set_int (var_str ("seed"), &
         0, is_known = .true.)

    libname = "simulation_10a"
    procname1 = "simulation_10p"

    call prepare_test_library (global, libname, 1, [procname1])
    call compile_library (libname, global)

    call global%append_log (&
         var_str ("?rebuild_phase_space"), .true., intrinsic = .true.)
    call global%append_log (&
         var_str ("?rebuild_grids"), .true., intrinsic = .true.)
    call global%append_log (&
         var_str ("?rebuild_events"), .true., intrinsic = .true.)

    call global%set_string (var_str ("$method"), &
         var_str ("unit_test"), is_known = .true.)
    call global%set_string (var_str ("$phs_method"), &
         var_str ("single"), is_known = .true.)
    call global%set_string (var_str ("$integration_method"),&
         var_str ("midpoint"), is_known = .true.)
    call global%set_log (var_str ("?vis_history"),&
         .false., is_known = .true.)
    call global%set_log (var_str ("?integration_timer"),&
         .false., is_known = .true.)
    call global%set_log (var_str ("?recover_beams"), &
         .false., is_known = .true.)

    call global%set_real (var_str ("sqrts"),&
         1000._default, is_known = .true.)

    call global%it_list%init ([1], [1000])

    call global%set_string (var_str ("$run_id"), &
         var_str ("simulations1"), is_known = .true.)
    call integrate_process (procname1, global, local_stack=.true.)

    write (u, "(A)")  "* Initialize alternative environment with custom weight"
    write (u, "(A)")

    call alt_env(1)%local_init (global)
    call alt_env(1)%activate ()

    expr_text = "2"
    write (u, "(A,A)")  "weight = ", char (expr_text)
    write (u, *)

    call ifile_clear (ifile)
    call ifile_append (ifile, expr_text)
    call stream_init (stream, ifile)
    call parse_tree_init_expr (pt_weight, stream, .true.)
    call stream_final (stream)
    alt_env(1)%pn%weight_expr => pt_weight%get_root_ptr ()
    call alt_env(1)%write_expr (u)

    write (u, "(A)")
    write (u, "(A)")  "* Initialize event generation"
    write (u, "(A)")

    call global%set_log (var_str ("?unweighted"), &
         .false., is_known = .true.)
    call simulation%init ([procname1], .true., .true., global, alt_env=alt_env)
    call simulation%init_process_selector ()

    data = simulation%get_data ()
    call data%write (u)

    write (u, "(A)")
    write (u, "(A)")  "* Generate an event"
    write (u, "(A)")

    call simulation%generate (1)
    call simulation%write (u)

    write (u, "(A)")
    write (u, "(A)")  "* Write the event record for the last event"
    write (u, "(A)")

    call simulation%write_event (u)

    write (u, "(A)")
    write (u, "(A)")  "* Write the event record for the alternative setup"
    write (u, "(A)")

    call simulation%write_alt_event (u)

    print *, "written alt_event, starting cleanup ..."

    write (u, "(A)")
    write (u, "(A)")  "* Cleanup"

    call simulation%final ()
    print *, "simulation finalized"
    call global%final ()
    print *, "global finalized"

    call syntax_model_file_final ()
    print *, "syntax_model_file finalized"
    call syntax_pexpr_final ()
    print *, "syntax pexpr finalized"

    write (u, "(A)")
    write (u, "(A)")  "* Test output end: simulations_10"

  end subroutine simulations_10

  parent reply	other threads:[~2020-04-27  9:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27  8:38 [Bug fortran/94788] New: " juergen.reuter at desy dot de
2020-04-27  8:38 ` [Bug fortran/94788] " juergen.reuter at desy dot de
2020-04-27  9:46 ` juergen.reuter at desy dot de [this message]
2020-04-27 10:27 ` [Bug fortran/94788] [10 Regression] " rguenth at gcc dot gnu.org
2020-04-27 10:41 ` juergen.reuter at desy dot de
2020-04-27 12:19 ` juergen.reuter at desy dot de
2020-04-27 12:49 ` simon.brass at desy dot de
2020-04-27 17:09 ` simon.brass at desy dot de
2020-04-27 17:26 ` tkoenig at gcc dot gnu.org
2020-04-27 17:36 ` juergen.reuter at desy dot de
2020-04-27 18:30 ` tkoenig at gcc dot gnu.org
2020-04-27 19:26 ` juergen.reuter at desy dot de
2020-04-27 19:33 ` juergen.reuter at desy dot de
2020-04-27 20:39 ` juergen.reuter at desy dot de
2020-04-27 20:40 ` juergen.reuter at desy dot de
2020-04-27 20:40 ` juergen.reuter at desy dot de
2020-04-27 21:15 ` juergen.reuter at desy dot de
2020-04-27 21:38 ` tkoenig at gcc dot gnu.org
2020-04-27 21:51 ` cvs-commit at gcc dot gnu.org
2020-04-27 21:55 ` [Bug fortran/94788] [8/9 " tkoenig at gcc dot gnu.org
2020-04-27 22:02 ` juergen.reuter at desy dot de
2020-04-27 22:23 ` kargl at gcc dot gnu.org
2020-04-27 22:33 ` juergen.reuter at desy dot de
2020-04-28  5:57 ` tkoenig at gcc dot gnu.org
2020-04-28  8:02 ` burnus at gcc dot gnu.org
2020-04-28  8:12 ` juergen.reuter at desy dot de
2020-04-28  8:17 ` juergen.reuter at desy dot de
2020-04-28  9:13 ` tkoenig at gcc dot gnu.org
2020-04-28 11:17 ` juergen.reuter at desy dot de
2020-04-28 11:36 ` juergen.reuter at desy dot de
2020-04-28 14:06 ` juergen.reuter at desy dot de
2020-04-29  0:38 ` juergen.reuter at desy dot de
2020-04-29  9:09 ` juergen.reuter at desy dot de
2020-04-29 18:32 ` tkoenig at gcc dot gnu.org
2020-04-29 21:58 ` juergen.reuter at desy dot de
2020-04-30 16:31 ` tkoenig at gcc dot gnu.org
2020-04-30 16:35 ` juergen.reuter at desy dot de
2020-04-30 16:49 ` tkoenig at gcc dot gnu.org
2020-04-30 17:37 ` juergen.reuter at desy dot de
2020-04-30 17:38 ` juergen.reuter at desy dot de
2020-05-01 12:27 ` tkoenig at gcc dot gnu.org
2020-05-01 12:53 ` cvs-commit at gcc dot gnu.org
2020-05-01 12:55 ` cvs-commit at gcc dot gnu.org
2020-05-02 15:33 ` cvs-commit at gcc dot gnu.org
2020-05-02 19:51 ` cvs-commit at gcc dot gnu.org
2020-05-21 10:42 ` tkoenig at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94788-4-bBcL0jQUwn@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).