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

veb: memory leak #22141

Open
esquerbatua opened this issue Aug 31, 2024 · 2 comments
Open

veb: memory leak #22141

esquerbatua opened this issue Aug 31, 2024 · 2 comments
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Unit: Memory Management Bugs/feature requests, that are related to the memory management of the compiler. Unit: veb Bugs/feature requests, that are related to the `veb`, V's official web framework.

Comments

@esquerbatua
Copy link
Contributor

esquerbatua commented Aug 31, 2024

Describe the bug

veb leaks memory, also maybe picoev

Reproduction Steps

With this code:

module main

import veb { Result }

pub struct Context {
	veb.Context
}

pub struct App {
}

fn main() {
	mut app := App{}
	veb.run_at[App, Context](mut app, veb.RunParams{
		host: '0.0.0.0'
		family: .ip
	}) or { panic(err) }
}

fn (app &App) index(mut ctx Context) Result {
	return ctx.json('')
}

compile it with: v -cg -cc gcc -keepc -gc none /home/esquerbatua/git/breakV/jsonx.v -o vebLeak
run it with: heaptrack ./vebLeak
make a few requests and close the app, then run: heaptrack --analyze <generated .zst file>

Expected Behavior

Run without any memory leak

Current Behavior

Memory leaks, even with boehm.

Possible Solution

Manual free in vlib functions of picoev and veb?

Additional Information/Context

No response

V version

V full version: V 0.4.7 01fd719.a63d349

Environment details (OS name and version, etc.)

V full version: V 0.4.7 01fd719.a63d349
OS: linux, Ubuntu 24.04.1 LTS
Processor: 16 cpus, 64bit, little endian, AMD Ryzen 7 7840HS w/ Radeon 780M Graphics

getwd: /home/esquerbatua/git/v
vexe: /home/esquerbatua/git/v/v
vexe mtime: 2024-08-31 19:03:12

vroot: OK, value: /home/esquerbatua/git/v
VMODULES: OK, value: /home/esquerbatua/.vmodules
VTMP: OK, value: /tmp/v_1000

Git version: git version 2.43.0
Git vroot status: weekly.2024.35-7-ga63d3493
.git/config present: true

CC version: cc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@esquerbatua esquerbatua added the Bug This tag is applied to issues which reports bugs. label Aug 31, 2024
@esquerbatua
Copy link
Contributor Author

esquerbatua commented Aug 31, 2024

generated C code of the example and the heaptrack file of the test
c_and_zst.zip

@spytheman spytheman added the Unit: Memory Management Bugs/feature requests, that are related to the memory management of the compiler. label Sep 5, 2024
@esquerbatua
Copy link
Contributor Author

How curious, it seems that there are no more memory leaks, I keep it open until veb parallel is complete and I check again.

@esquerbatua esquerbatua self-assigned this Sep 26, 2024
@esquerbatua esquerbatua added the Unit: veb Bugs/feature requests, that are related to the `veb`, V's official web framework. label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Unit: Memory Management Bugs/feature requests, that are related to the memory management of the compiler. Unit: veb Bugs/feature requests, that are related to the `veb`, V's official web framework.
Projects
None yet
Development

No branches or pull requests

2 participants