Shinobicharts-premium-2.7.3.hotfix1-1 issues


#1

Hello everybody!

Right after upgrade to Xcode 6.1 I reinstalled latest available ShinobiCharts which is shinobicharts-premium-2.7.3.hotfix1 released at 30 Sept 2014I installed via ShinobiCharts_Premium.pkg

Now my project can not be run in the Simulator (iPad2 with ios 7.1). There are 2 issues

  1. it get frozen when it tries to display ShinobiCharts as MKMapKit map annotations. I can pause in Xcode and see the following:

libsystem_kernel.dylib`__semwait_signal:
0x3303b6c:  movl   $0x14e, %eax
0x3303b71:  calll  0x33054bc                 ; _sysenter_trap
0x3303b76:  jae    0x3303b86                 ; __semwait_signal + 26  <=== SIGSTOP
0x3303b78:  calll  0x3303b7d                 ; __semwait_signal + 17
0x3303b7d:  popl   %edx
0x3303b7e:  movl   0x64a7(%edx), %edx
0x3303b84:  jmpl   *%edx
0x3303b86:  retl  
0x3303b87:  nop   

(lldb) bt
* thread #1: tid = 0x9c4c, 0x03303b76 libsystem_kernel.dylib\_\_semwait\_signal + 10, name = '1.3 rv:135', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP &nbsp; \* frame #0: 0x03303b76 libsystem\_kernel.dylib__semwait_signal + 10
    frame #1: 0x0303a2df libsystem_sim_c.dylibnanosleep + 219 &nbsp;&nbsp;&nbsp; frame #2: 0x0303a18a libsystem\_sim\_c.dylibusleep + 60
    frame #3: 0x00ecf359 QuartzCorex\_sleep + 21 &nbsp;&nbsp;&nbsp; frame #4: 0x00eb4fee QuartzCorenative_window_swap(_EAGLWindowObject*) + 724
    frame #5: 0x10267467 GLEnginegliPresentViewES\_Exec + 173 &nbsp;&nbsp;&nbsp; frame #6: 0x1026735b GLEnginegliPresentViewES + 167
    frame #7: 0x023af65f OpenGLES-[EAGLContext presentRenderbuffer:] + 58 &nbsp;&nbsp;&nbsp; frame #8: 0x002b28b3 bi-[SChartGLView endRender] + 419
    frame #9: 0x002b93cf bi-[SChartCanvas drawChart:] + 3615 &nbsp;&nbsp;&nbsp; frame #10: 0x002b3c35 bi-[SChartCanvasRenderView drawRect:] + 85
    frame #11: 0x01153453 UIKit-[UIView(CALayerDelegate) drawLayer:inContext:] + 504 &nbsp;&nbsp;&nbsp; frame #12: 0x00e98f39 QuartzCore-[CALayer drawInContext:] + 123
    frame #13: 0x00e988ee QuartzCoreCA::Layer::display\_() + 624 &nbsp;&nbsp;&nbsp; frame #14: 0x00e98eb9 QuartzCore-[CALayer _display] + 33
    frame #15: 0x00e98676 QuartzCoreCA::Layer::display() + 144 &nbsp;&nbsp;&nbsp; frame #16: 0x00e98e93 QuartzCore-[CALayer display] + 33
    frame #17: 0x00e8d043 QuartzCoreCA::Layer::display\_if\_needed(CA::Transaction\*) + 323 &nbsp;&nbsp;&nbsp; frame #18: 0x00e8d0bc QuartzCoreCA::Layer::layout_and_display_if_needed(CA::Transaction*) + 38
    frame #19: 0x00df37fa QuartzCoreCA::Context::commit\_transaction(CA::Transaction\*) + 294 &nbsp;&nbsp;&nbsp; frame #20: 0x00df4b85 QuartzCoreCA::Transaction::commit() + 393
    frame #21: 0x00eb25b0 QuartzCore+[CATransaction flush] + 52 &nbsp;&nbsp;&nbsp; frame #22: 0x01101ce5 UIKit_afterCACommitHandler + 131
    frame #23: 0x02c1c36e CoreFoundation\_\_CFRUNLOOP\_IS\_CALLING\_OUT\_TO\_AN\_OBSERVER\_CALLBACK\_FUNCTION\_\_ + 30 &nbsp;&nbsp;&nbsp; frame #24: 0x02c1c2bf CoreFoundation__CFRunLoopDoObservers + 399
    frame #25: 0x02bfa254 CoreFoundation\_\_CFRunLoopRun + 1076 &nbsp;&nbsp;&nbsp; frame #26: 0x02bf99d3 CoreFoundationCFRunLoopRunSpecific + 467
    frame #27: 0x02bf97eb CoreFoundationCFRunLoopRunInMode + 123 &nbsp;&nbsp;&nbsp; frame #28: 0x0493c5ee GraphicsServicesGSEventRunModal + 192
    frame #29: 0x0493c42b GraphicsServicesGSEventRun + 104 &nbsp;&nbsp;&nbsp; frame #30: 0x010e4f9b UIKitUIApplicationMain + 1225
    frame #31: 0x00084c3d bimain(argc=3, argv=0xbff7c53c) + 141 at main.m:16 &nbsp;&nbsp;&nbsp; frame #32: 0x031bc701 libdyld.dylibstart + 1

  1. Another problem happens when it tries to display Shinobichart with my custom views added:

2014-10-25 18:42:23.719 bi[3021:60b] *** Assertion failure in -[ShinobiChart layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2935.137/UIView.m:8794
2014-10-25 18:42:23.832 bi[3021:60b] *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Auto Layout still required after executing -layoutSubviews. ShinobiChart’s implementation of -layoutSubviews needs to call super.’
*** First throw call stack:
(
    0   CoreFoundation                      0x02c341e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x029b38e5 objc_exception_throw + 44
    2   CoreFoundation                      0x02c34048 +[NSException raise:format:arguments:] + 136
    3   Foundation                          0x025914de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
    4   UIKit                               0x01131a38 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 567
    5   libobjc.A.dylib                     0x029c582b -[NSObject performSelector:withObject:] + 70
    6   QuartzCore                          0x00e7945a -[CALayer layoutSublayers] + 148
    7   QuartzCore                          0x00e6d244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
    8   QuartzCore                          0x00e6d0b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
    9   QuartzCore                          0x00dd37fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
    10  QuartzCore                          0x00dd4b85 _ZN2CA11Transaction6commitEv + 393
    11  QuartzCore                          0x00dd5258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
    12  CoreFoundation                      0x02bfc36e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    13  CoreFoundation                      0x02bfc2bf __CFRunLoopDoObservers + 399
    14  CoreFoundation                      0x02bda254 __CFRunLoopRun + 1076
    15  CoreFoundation                      0x02bd99d3 CFRunLoopRunSpecific + 467
    16  CoreFoundation                      0x02bd97eb CFRunLoopRunInMode + 123
    17  GraphicsServices                    0x0491f5ee GSEventRunModal + 192
    18  GraphicsServices                    0x0491f42b GSEventRun + 104
    19  UIKit                               0x010c2f9b UIApplicationMain + 1225
    20  bi                                  0x0005cc6d main + 141
    21  libdyld.dylib                       0x031a2701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Once I switched back to version 2.7.3 (9-Sep-2014) everything works without any problem. Hope this info would save some time for other users and might help Shinobi team to fix possible problems.


#2

Hi Deem0n,

Thanks for the info - we’ll take a look into this and get back to you.

Thanks,
Jan


#3

Hi Deem0n,

After some investigation it looks like the crash is linked to us trying to access the render buffer and is being blocked causing the thread to sleep.

Is it possible to send us a cut down version of your project that replicates this crash to info@shinobicontrols.com?

This would really help us identify the source of the issue.

Kind regards,
Andrew Polkinghorn


#4

Hello, we have quite big project, but I will try to make a simple version which is able to demonstrate the problem.

Do you need a source code, or not-stripped-binary+DSYM for emulator is enough ?


#5

Hi Deem0n,

A copy of your sample’s source code would be best. You may find that creating a sample application actually points out why the crash is happening. It’s normally a step I try when basic debugging has failed.

Thanks,
Jan


#6

Hello,

I sent sample project, here is problematic code:

-(void)sChartRenderFinished:(ShinobiChart *)chart {
    // Shinobi 2.7.* is smarter: it now correctly draw canvas, based on titleLabel frame (i.e. it makes canvas smaller to fit titleLabel
    //we moved titleLabel below canvas, so we need to adjust canvas frame, so it occupy ALL the space in our placeholder...
    chart.canvas.frame = CGRectMake(0, 0, _pieRadius*2, _pieRadius*2);
   
    /*
     but attempt to set chart.canvas.frame inside sChartRenderFinished: will freeze thread !!! 2.7.3.hotfix1-1
    
    */
}

Might be my fault, as it kind of hack to touch shinobi canvas, but at least it worked on all previous versions of Shinobi.


#7

Hi Dimitry,

After further investigation I have found that setting the canvas frame inside the sChartRenderFinished method will cause an infinite loop.

This is due to causing the canvas frame to layout its subviews when you set it’s frame which causes the chart to redraw and the sChartRenderFinished to be called.

Could you give me a bit more clarity to why you are setting the canvas frame?

You say its to prevent the chart from taking it’s title label frame into account. However, no chart title appears when you comment out the line of code that sets the canvas frame.

Also, if you set your chart’s titleLabel frame directly the canvas won’t take it into account.

Kind regards,
Andrew Polkinghorn