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

DDXMLNode crash (compactXMLString -> XMLStringWithOptions) #105

Open
vladimirkolbas opened this issue Jun 26, 2018 · 2 comments · May be fixed by robbiehanson/XMPPFramework#1232
Open

DDXMLNode crash (compactXMLString -> XMLStringWithOptions) #105

vladimirkolbas opened this issue Jun 26, 2018 · 2 comments · May be fixed by robbiehanson/XMPPFramework#1232

Comments

@vladimirkolbas
Copy link

We're seing a crash that isn't manually reproducible, but does occur somewhat frequently reported by Fabric (so guessing it's easier to trigger in release mode with optimizations).

File involved is DDXMLNode.m, line 1187:

CFStringTrimWhitespace((__bridge CFMutableStringRef)xmlString);
crashing with

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000

We believe it's occuring when sending an initial presence to the stream

xmppStream.send(XMPPPresence())

We're guessing the allocated XMPPresence goes out of scope and in some cases accessing the pointer will lead to accessing the deallocated memory.

We've just tried assigning the sent presence to a local variable to keep it alive for a longer time to see if that will solve the problem, but will need more time to see if the number of crashes decreases or drops to zero.

We believe the sent stanza is similar to this one, looks valid:

<presence><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="https://github.com/robbiehanson/XMPPFramework" ver="HmCrMVXR466Cmi5/TS/7FP+cYrE="></c><x xmlns="vcard-temp:x:update"><photo>f4c1fc071a8a13571cf32cdc3fd52a606544495e</photo></x></presence>

Do you have any better suggenstions how to evade this crash?

Screenshot of the log from Fabric attached below:

screen shot 2018-06-26 at 10 44 54

@yxzhaoo
Copy link

yxzhaoo commented Nov 7, 2018

@vladimirkolbas Hi bro. I have encountered the same problem in my project. Does your problem have been fixed by the above solution?

@vladimirkolbas
Copy link
Author

@zyx449678686 Hey, sorry for the late reply, missed your comment.
Can't say for sure as I've seen several crashes since, but only a few. Used to be a much bigger number before, so it's a big improvement if not a complete fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants