How do I interpret iOS EXC_BREAKPOINT crash report?
I have an iOS App that crashes with certain users. I can't recreate the crash however I do have three identical crash reports. How can I figure out what is causing the crash? (I've looked at https://developer.apple.com/videos/play/wwdc2018/414/ but am still having difficulties.)
Exerpt from the crash report is as follows:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000100fd21ac
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [5535]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libswiftCore.dylib 0x0000000100fd21ac 0x100de0000 + 2040236
1 libswiftCore.dylib 0x0000000100fd21ac 0x100de0000 + 2040236
2 libswiftCore.dylib 0x0000000101027c50 0x100de0000 + 2391120
3 MyApp 0x000000010081af08 partial apply for closure #3 in DefaultService.processPosts(network:posts:completion:) + 40 (DefaultService.swift:1009)
4 MyApp 0x000000010087060c thunk for @escaping @callee_guaranteed () -> () + 36 (<compiler-generated>:0)
5 libdispatch.dylib 0x000000021aeb96c8 _dispatch_call_block_and_release + 24 (init.c:1372)
6 libdispatch.dylib 0x000000021aeba484 _dispatch_client_callout + 16 (object.m:511)
The code that seems to be causing the problem DefaultService.swift:1009
in processPosts
is as follows:
private func processPosts(network: Network, posts: [Post], completion: @escaping (Result<Void>) -> Void) {
...
dg.notify(queue: .main) {
self.savePosts(network: network, posts: posts) // This is line 1009.
completion(.success(()))
}
}
private func savePosts(network: Network, posts: [Post]) {
let context = self.container().viewContext
for post in posts {
// Don't save if already saved.
if isPostSaved(context: context, network: network,
networkPostID: post.networkPostID!) {
continue
}
let np = NetworkPost(context: context)
np.id = post.id
np.network = network.rawValue
np.networkPostID = post.networkPostID
np.subtitle = post.subtitle
np.text = post.text
for image in post.images {
let npImage = NetworkPostImage(context: context)
npImage.data = image
np.addToImages(npImage)
}
if let active = post.active {
np.active = active
}
np.created = post.created
}
try! context.save()
}
private func isPostSaved(context: NSManagedObjectContext, network: Network, networkPostID: String) -> Bool {
let fetchRequest = NSFetchRequest<NetworkPost>(entityName: "NetworkPost")
let format = "(network == %@) AND (networkPostID == %@)"
fetchRequest.predicate = NSPredicate(format: format,
network.rawValue,
networkPostID)
let posts = try! context.fetch(fetchRequest)
return !posts.isEmpty
}
Is it likely that one of my try!
calls in either savePosts
or isPostSaved
is the culprit causing an EXC_BREAKPOINT
?
If so how can I narrow down which one it is? Is there any way of using the first three libswiftCore.dylib
calls of the backtrace to figure it out?
If not the try!
calls then what else could be causing the EXEC_BREAKPOINT
error?
Note that I am using the CoreData API in memory only mode so I expect my try! context.save()
and try! context.fetch(fetchRequest)
calls to execute unless there is something seriously wrong or I have a programming error. This is why I use try!
instead of do { } catch { }
.
ios swift xcode crash-reports
add a comment |
I have an iOS App that crashes with certain users. I can't recreate the crash however I do have three identical crash reports. How can I figure out what is causing the crash? (I've looked at https://developer.apple.com/videos/play/wwdc2018/414/ but am still having difficulties.)
Exerpt from the crash report is as follows:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000100fd21ac
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [5535]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libswiftCore.dylib 0x0000000100fd21ac 0x100de0000 + 2040236
1 libswiftCore.dylib 0x0000000100fd21ac 0x100de0000 + 2040236
2 libswiftCore.dylib 0x0000000101027c50 0x100de0000 + 2391120
3 MyApp 0x000000010081af08 partial apply for closure #3 in DefaultService.processPosts(network:posts:completion:) + 40 (DefaultService.swift:1009)
4 MyApp 0x000000010087060c thunk for @escaping @callee_guaranteed () -> () + 36 (<compiler-generated>:0)
5 libdispatch.dylib 0x000000021aeb96c8 _dispatch_call_block_and_release + 24 (init.c:1372)
6 libdispatch.dylib 0x000000021aeba484 _dispatch_client_callout + 16 (object.m:511)
The code that seems to be causing the problem DefaultService.swift:1009
in processPosts
is as follows:
private func processPosts(network: Network, posts: [Post], completion: @escaping (Result<Void>) -> Void) {
...
dg.notify(queue: .main) {
self.savePosts(network: network, posts: posts) // This is line 1009.
completion(.success(()))
}
}
private func savePosts(network: Network, posts: [Post]) {
let context = self.container().viewContext
for post in posts {
// Don't save if already saved.
if isPostSaved(context: context, network: network,
networkPostID: post.networkPostID!) {
continue
}
let np = NetworkPost(context: context)
np.id = post.id
np.network = network.rawValue
np.networkPostID = post.networkPostID
np.subtitle = post.subtitle
np.text = post.text
for image in post.images {
let npImage = NetworkPostImage(context: context)
npImage.data = image
np.addToImages(npImage)
}
if let active = post.active {
np.active = active
}
np.created = post.created
}
try! context.save()
}
private func isPostSaved(context: NSManagedObjectContext, network: Network, networkPostID: String) -> Bool {
let fetchRequest = NSFetchRequest<NetworkPost>(entityName: "NetworkPost")
let format = "(network == %@) AND (networkPostID == %@)"
fetchRequest.predicate = NSPredicate(format: format,
network.rawValue,
networkPostID)
let posts = try! context.fetch(fetchRequest)
return !posts.isEmpty
}
Is it likely that one of my try!
calls in either savePosts
or isPostSaved
is the culprit causing an EXC_BREAKPOINT
?
If so how can I narrow down which one it is? Is there any way of using the first three libswiftCore.dylib
calls of the backtrace to figure it out?
If not the try!
calls then what else could be causing the EXEC_BREAKPOINT
error?
Note that I am using the CoreData API in memory only mode so I expect my try! context.save()
and try! context.fetch(fetchRequest)
calls to execute unless there is something seriously wrong or I have a programming error. This is why I use try!
instead of do { } catch { }
.
ios swift xcode crash-reports
1
Before interpreting crash reports I recommend to usedo-catch
blocks and interpret the error.
– vadian
Nov 12 '18 at 12:17
I could and probably will end up doing that if this question comes to nothing. However, I can't recreate the error and have no access to the affected users. There's also no guarantee the affected users will use my app again with it continually crashing so I was hoping to give myself the best opportunity to fix the issue first time.
– Dan
Nov 12 '18 at 12:54
After further investigation the EXC_BREAKPOINT was coming fromtry! context.save()
having a validation error. I would still like to know how I could have inferred that from the crash report.
– Dan
Nov 15 '18 at 10:07
add a comment |
I have an iOS App that crashes with certain users. I can't recreate the crash however I do have three identical crash reports. How can I figure out what is causing the crash? (I've looked at https://developer.apple.com/videos/play/wwdc2018/414/ but am still having difficulties.)
Exerpt from the crash report is as follows:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000100fd21ac
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [5535]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libswiftCore.dylib 0x0000000100fd21ac 0x100de0000 + 2040236
1 libswiftCore.dylib 0x0000000100fd21ac 0x100de0000 + 2040236
2 libswiftCore.dylib 0x0000000101027c50 0x100de0000 + 2391120
3 MyApp 0x000000010081af08 partial apply for closure #3 in DefaultService.processPosts(network:posts:completion:) + 40 (DefaultService.swift:1009)
4 MyApp 0x000000010087060c thunk for @escaping @callee_guaranteed () -> () + 36 (<compiler-generated>:0)
5 libdispatch.dylib 0x000000021aeb96c8 _dispatch_call_block_and_release + 24 (init.c:1372)
6 libdispatch.dylib 0x000000021aeba484 _dispatch_client_callout + 16 (object.m:511)
The code that seems to be causing the problem DefaultService.swift:1009
in processPosts
is as follows:
private func processPosts(network: Network, posts: [Post], completion: @escaping (Result<Void>) -> Void) {
...
dg.notify(queue: .main) {
self.savePosts(network: network, posts: posts) // This is line 1009.
completion(.success(()))
}
}
private func savePosts(network: Network, posts: [Post]) {
let context = self.container().viewContext
for post in posts {
// Don't save if already saved.
if isPostSaved(context: context, network: network,
networkPostID: post.networkPostID!) {
continue
}
let np = NetworkPost(context: context)
np.id = post.id
np.network = network.rawValue
np.networkPostID = post.networkPostID
np.subtitle = post.subtitle
np.text = post.text
for image in post.images {
let npImage = NetworkPostImage(context: context)
npImage.data = image
np.addToImages(npImage)
}
if let active = post.active {
np.active = active
}
np.created = post.created
}
try! context.save()
}
private func isPostSaved(context: NSManagedObjectContext, network: Network, networkPostID: String) -> Bool {
let fetchRequest = NSFetchRequest<NetworkPost>(entityName: "NetworkPost")
let format = "(network == %@) AND (networkPostID == %@)"
fetchRequest.predicate = NSPredicate(format: format,
network.rawValue,
networkPostID)
let posts = try! context.fetch(fetchRequest)
return !posts.isEmpty
}
Is it likely that one of my try!
calls in either savePosts
or isPostSaved
is the culprit causing an EXC_BREAKPOINT
?
If so how can I narrow down which one it is? Is there any way of using the first three libswiftCore.dylib
calls of the backtrace to figure it out?
If not the try!
calls then what else could be causing the EXEC_BREAKPOINT
error?
Note that I am using the CoreData API in memory only mode so I expect my try! context.save()
and try! context.fetch(fetchRequest)
calls to execute unless there is something seriously wrong or I have a programming error. This is why I use try!
instead of do { } catch { }
.
ios swift xcode crash-reports
I have an iOS App that crashes with certain users. I can't recreate the crash however I do have three identical crash reports. How can I figure out what is causing the crash? (I've looked at https://developer.apple.com/videos/play/wwdc2018/414/ but am still having difficulties.)
Exerpt from the crash report is as follows:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000100fd21ac
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [5535]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libswiftCore.dylib 0x0000000100fd21ac 0x100de0000 + 2040236
1 libswiftCore.dylib 0x0000000100fd21ac 0x100de0000 + 2040236
2 libswiftCore.dylib 0x0000000101027c50 0x100de0000 + 2391120
3 MyApp 0x000000010081af08 partial apply for closure #3 in DefaultService.processPosts(network:posts:completion:) + 40 (DefaultService.swift:1009)
4 MyApp 0x000000010087060c thunk for @escaping @callee_guaranteed () -> () + 36 (<compiler-generated>:0)
5 libdispatch.dylib 0x000000021aeb96c8 _dispatch_call_block_and_release + 24 (init.c:1372)
6 libdispatch.dylib 0x000000021aeba484 _dispatch_client_callout + 16 (object.m:511)
The code that seems to be causing the problem DefaultService.swift:1009
in processPosts
is as follows:
private func processPosts(network: Network, posts: [Post], completion: @escaping (Result<Void>) -> Void) {
...
dg.notify(queue: .main) {
self.savePosts(network: network, posts: posts) // This is line 1009.
completion(.success(()))
}
}
private func savePosts(network: Network, posts: [Post]) {
let context = self.container().viewContext
for post in posts {
// Don't save if already saved.
if isPostSaved(context: context, network: network,
networkPostID: post.networkPostID!) {
continue
}
let np = NetworkPost(context: context)
np.id = post.id
np.network = network.rawValue
np.networkPostID = post.networkPostID
np.subtitle = post.subtitle
np.text = post.text
for image in post.images {
let npImage = NetworkPostImage(context: context)
npImage.data = image
np.addToImages(npImage)
}
if let active = post.active {
np.active = active
}
np.created = post.created
}
try! context.save()
}
private func isPostSaved(context: NSManagedObjectContext, network: Network, networkPostID: String) -> Bool {
let fetchRequest = NSFetchRequest<NetworkPost>(entityName: "NetworkPost")
let format = "(network == %@) AND (networkPostID == %@)"
fetchRequest.predicate = NSPredicate(format: format,
network.rawValue,
networkPostID)
let posts = try! context.fetch(fetchRequest)
return !posts.isEmpty
}
Is it likely that one of my try!
calls in either savePosts
or isPostSaved
is the culprit causing an EXC_BREAKPOINT
?
If so how can I narrow down which one it is? Is there any way of using the first three libswiftCore.dylib
calls of the backtrace to figure it out?
If not the try!
calls then what else could be causing the EXEC_BREAKPOINT
error?
Note that I am using the CoreData API in memory only mode so I expect my try! context.save()
and try! context.fetch(fetchRequest)
calls to execute unless there is something seriously wrong or I have a programming error. This is why I use try!
instead of do { } catch { }
.
ios swift xcode crash-reports
ios swift xcode crash-reports
asked Nov 12 '18 at 12:10
Dan
1,46211644
1,46211644
1
Before interpreting crash reports I recommend to usedo-catch
blocks and interpret the error.
– vadian
Nov 12 '18 at 12:17
I could and probably will end up doing that if this question comes to nothing. However, I can't recreate the error and have no access to the affected users. There's also no guarantee the affected users will use my app again with it continually crashing so I was hoping to give myself the best opportunity to fix the issue first time.
– Dan
Nov 12 '18 at 12:54
After further investigation the EXC_BREAKPOINT was coming fromtry! context.save()
having a validation error. I would still like to know how I could have inferred that from the crash report.
– Dan
Nov 15 '18 at 10:07
add a comment |
1
Before interpreting crash reports I recommend to usedo-catch
blocks and interpret the error.
– vadian
Nov 12 '18 at 12:17
I could and probably will end up doing that if this question comes to nothing. However, I can't recreate the error and have no access to the affected users. There's also no guarantee the affected users will use my app again with it continually crashing so I was hoping to give myself the best opportunity to fix the issue first time.
– Dan
Nov 12 '18 at 12:54
After further investigation the EXC_BREAKPOINT was coming fromtry! context.save()
having a validation error. I would still like to know how I could have inferred that from the crash report.
– Dan
Nov 15 '18 at 10:07
1
1
Before interpreting crash reports I recommend to use
do-catch
blocks and interpret the error.– vadian
Nov 12 '18 at 12:17
Before interpreting crash reports I recommend to use
do-catch
blocks and interpret the error.– vadian
Nov 12 '18 at 12:17
I could and probably will end up doing that if this question comes to nothing. However, I can't recreate the error and have no access to the affected users. There's also no guarantee the affected users will use my app again with it continually crashing so I was hoping to give myself the best opportunity to fix the issue first time.
– Dan
Nov 12 '18 at 12:54
I could and probably will end up doing that if this question comes to nothing. However, I can't recreate the error and have no access to the affected users. There's also no guarantee the affected users will use my app again with it continually crashing so I was hoping to give myself the best opportunity to fix the issue first time.
– Dan
Nov 12 '18 at 12:54
After further investigation the EXC_BREAKPOINT was coming from
try! context.save()
having a validation error. I would still like to know how I could have inferred that from the crash report.– Dan
Nov 15 '18 at 10:07
After further investigation the EXC_BREAKPOINT was coming from
try! context.save()
having a validation error. I would still like to know how I could have inferred that from the crash report.– Dan
Nov 15 '18 at 10:07
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53261932%2fhow-do-i-interpret-ios-exc-breakpoint-crash-report%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53261932%2fhow-do-i-interpret-ios-exc-breakpoint-crash-report%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Before interpreting crash reports I recommend to use
do-catch
blocks and interpret the error.– vadian
Nov 12 '18 at 12:17
I could and probably will end up doing that if this question comes to nothing. However, I can't recreate the error and have no access to the affected users. There's also no guarantee the affected users will use my app again with it continually crashing so I was hoping to give myself the best opportunity to fix the issue first time.
– Dan
Nov 12 '18 at 12:54
After further investigation the EXC_BREAKPOINT was coming from
try! context.save()
having a validation error. I would still like to know how I could have inferred that from the crash report.– Dan
Nov 15 '18 at 10:07