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

GoogleAnalytics crashes RM gen_bridge_metadata #106

Open
caramdache opened this Issue Sep 23, 2018 · 19 comments

Comments

Projects
None yet
2 participants
@caramdache

caramdache commented Sep 23, 2018

I have been using GoogleAnalytics with RM for years without any issue and suddenly it crashed RM immediately after running rake. I downloaded the latest version of GA, but RM still crashes.

It looks like the issue is in gen_bridge_metadata.

     Build ./build/iPhoneSimulator-12.0-Development
     Build vendor/GoogleAnalytics
Ignoring bigdecimal-1.3.5 because its extensions are not built.  Try: gem pristine bigdecimal --version 1.3.5
Ignoring bigdecimal-1.3.4 because its extensions are not built.  Try: gem pristine bigdecimal --version 1.3.4
Ignoring date-1.0.0 because its extensions are not built.  Try: gem pristine date --version 1.0.0
Ignoring dbm-1.0.0 because its extensions are not built.  Try: gem pristine dbm --version 1.0.0
/Library/RubyMotion/lib/BridgeSupport2/System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle: [BUG] Segmentation fault at 0x0000000000c96522
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
-- Control frame information -----------------------------------------------
c:0010 p:-17569455029594 s:0047 e:000046 TOP    [FINISH]
c:0009 p:---- s:0045 e:000044 CFUNC  :require
c:0008 p:0124 s:0041 e:000040 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55
c:0007 p:0035 s:0031 e:000030 TOP    /Library/RubyMotion/lib/BridgeSupport2/System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.rb:6 [FINISH]
c:0006 p:---- s:0029 e:000028 CFUNC  :require
c:0005 p:0124 s:0025 e:000024 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55
c:0004 p:0215 s:0015 e:000014 TOP    /Library/RubyMotion/lib/BridgeSupport2/usr/bin/gen_bridge_metadata:65 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC  :load
c:0002 p:0128 s:0006 E:0013d0 EVAL   /Library/RubyMotion/bin/gen_bridge_metadata:36 [FINISH]
c:0001 p:0000 s:0002 E:0000f0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/Library/RubyMotion/bin/gen_bridge_metadata:36:in `<main>'
/Library/RubyMotion/bin/gen_bridge_metadata:36:in `load'
/Library/RubyMotion/lib/BridgeSupport2/usr/bin/gen_bridge_metadata:65:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Library/RubyMotion/lib/BridgeSupport2/System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.rb:6:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'

-- Machine register context ------------------------------------------------
 rax: 0x0000000000000000 rbx: 0x00000000082dee80 rcx: 0x0000000105bea7b0
 rdx: 0x0000000000000000 rdi: 0x00000001068b7d49 rsi: 0x000000001f08000c
 rbp: 0x00007ffeea1a5990 rsp: 0x00007ffeea1a5918  r8: 0x0000000000000000
  r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000000
 r12: 0x0000000000000003 r13: 0x00007fd5a70be5d0 r14: 0x00007fd5a903f350
 r15: 0x00007ffeea1a59a0 rip: 0x0000000000c96522 rfl: 0x0000000000010246

-- C level backtrace information -------------------------------------------
0   libruby.2.3.0.dylib                 0x00007fff4681a006 rb_print_backtrace + 29
1   libruby.2.3.0.dylib                 0x00007fff4681a1da rb_vm_bugreport + 361
2   libruby.2.3.0.dylib                 0x00007fff46715413 rb_bug_context + 206
3   libruby.2.3.0.dylib                 0x00007fff467b1422 Init_signal + 3270
4   libsystem_platform.dylib            0x00007fff687afb3d _sigtramp + 29
5   ???                                 0x0000000000c96522 0x0 + 13198626
6   bridgesupportparser.bundle          0x0000000105bea7d7 Init_bridgesupportparser + 39
7   libruby.2.3.0.dylib                 0x00007fff466e6551 dln_load + 229
8   libruby.2.3.0.dylib                 0x00007fff4680efc8 rb_vm_call_cfunc + 169
9   libruby.2.3.0.dylib                 0x00007fff4671db33 rb_require_internal + 1496
10  libruby.2.3.0.dylib                 0x00007fff4671d4b5 rb_require_safe + 14
11  libruby.2.3.0.dylib                 0x00007fff468120d8 rb_vm_fstring_table + 4999
12  libruby.2.3.0.dylib                 0x00007fff46803021 rb_vm_get_insns_address_table + 8039
13  libruby.2.3.0.dylib                 0x00007fff4680e77c rb_iseq_eval + 414
14  libruby.2.3.0.dylib                 0x00007fff4671d418 rb_load_protect + 562
15  libruby.2.3.0.dylib                 0x00007fff4671dbf6 rb_require_internal + 1691
16  libruby.2.3.0.dylib                 0x00007fff4671d4b5 rb_require_safe + 14
17  libruby.2.3.0.dylib                 0x00007fff468120d8 rb_vm_fstring_table + 4999
18  libruby.2.3.0.dylib                 0x00007fff46803021 rb_vm_get_insns_address_table + 8039
19  libruby.2.3.0.dylib                 0x00007fff4680e77c rb_iseq_eval + 414
20  libruby.2.3.0.dylib                 0x00007fff4671d418 rb_load_protect + 562
21  libruby.2.3.0.dylib                 0x00007fff4671d174 rb_load + 64
22  libruby.2.3.0.dylib                 0x00007fff4671e141 Init_load + 659
23  libruby.2.3.0.dylib                 0x00007fff468120d8 rb_vm_fstring_table + 4999
24  libruby.2.3.0.dylib                 0x00007fff46803021 rb_vm_get_insns_address_table + 8039
25  libruby.2.3.0.dylib                 0x00007fff4680e77c rb_iseq_eval + 414
26  libruby.2.3.0.dylib                 0x00007fff46719e6a ruby_exec_node + 232
27  libruby.2.3.0.dylib                 0x00007fff46719d5d ruby_run_node + 39
28  ruby                                0x0000000105a591bd main + 98

@caramdache caramdache changed the title from GoogleAnalytics crashed RM gen_bridge_metadata to GoogleAnalytics crashes RM gen_bridge_metadata Sep 23, 2018

@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Sep 24, 2018

Owner

What's the name of the cocoapod and version?

What function are you invoking?

Owner

amirrajan commented Sep 24, 2018

What's the name of the cocoapod and version?

What function are you invoking?

@caramdache

This comment has been minimized.

Show comment
Hide comment
@caramdache

caramdache Sep 24, 2018

Hi Amir,
I don't use pods in this instance, I downloaded the latest version (3.17) at:

   https://developers.google.com/analytics/devguides/collection/ios/v3/sdk-download

Here are the methods that I use:

      GAI.sharedInstance.trackUncaughtExceptions = false
      GAI.sharedInstance.dispatchInterval = UIDevice.development? ? 5 : 60*2
      #GAI.sharedInstance.logger.setLogLevel(KGAILogLevelVerbose)
      #GAI.sharedInstance.dispatch # manual dispatch
      GAI.sharedInstance.trackerWithTrackingId(GoogleKey)

      tracker = GAI.sharedInstance.defaultTracker
      tracker.set(KGAIScreenName, string)
      params = {
        GAIFields.customDimensionForIndex(index) => userLevel,
        GAIFields.customMetricForIndex(index) => value,
      }
      builder = GAIDictionaryBuilder.createScreenView
      builder = GAIDictionaryBuilder.createEventWithCategory(string, action, label, value)
      tracker.send(builder.setAll(params).build)

caramdache commented Sep 24, 2018

Hi Amir,
I don't use pods in this instance, I downloaded the latest version (3.17) at:

   https://developers.google.com/analytics/devguides/collection/ios/v3/sdk-download

