Comments (14)
Something like;
https://github.com/servalproject/serval-dna/blob/development/rhizome_database.c#L311
- assert(!sqlite3_temp_directory);
+ if(!sqlite3_temp_directory)
https://github.com/servalproject/serval-dna/blob/development/rhizome_database.c#L488
- assert(sqlite3_temp_directory);
- sqlite3_free(sqlite3_temp_directory);
- sqlite3_temp_directory = NULL;
Though this is deliberately creating a tiny memory leak.
from batphone.
Odd, sqlite3.c seems to define that variable twice. Try;
- SQLITE_API char *sqlite3_temp_directory;
+ SQLITE_API char *sqlite3_temp_directory = 0;
from batphone.
Thank you for the quick response!
My build command is now failing with the above code in sqlite3.c
error: redefinition of 'sqlite3_temp_directory'
SQLITE_API char *sqlite3_temp_directory = 0;
For my info, when I originally cloned batphone, the build command was failing due to the libsodium.a not existing issue that was solved in #127
Android NDK: ERROR:~/batphone/app/src/main/jni/opus/Android.mk:sodium: LOCAL_SRC_FILES points to a missing file | |
---|---|
Android NDK: Check that ~/batphone/app/src/main/jni/libsodium/libsodium-android-armv7-a/lib/libsodium.a exists or that its path is correct |
However, my ndk and sdk versions are the most recent released. I think I just created libsodium.a from command terminal with gradle command which caused the build command to work.
from batphone.
Yeah I thought it was odd that the variable was defined twice. I'd suggest removing the second definition too. No idea why this has never failed for me.
from batphone.
I commented out the second definition. Build works and reinstalled onto phone. But app still stops when main menu comes up.
from batphone.
rhizome_database is a thread local value, but sqlite3_temp_directory is not. Is there something about the way you are using / have changed the application that might cause the database to be opened in multiple threads?
from batphone.
We should probably change rhizome_opendb to only set the sqlite temp folder if it has never been set, then remove the cleanup code when the database is closed.
from batphone.
Building the libsodium.a file from the command terminal is the only change I've made to the application thus far.
Okay, that sounds like a plan. I'm still new to the code though for implementing those changes.
from batphone.
To All:
I have the same problem with this project.can anyone give me some suggest??
first of all,I meet the "libsodium.a exists or that its path is correct" problem, so I build the libsodium's sh script in terminal windows,then build is OK, but running the apk have another problem,the problem is " int rhizome_opendb(): assertion "!sqlite3_temp_directory" failed"
Now, I have no idea to deal with this problem,please give me some suggest. thx very much!
from batphone.
@csam23 do you solve the problem?can you give me the method?thank you!
from batphone.
by the way,my envirment is
1、vmware with ubuntu 14.04
2、NDK 18.1.5063045
3、gradle 4.4-all
from batphone.
@lakeman thx a lot.now the project can be running, but i can't see the tiny memory leak's effect,maybe a lot of test can help me.
from batphone.
I said tiny, since the backend daemon will allocate a single string and never release it when it quits gracefully. When the backend is running within batphone, the daemon never quits.
I only mentioned it as the memory allocation will show up if anyone runs the daemon within valgrind or other automated tools that check for memory leaks.
from batphone.
Before I push a proper fix, I'll need to work out when to release that memory, since I sometimes run all of our automated tests using clang's memory leak detection. The false positives would annoy me...
from batphone.
Related Issues (20)
- incompatible API use in your code. HOT 2
- WebView disappear after pressing home button
- java.lang.UnsatisfiedLinkError: No implementation found HOT 2
- KeyringIdentity Issues
- Failing to find other Android on network HOT 1
- git submodule error HOT 1
- android studio report error HOT 2
- commandline error
- serval-dna clone error! HOT 1
- ant debug error! HOT 2
- ./gradlew assembleDebug error! HOT 1
- this is too difficult project build error!
- The development branch has bug!
- Failed to bind sockets HOT 12
- Message not send in adhoc mesh connected peers HOT 1
- Socket connection Error
- Is this dead? HOT 1
- Will this project be updated again or no? HOT 2
- Add screenshots on F-Droid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from batphone.