Skip to content

Conversation

@Biancaa-R
Copy link

@Biancaa-R Biancaa-R commented Oct 27, 2025

cleared wps_to_enable in _exit after there is no further reference to it .
The memory allocated at :
image

_exit:
	if (enable_watchpoints(target, wps_to_enable) != ERROR_OK) {
		success = false;
		LOG_TARGET_ERROR(target, "Failed to re-enable watchpoints "
				"after single-step.");
	}
	free(wps_to_enable);
	//no longer needed to be kept

Fixes the issue: #1284

  • Working on the Valgrind part ,will add soon .

Biancaa Ramesh and others added 4 commits October 27, 2025 20:27
Added additional debug logs to verify correct retrieval and printing
of progbufsize in various code paths within riscv-013.c. This helps
in debugging hardware configurations that expose custom program buffer
sizes.

Signed-off-by: Biancaa Ramesh <[email protected]>
…d-write

Added a check for have_progbuf_size before attempting to execute. This prevents program buffer access on targets
that do not support it, improving robustness and avoiding potential
execution failures when the program buffer is not available or too small.

Signed-off-by: Biancaa Ramesh <[email protected]>
Fixes a memory leak caused by wps_to_enable being allocated with calloc()
and never freed. The pointer is now properly freed at the end of the
function and on early error returns. This leak was originally introduced
in commit 5a8697b (trigger management refactor).

Signed-off-by: Biancaa Ramesh [email protected]
Signed-off-by: Biancaa Ramesh <[email protected]>
@en-sc
Copy link
Collaborator

en-sc commented Oct 27, 2025

@Biancaa-R, thank you for the patch.

Unfortunately, there is already a patch with a fix. I should have mentioned it in the issue, sorry.
See https://review.openocd.org/c/openocd/+/9163

@en-sc
Copy link
Collaborator

en-sc commented Oct 27, 2025

Working on the Valgrind part ,will add soon.

Are you referring to introducing test runs under Valgrind to the CI?

@Biancaa-R
Copy link
Author

Working on the Valgrind part ,will add soon.

Are you referring to introducing test runs under Valgrind to the CI?

Yes I am ,to ensure it is caught .

@Biancaa-R
Copy link
Author

@Biancaa-R, thank you for the patch.

Unfortunately, there is already a patch with a fix. I should have mentioned it in the issue, sorry. See https://review.openocd.org/c/openocd/+/9163

Oh no worries :)

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

Successfully merging this pull request may close these issues.

2 participants