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

Returning certain values from native iOS code results in immediate crash #622

Closed
jasssonpet opened this Issue Aug 11, 2016 · 8 comments

Comments

Projects
None yet
5 participants
@jasssonpet
Contributor

jasssonpet commented Aug 11, 2016

From @bnussey on August 11, 2016 6:25

Since the latest NativeScript release (2.2.0) returning certain values from native iOS code results in a crash. I contribute to nativescript-videoplayer and since the new release, this line of code are resulting in an immediate crash:

return this._player.currentTime().value

this._player is AVPlayer
currentTime relates to this method on the AVPlayer - https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVPlayer_Class/#//apple_ref/occ/instm/AVPlayer/currentTime
Full code can be reviewed here: https://github.com/bradmartin/nativescript-videoplayer/blob/master/videoplayer.ios.ts#L113

This is the crash message:

com.apple.CoreSimulator.SimDevice.7D812403-FB85-469B-9C88-1B286BC7DF9F.launchd_sim[11559] (UIKitApplication:com.stageme.app[0x6ba9][12379]): Service exited due to signal: Segmentation fault: 11

This was working absolutely fine before the upgrade.

In terms of doing some research about the error message, I found this: http://stackoverflow.com/a/23798704/3900606

Copied from original issue: NativeScript/NativeScript#2568

@jasssonpet

This comment has been minimized.

Show comment
Hide comment
@jasssonpet

jasssonpet Aug 11, 2016

Contributor

Hi @bnussey,

Thanks for reporting this bug. The problem seems to be related to how the iOS runtime handles struct marshalling on x86_64 architecture. The 2.2 NativeScript CLI now builds for this architecture by default.

In the meantime you can use a 32-bit simulator, like the iPhone 4s one. We'll provide a fix shortly.

Contributor

jasssonpet commented Aug 11, 2016

Hi @bnussey,

Thanks for reporting this bug. The problem seems to be related to how the iOS runtime handles struct marshalling on x86_64 architecture. The 2.2 NativeScript CLI now builds for this architecture by default.

In the meantime you can use a 32-bit simulator, like the iPhone 4s one. We'll provide a fix shortly.

@NathanaelA

This comment has been minimized.

Show comment
Hide comment
@NathanaelA

NathanaelA Aug 11, 2016

Does this affect real devices or just the Emulator?

NathanaelA commented Aug 11, 2016

Does this affect real devices or just the Emulator?

@bnussey

This comment has been minimized.

Show comment
Hide comment
@bnussey

bnussey Aug 11, 2016

Hey @jasssonpet no problems at all. Thanks for the prompt response. @NathanaelA only tested on the emulator, so not sure.

bnussey commented Aug 11, 2016

Hey @jasssonpet no problems at all. Thanks for the prompt response. @NathanaelA only tested on the emulator, so not sure.

@jasssonpet

This comment has been minimized.

Show comment
Hide comment
@jasssonpet

jasssonpet Aug 11, 2016

Contributor

@NathanaelA I have tested on an armv7 and an arm64 device and there marshalling seems to be working fine.

Contributor

jasssonpet commented Aug 11, 2016

@NathanaelA I have tested on an armv7 and an arm64 device and there marshalling seems to be working fine.

@bnussey

This comment has been minimized.

Show comment
Hide comment
@bnussey

bnussey Aug 15, 2016

hey @jasssonpet do you know when this will be released? Thanks

bnussey commented Aug 15, 2016

hey @jasssonpet do you know when this will be released? Thanks

@jasssonpet

This comment has been minimized.

Show comment
Hide comment
@jasssonpet

jasssonpet Aug 15, 2016

Contributor

Hi, we are expecting to release a hotfix in the next few days.

Contributor

jasssonpet commented Aug 15, 2016

Hi, we are expecting to release a hotfix in the next few days.

@vchimev vchimev added this to the 2.2.1 milestone Aug 16, 2016

@vchimev

This comment has been minimized.

Show comment
Hide comment
@vchimev

vchimev Aug 16, 2016

Contributor

@bnussey, @jasssonpet,
tns-ios@2.2.1 was just published to npm.

Contributor

vchimev commented Aug 16, 2016

@bnussey, @jasssonpet,
tns-ios@2.2.1 was just published to npm.

@bnussey

This comment has been minimized.

Show comment
Hide comment
@bnussey

bnussey Aug 18, 2016

Hey @vchimev and @jasssonpet confirming issue is fixed, thanks so much!

bnussey commented Aug 18, 2016

Hey @vchimev and @jasssonpet confirming issue is fixed, thanks so much!

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