Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dangling pointer referenced in dbcsr_mm_multrec.F #447

Open
vzecca opened this issue May 4, 2021 · 0 comments
Open

Dangling pointer referenced in dbcsr_mm_multrec.F #447

vzecca opened this issue May 4, 2021 · 0 comments
Milestone

Comments

@vzecca
Copy link

vzecca commented May 4, 2021

Running many test cases of cp2k, among them xTB/regtest-3/h2o_rtp.inp, in dbcsr_mm_multrec.F line 518

CALL dbcsr_mm_csr_multiply(this%csr, left, right, &
...
use_eps=this%use_eps, row_max_epss=this%row_max_epss, &

the dangling pointer this%row_max_epss is referenced.

The pointer was returned by the procedure dbcsr_mm_multrec_init.
I think this is because inside the procedure at line 232 the following instruction

this%row_max_epss => row_max_epss

pointing to a local pointer, makes it dangling at procedure exit.
This pointer assignment should be executed outside the procedure, as in

if(multrec(ithread)%p%use_eps) multrec(ithread)%p%row_max_epss=>row_max_epss

after row_max_epss is declared TARGET

@alazzaro alazzaro added this to the v2.2 milestone Sep 14, 2021
@hfp hfp modified the milestones: v2.2, v2.3 Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants