drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.52k stars 1.1k forks source link

SQLite3 support: "ATTACH DATABASE ..." Causes SIGSEGV #2134

Open odoriath-neo opened 2 months ago

odoriath-neo commented 2 months ago

Describe the bug As the title suggests, trying to run "ATTACH DATABASE '/folder/filename.db' AS NAME;" with execSqlSync() will SIGSEGV almost immediately.

To Reproduce Steps to reproduce the behavior:

  1. In my case, I have a websocket drogon app (the only requirement might be to use a SQLite3 db pointer)
  2. Create a new SQLite3 client.
  3. Run exampleDbPtr->execSqlSync("ATTACH DATABASE '/folder/filename.db' AS NAME;"); with an existing file.
  4. Attempting to create a table in the attached db will now give an error that says terminated by signal SIGSEGV (Address boundary error)

Expected behavior ATTACH DATABASE should not SIGSEGV

Desktop (please complete the following information):

an-tao commented 2 months ago

Why not use the database filename to create the dbClient?

odoriath-neo commented 2 months ago

Why not use the database filename to create the dbClient?

Thank you for the reply! The issue was on my end! And it's just a quicker way to copy over entries for backup purposes than using two dbClients (afaik). This issue can be closed!

The issue was (I think) related to the size of the path or the reachability of the path for the db file. Not certain yet, but if anyone finds this with the same issue, I hope it helps!