-
-
Notifications
You must be signed in to change notification settings - Fork 322
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
storage.backup_to(filename) crashes in backup_tests.cpp #540
Comments
The cultrip is found in sqlite_orm.h method
The correct solutions are:
This solves this issue and I bet some others!! |
@juandent what branch? |
master |
the problem is that move(holder) is done before connection_ref{*holder}, thus passing a nullptr to connection_ref |
this happens because the order of the data members in the class backup_t moves holder first making it empty...
|
@juandent ok thank you. I cannot reproduce it. But I think the reason is that the order of expression evaluation is not determined before C++17. Anyway I shall apply your fix and merge it soon |
The fix is here #542 |
@juandent please help me. Some builds failed https://travis-ci.org/github/fnc12/sqlite_orm/jobs/704755026 and I cannot reproduce it with Xcode. Looks like exact error you showed here before. Also it turned out that |
although the order of operations in an expression was (before C++ 17) unpredictable, the order of initialization of the non-static data members of a class/struct is and has always been deterministic: they are initialized in the exact order they appear in the class -- however not the order they appear in the constructors because they could have different orders. Thus backup_t should declare its non-static data members in the following order to avoid passing an empty holder:
Holder must be the last!! Tell me if this helps you - it should!! Regards, |
internal::storage_base::make_backup_to should have this code:
|
sorry I was away from my computer - did this help any? |
Thank you for your suggestions. I applied them a minute ago and now we need to wait until unit tests are finished on travis and appveyor. I can take up to 2 hours. |
how are you doing ? what happened with the builds? |
same thing. Windows - https://ci.appveyor.com/project/fnc12/sqlite-orm/builds/33905319/job/pa4q8wk57q8kv22e |
@juandent what OS and compiler do you use? |
I use Windows 10 Pro and Visual Studio 2019 Version 16.6.3
And I compile with C++ 17 support which is very good in VS
Are you still having problems? Can I help you?
How can I help?
Regards,
Juan Dent
From: Yevgeniy Zakharov <[email protected]>
Sent: Saturday, July 4, 2020 12:57 PM
To: fnc12/sqlite_orm <[email protected]>
Cc: juandent <[email protected]>; Mention <[email protected]>
Subject: Re: [fnc12/sqlite_orm] storage.backup_to(filename) crashes in backup_tests.cpp (#540)
@juandent <https://github.com/juandent> what OS and compiler do you use?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#540 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABI6OFN2TSOHWMWDD4ZRGMDRZ53PFANCNFSM4OPLNGAQ> . <https://github.com/notifications/beacon/ABI6OFL4SPPWA2DZ6RQUTATRZ53PFA5CNFSM4OPLNGA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE34DDKY.gif>
|
why don't you install a VMWARE virtual system with Windows and install the (free ) Visual Studio 2019? |
Good news: I am able to reproduce it with VS on Win10 (on virtual machine). |
Ok I fixed windows but mac fails tests. SEGFAULT doesn't happen now. |
which requiere is failing? |
https://travis-ci.org/github/fnc12/sqlite_orm/jobs/705096749 |
Ok I merge the PR cause the issue is not related to this PR |
merged. Please check out |
is the issue actual? |
How do I download the dev branch? I am not too proficient with git yet... When I run CMAKE I get this error:
Could not find a package configuration file provided by "Catch2" with any
Add the installation prefix of "Catch2" to CMAKE_PREFIX_PATH or set and I downloade Catch2 but it does not come with Catch2Config.cmake (instead it comes with Catch2Config.cmake.in) So I am stuck. Regards, |
you need to install |
closing this issue cause it is fixed. @juandent is you have issues with |
TEST_CASE("backup") in backup_tests.cpp calls retain (see below) with this == nullptr.
First it calls:
What is happening?
Regards,
Juan
The text was updated successfully, but these errors were encountered: