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

Memory Leak when trying to connect to Microsoft SQL Server #1148

Open
szelski opened this issue May 7, 2024 · 3 comments
Open

Memory Leak when trying to connect to Microsoft SQL Server #1148

szelski opened this issue May 7, 2024 · 3 comments
Labels
Status/Need-Feedback Need more info from OP

Comments

@szelski
Copy link

szelski commented May 7, 2024

There is a memory leak, when soci continuously tries to connect to Microsoft SQL Server, that maybe does
not even exist.
It is unclear whether it also affects other database types.

Even if cleanup methods are called properly after each connection attempt.

Can you please check it?

@vadz
Copy link
Member

vadz commented May 7, 2024

Do you know what exactly is getting leaked? E.g. a report from ASAN or whichever tool you use?

Also, please try to provide the minimum way to reproduce the problem.

@vadz vadz added the Status/Need-Feedback Need more info from OP label May 7, 2024
@szelski
Copy link
Author

szelski commented May 7, 2024

Do you know what exactly is getting leaked? E.g. a report from ASAN or whichever tool you use?

No particular Tool used. Just watched the Memory Allocation in the Task Manager over about 4 Days in multiple trial series. Till Process crashes.

Also, please try to provide the minimum way to reproduce the problem.

To reproduce:

// Call the "open" function from soci\src\core\session.cpp in your code,
// The database one wants to connect to must not to exist, so that the connection attempt fails.
try
void session::open(connection_parameters const & parameters)
catch (soci::odbc_soci_error const& e)

// Call the "close" function from soci\src\core\session.cpp to free the resources after the failed connection attempt.

void session::close()

catch (exception& ex)

// Call the "close" function from soci\src\core\session.cpp to free the resources after the failed connection attempt.

void session::close()

let the proces Run for Days (about 4) and watch how memory is allocated but not freed by the Process, till crash.

@vadz
Copy link
Member

vadz commented May 7, 2024

Sorry, but I won't be able able to run a process for 4 days to debug this. Please try to use any of the memory leak detection tools to gather more information to help fix this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status/Need-Feedback Need more info from OP
Projects
None yet
Development

No branches or pull requests

2 participants