Commit 0254a805 authored by Andreas Mieke's avatar Andreas Mieke

Check if crashing thread is in threads

#37
parent 964a31db
......@@ -52,6 +52,7 @@ BindSocket = "/var/run/crashdragon/crashdragon.sock"
ContentDirectory = "/root/CrashDragon/Files"
TemplatesDirectory = "./templates"
AssetsDirectory = "./assets"
SymbolicatorPath = "./build/bin/minidump_stackwalk"
```
The configuration file can be found in `$HOME/CrashDragon/config.toml` and can be edited with whatever editor you like.
......
......@@ -137,18 +137,22 @@ func processReport(Report database.Report, reprocess bool) {
Report.CrashLine = 0
}
for _, Frame := range Report.Report.Threads[Report.Report.CrashInfo.CrashingThread].Frames {
if Frame.File == "" && Report.Signature != "" {
continue
}
Report.Signature = Frame.Function
if Frame.File == "" {
continue
if len(Report.Report.Threads) > Report.Report.CrashInfo.CrashingThread {
for _, Frame := range Report.Report.Threads[Report.Report.CrashInfo.CrashingThread].Frames {
if Frame.File == "" && Report.Signature != "" {
continue
}
Report.Signature = Frame.Function
if Frame.File == "" {
continue
}
Report.CrashLocation = Frame.File + ":" + strconv.Itoa(Frame.Line)
Report.CrashPath = Frame.File
Report.CrashLine = Frame.Line
break
}
Report.CrashLocation = Frame.File + ":" + strconv.Itoa(Frame.Line)
Report.CrashPath = Frame.File
Report.CrashLine = Frame.Line
break
} else {
log.Printf("Crashing thread %d is out of index in Threads!", Report.Report.CrashInfo.CrashingThread)
}
if !reprocess {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment