This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/61831] [4.9/ 5 Regression] runtime error: pointer being freed was not allocated


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

--- Comment #46 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> > And I haven't looked yet at Dominique's feedback in comment #43.
>
> The test in comment #41 fails at run time when compiled with -fsanitize=address.
> If I take the "complement" of the reduced test posted in comment #43,
> everything works fine, but for one builtin_free less.
>
> I did not investigated what is wrong with the test in comment #43 (will do).

The problem occurs even with a clean tree. I have filed PR65792 for it.

The test in comment 41 runs without error if compiled with -fsanitize=address
and no valgrind error if I remove/comment the lines 58 and 62:

     tmpc = new_prt_spec2 (string_container_t(prt_in))

and

     deallocate(tmpc%comp%chars)

> The patch (without the above hunk) fixes a lot of problems and makes
> the code simpler. IMO it should be submitted and the few left issues
> can be deferred (with new PRs).

I have bootstrapper 4.9.3 with the patch and I am currently regtesting
gfortran. I am planing to do that same for 5.0.1.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]