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

EXC_BREAKPOINT on LineChartRenderer.drawCircles #4049

Open
slzrafael opened this issue Jun 28, 2019 · 22 comments
Open

EXC_BREAKPOINT on LineChartRenderer.drawCircles #4049

slzrafael opened this issue Jun 28, 2019 · 22 comments
Labels

Comments

@slzrafael
Copy link

I need to show Line graphs. I use regular API of Charts to show any graph, and it works perfectly in most case, but i receive in crashlyhtics some errors:

Crashed: com.apple.main-thread
EXC_BREAKPOINT 0x00000001060e9ad4

Crashed: com.apple.main-thread
0 Charts 0x1060e9ad4 LineChartRenderer.drawCircles(context:) + 108 (BarLineScatterCandleBubbleRenderer.swift:108)
1 Charts 0x106052f44 BarLineChartViewBase.draw(:) + 237 (BarLineChartViewBase.swift:237)
2 Charts 0x106053f9c @objc BarLineChartViewBase.draw(
:) ()
3 UIKitCore 0x1edade560 -[UIView(CALayerDelegate) drawLayer:inContext:] + 460
4 QuartzCore 0x1c53395c4 -[CALayer drawInContext:] + 296
5 QuartzCore 0x1c521d970 CABackingStoreUpdate_ + 176
6 QuartzCore 0x1c53400d0 invocation function for block in CA::Layer::display_() + 52
7 QuartzCore 0x1c5338e88 -[CALayer _display] + 1520
8 QuartzCore 0x1c52a1388 CA::Context::commit_transaction(CA::Transaction*) + 532
9 QuartzCore 0x1c52cf330 CA::Transaction::commit() + 640
10 QuartzCore 0x1c52cff20 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
11 CoreFoundation 0x1c0e165f8 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 32
12 CoreFoundation 0x1c0e11320 __CFRunLoopDoObservers + 412
13 CoreFoundation 0x1c0e1189c __CFRunLoopRun + 1228
14 CoreFoundation 0x1c0e110b0 CFRunLoopRunSpecific + 436
15 GraphicsServices 0x1c301179c GSEventRunModal + 104
16 UIKitCore 0x1ed647978 UIApplicationMain + 212
17 Easynvest 0x104ac72d4 main + 17 (main.swift:17)
18 libdyld.dylib 0x1c08d68e0 start + 4

Charts Environment

Charts version/Branch/Commit Number: 3.3.0
Xcode version: 10.2.1
Swift version: Swift 5
Platform(s) running Charts: IOS
macOS version running Xcode: 10.14.5

Unfortunally i dont have any scenario to reproduce this, any idea how to solve this problem?

@nerocristallo
Copy link

I have the same issue ... I am still trying to reproduce it in my test environment.

The crash starts to appear after updating the library from 3.2.2 to 3.3.0 (for fixing the issue 3915 )

@ramonoise
Copy link

ramonoise commented Jul 24, 2019

Any advance in this?

@liuxuan30
Copy link
Member

liuxuan30 commented Aug 1, 2019

Crashed: com.apple.main-thread
0 Charts 0x1060e9ad4 LineChartRenderer.drawCircles(context:) + 108 (BarLineScatterCandleBubbleRenderer.swift:108)
1 Charts 0x106052f44 BarLineChartViewBase.draw(:) + 237 (BarLineChartViewBase.swift:237)
2 Charts 0x106053f9c @objc BarLineChartViewBase.draw(:) ()

can you post the crash reason? and maybe debug a little?

@caloon
Copy link

caloon commented Sep 3, 2019

Having a similar issue, however it seems to be related to scatter charts in my case.

Xcode Debugger:
Screen Shot 2019-09-03 at 15 26 19

Firebase Crashlytics:
Screen Shot 2019-09-03 at 15 27 11

@liuxuan30
Copy link
Member

I need the crash reason, not just the stack. Can you send it?

@liuxuan30
Copy link
Member

@caloon seems you can reliably reproduce it? Can you send a code snippet so I can reproduce with ChartsDemo?

@caloon
Copy link

caloon commented Sep 10, 2019

No, the issue did not occur when testing the app on my test device and I was not able to reproduce the issue. Only thing I have is the stack trace I received through Crashlytics and Xcode Debugger.

@liuxuan30
Copy link
Member

then it's not easy to know where's the fault. Do you have line number for the crash?

@caloon
Copy link

caloon commented Sep 20, 2019

I referenced this issue in #4132 and explained what - in my opinion - caused the issue. Furthermore, bug reporter shows the issue occurs in the method drawValues(context:). Easiest would be to revert the tiny "improvements" referenced in #4132 which caused the framework's stability to collapse.

@caloon
Copy link

caloon commented Sep 20, 2019

The way I see it, version 3.2.1 is the last stable build and I would strongly discourage anyone from using a newer version if they want to release a stable app. This is a serious issue that caused 5% of my users to experience crashes.

@liuxuan30
Copy link
Member

I will use this thread for discussion.
In #4132 you mentioned #3164, however this is merged into 4.0 branch, not master, so I don't think this would cause an issue for the official release.

for #3891, you claim it's adding more issues, however I didn't see a clear reason that this new iterator is causing OOB issue, or, I don't know what to fix. #3891 is using a default iterator as it said

I would like to fix it if any, asap, however so far I don't have a clue what is causing your crash.

And, @caloon your crash is in scatter chart renderer, seems you can reproduce it? I need to reproduce it.

This poster crashes at

0 Charts 0x1060e9ad4 LineChartRenderer.drawCircles(context:) + 108 (BarLineScatterCandleBubbleRenderer.swift:108)

which is different than yours, however both methods has

for j in _xBounds

with blind guess that if we suspect #3891 is the trouble, at least we need to know what's crashing.

@liuxuan30
Copy link
Member

liuxuan30 commented Sep 26, 2019

and to everyone has similar crash, all I need is a reliable way to reproduce, if you find it's a rising crash rate. however so far we don't get one. The crash log is still hard to find what's wrong.

If it's a very small portion, could it be some corner cases on your side? I tried single data entry and zero data entry, no crash for line chart and scatter chart.

And if you manage to find the crash, the fix could be very fast and merged so I could release a new version this week.

@bweavgolfanatic
Copy link

I was able to cause this crash by feeding in data with x Values out of order

@bweavgolfanatic
Copy link

@liuxuan30 it seems min is 98 and max is 1 which breaks the iterator
image

@liuxuan30
Copy link
Member

why it's causing the min and max the contrary?

@Aparnach20
Copy link

Hi @liuxuan30 Have you found the solution of this.I am also getting the same error.

@MalcolmnDEV
Copy link

@liuxuan30 Hi I am also getting this error now on the production app but I am unable to replicate it. Same error tho

@MalcolmnDEV
Copy link

Screenshot 2020-08-25 at 10 53 45

This is the stack trace

@gordondove
Copy link

Hope this isn't a red herring.

I was getting this error, 100% reproducible in 3.5.0, XCode 12 beta.
Fixed it after an embarrassingly long time by manually forcing recalculation of min and max for my data set and the chart data.

        self.downloadDataSet.append(newThroughtputPoint)
        self.downloadDataSet.calcMinMax()
        chartView.data?.calcMinMax()
        self.chartView.notifyDataSetChanged()

I don't understand what it is even doing in drawCircles though, since I have them disabled.

@liuxuan30
Copy link
Member

if you append, did you sort? Or is it related unsorted values to crash? It has been a long time for this and honestly I'm not sure what's the issue now

@MalcolmnDEV
Copy link

Any update to this issue ?

@LuckyRoc
Copy link

LuckyRoc commented Feb 8, 2022

Any update to this issue ?

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

No branches or pull requests

10 participants