Here are the methods that I use:

      GAI.sharedInstance.trackUncaughtExceptions = false
      GAI.sharedInstance.dispatchInterval = UIDevice.development? ? 5 : 60*2
      #GAI.sharedInstance.logger.setLogLevel(KGAILogLevelVerbose)
      #GAI.sharedInstance.dispatch # manual dispatch
      GAI.sharedInstance.trackerWithTrackingId(GoogleKey)

      tracker = GAI.sharedInstance.defaultTracker
      tracker.set(KGAIScreenName, string)
      params = {
        GAIFields.customDimensionForIndex(index) => userLevel,
        GAIFields.customMetricForIndex(index) => value,
      }
      builder = GAIDictionaryBuilder.createScreenView
      builder = GAIDictionaryBuilder.createEventWithCategory(string, action, label, value)
      tracker.send(builder.setAll(params).build)
@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Sep 24, 2018

Owner

Is there a possibility that you can put up a sample app that includes the sdk in the ./vendor directory as you are doing?

Aside: double check and make sure that any cached files are removed from ~/Library/RubyMotion/build.

Owner

amirrajan commented Sep 24, 2018

Is there a possibility that you can put up a sample app that includes the sdk in the ./vendor directory as you are doing?

Aside: double check and make sure that any cached files are removed from ~/Library/RubyMotion/build.

@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Sep 24, 2018

Owner

And if you can share the output of rake config that would be helpful too.

Owner

amirrajan commented Sep 24, 2018

And if you can share the output of rake config that would be helpful too.

@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Sep 24, 2018

Owner

Also, it seems like Google is deprecating "everything" (eg Crashlytics) and putting it all into their Firebase SDK. Just something to look out for.

Owner

amirrajan commented Sep 24, 2018

Also, it seems like Google is deprecating "everything" (eg Crashlytics) and putting it all into their Firebase SDK. Just something to look out for.

@caramdache

This comment has been minimized.

Show comment
Hide comment
@caramdache

caramdache Sep 25, 2018

Here is a sample project that demonstrate the issue. ga.zip

Inside the projet, there is a file called rake.config. It is the output of rake config.

Thanks for the tip, I'll have a look at Firebase (again).

caramdache commented Sep 25, 2018

Here is a sample project that demonstrate the issue. ga.zip

Inside the projet, there is a file called rake.config. It is the output of rake config.

Thanks for the tip, I'll have a look at Firebase (again).

@caramdache

This comment has been minimized.

Show comment
Hide comment
@caramdache

caramdache Sep 27, 2018

BTW, using pod 'Firebase/Core will also create an expection in gen-bridge-metadata.

caramdache commented Sep 27, 2018

BTW, using pod 'Firebase/Core will also create an expection in gen-bridge-metadata.

@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Sep 27, 2018

Owner

I'll take a look this weekend and get you an update 👍

Owner

amirrajan commented Sep 27, 2018

I'll take a look this weekend and get you an update 👍

@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Sep 27, 2018

Owner

@caramdache are you on High Sierra or Mojave?

Owner

amirrajan commented Sep 27, 2018

@caramdache are you on High Sierra or Mojave?

@caramdache

This comment has been minimized.

Show comment
Hide comment
@caramdache

caramdache Sep 27, 2018

Mojave of course.

caramdache commented Sep 27, 2018

Mojave of course.

@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Sep 30, 2018

Owner

