Comments (10)
It's not clear what this issue is about. Could you clarify?
from mailcore2.
Set a breakpoint in fillWithInfo()
and you can see that all of the objectForKey()
calls are failing because MCSTR() does "" "str" ""
instead of "str"
from mailcore2.
When you're talking about code, it's more clear if you reference which file to look into. fillWithInfo() name is used at several locations.
Regarding the issue itself:
I don't think that's the reason of your issue. Keep investigating about your specific issue.
If MCSTR() was really broken, it would fail everywhere.
MCSTR() does "" str "", which concatenate an empty string with str with an empty string.
It makes sure that str is a constant.
from mailcore2.
Reopen if that's really the issue and give more details.
from mailcore2.
But it fails specifically for the providers dictionary because the JSON keys aren't made with MCSTR(), they're just parsed out into it. It works everywhere else because everywhere else uses MCSTR().
Here, these lines fail for every provider HashMap given to them:
https://github.com/MailCore/mailcore2/blob/master/src/core/provider/MCMailProvider.cc#L62
https://github.com/MailCore/mailcore2/blob/master/src/core/provider/MCMailProvider.cc#L66
And because they fail, every one of the folder lookup methods afterwards dereferences a NULL pointer and causes a fatal crash.
from mailcore2.
If I replace those MCSTR()
's with mailcore::String::stringWithUTF8Format()
it works like a charm.
from mailcore2.
Therefore, that's an issue with String::uniquedStringWithUTF8Characters().
Do you have a minimal code that reproduces the issue?
Could you try to apply that patch?
diff --git a/src/core/basetypes/MCString.cc b/src/core/basetypes/MCString.cc
index 6710e59..2398958 100644
--- a/src/core/basetypes/MCString.cc
+++ b/src/core/basetypes/MCString.cc
@@ -1975,6 +1975,7 @@ String * String::substringWithRange(Range range)
}
static chash * uniquedStringHash = NULL;
+static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static void initUniquedStringHash()
{
@@ -1991,14 +1992,17 @@ String * String::uniquedStringWithUTF8Characters(const char * UTF8Characters)
pthread_once(&once, initUniquedStringHash);
key.data = (void *) UTF8Characters;
key.len = (unsigned int) strlen(UTF8Characters);
- pthread_mutex_lock(&lock);
r = chash_get(uniquedStringHash, &key, &value);
if (r == 0) { -
}
pthread_mutex_unlock(&lock); return (String *) value.data;
else {
value.data = new String(UTF8Characters);
value.len = 0;
chash_set(uniquedStringHash, &key, &value, NULL); -
}
pthread_mutex_unlock(&lock); return (String *) value.data;
}
from mailcore2.
Patch not broken by formatting is here:
https://gist.github.com/dinhviethoa/5692527
Let me know if it solves your issue.
from mailcore2.
Yep, that patch solves it. Sorry I couldn't answer you earlier, I was integrating the framework and had to fix a ton of warnings before I could test anything.
from mailcore2.
Fixed with b88d4be
from mailcore2.
Related Issues (20)
- Concurrency - overall ability to send multiple mails in a faster pace.
- swift package from master branch is crashing HOT 1
- [Qequstion] - In mailCore2, use the following code to access email 163,How to do in mailCore1.0? HOT 2
- [Bug] - Android Build failed HOT 2
- Error when installing mailcore2-ios using CocoaPods HOT 5
- Need amd64 target for Swift Package and Cocoapod HOT 2
- [Bug] - iOS app crash HOT 23
- [Bug] - iOS: Thread not released by IMAP Session (each session allocates 560KB = standard thread side) HOT 4
- [Bug] - Building on Linux fedora HOT 1
- [Bug] - Check connection is not printing any output HOT 2
- [Bug] - Archive Failed in build-mailcore2-xcframework-spm.sh HOT 1
- [Bug] - Kelvin John
- [Bug] - Austin's <android>
- [Bug] - HOT 1
- [Bug] - App Crash on 'fetchMessagesByUIDOperationWithFolder:requestKind:uids: HOT 1
- [Bug] - 'libetpan/libetpan.h' file not found in iOS project
- [Question] - TLS version?
- Having issues adding MailCore2 via SPM to iOS project
- [Bug] - Unknown mailsmtp error 27 (SSL Error) when adding IMAP/SMTP account HOT 2
- [Bug] - An error was reported when pulling and receiving INBOX -- βError Domain=MCOErrorDomain Code=3 "Unable to parse response from server." UserInfo={NSLocalizedDescription=Unable to parse response from server.} β HOT 1
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 mailcore2.