Mind joining this Slack discussion (if you're not already a part of it)? https://motioneers.slack.com/archives/C055RDLS0/p1537915072000100

Owner

amirrajan commented Sep 30, 2018

Mind joining this Slack discussion (if you're not already a part of it)? https://motioneers.slack.com/archives/C055RDLS0/p1537915072000100

@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Oct 1, 2018

Owner

Related and may fix your issue. Mind trying it? https://trac.macports.org/ticket/54939

Run the following command:

cd /Applications/Xcode.app/Contents/Developer/Toolchains
sudo ln -s XcodeDefault.xctoolchain OSX10.14.xctoolchain
Owner

amirrajan commented Oct 1, 2018

Related and may fix your issue. Mind trying it? https://trac.macports.org/ticket/54939

Run the following command:

cd /Applications/Xcode.app/Contents/Developer/Toolchains
sudo ln -s XcodeDefault.xctoolchain OSX10.14.xctoolchain
@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Oct 1, 2018

Owner

Here is what we are doing in the Slack channel right now (you may want to try it and see if it works for you):

  • clone repo: https://github.com/amirrajan/bridgesupport
  • make sure you have rbenv installed
  • make
  • sudo make install DESTDIR=/Library/RubyMotion/lib/BridgeSupport2
  • cd /Applications/Xcode.app/Contents/Developer/Toolchains
  • sudo ln -s XcodeDefault.xctoolchain OSX10.14.xctoolchain
Owner

amirrajan commented Oct 1, 2018

Here is what we are doing in the Slack channel right now (you may want to try it and see if it works for you):

  • clone repo: https://github.com/amirrajan/bridgesupport
  • make sure you have rbenv installed
  • make
  • sudo make install DESTDIR=/Library/RubyMotion/lib/BridgeSupport2
  • cd /Applications/Xcode.app/Contents/Developer/Toolchains
  • sudo ln -s XcodeDefault.xctoolchain OSX10.14.xctoolchain
@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Oct 1, 2018

Owner

The following steps should resolve your issue. After I've tested it, it'll be part of RubyMotion vNext (which I'll release ASAP): https://gist.github.com/Atastor/2e85ee4fab03aaab391594b6fa769931

Owner

amirrajan commented Oct 1, 2018

The following steps should resolve your issue. After I've tested it, it'll be part of RubyMotion vNext (which I'll release ASAP): https://gist.github.com/Atastor/2e85ee4fab03aaab391594b6fa769931

@caramdache

This comment has been minimized.

Show comment
Hide comment
@caramdache

caramdache Oct 3, 2018

Thanks Amir, I'm on slack now. Recompiling BridgeSupport is a huge endeavour. I will wait for RM's next release to be available.

caramdache commented Oct 3, 2018

Thanks Amir, I'm on slack now. Recompiling BridgeSupport is a huge endeavour. I will wait for RM's next release to be available.

@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Oct 6, 2018

Owner

try this out: https://www.dropbox.com/s/ixryj9ne9o7c83h/bridge_support_2.tgz?dl=0

just back up what's under /Library/RubyMotion/lib/BridgeSupport2 and replace the contents with what's under the tarbal

Owner

amirrajan commented Oct 6, 2018

try this out: https://www.dropbox.com/s/ixryj9ne9o7c83h/bridge_support_2.tgz?dl=0

just back up what's under /Library/RubyMotion/lib/BridgeSupport2 and replace the contents with what's under the tarbal

@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Oct 6, 2018

Owner

after copying the following files over, run:

sudo mkdir -p /usr/local/lib/
sudo ln -s "$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib" /usr/local/lib/
Owner

amirrajan commented Oct 6, 2018

after copying the following files over, run:

sudo mkdir -p /usr/local/lib/
sudo ln -s "$(xcode-select -p)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib" /usr/local/lib/
@caramdache

This comment has been minimized.

Show comment
Hide comment
@caramdache

caramdache Oct 6, 2018

It's much better now, thanks !

This constant is no longer defined though and causes a crash:

KGAIScreenName

Here's how it's defined in GoogleAnalytics:

GAIFields.h: extern NSString *const kGAIScreenName;

caramdache commented Oct 6, 2018

It's much better now, thanks !

This constant is no longer defined though and causes a crash:

KGAIScreenName

Here's how it's defined in GoogleAnalytics:

GAIFields.h: extern NSString *const kGAIScreenName;
@amirrajan

This comment has been minimized.

Show comment
Hide comment
@amirrajan

amirrajan Oct 8, 2018

Owner

Take a look at the generated bridgesupport file and see if its in there.

The bridgesupport files should be under ~/Library/RubyMotion/build

Owner

amirrajan commented Oct 8, 2018

Take a look at the generated bridgesupport file and see if its in there.

The bridgesupport files should be under ~/Library/RubyMotion/build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment