cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <>
Subject [jira] [Commented] (CB-6150) objc_msgSend causes EXC_BAD_ACCESS with plugins on arm64
Date Mon, 03 Mar 2014 23:14:20 GMT


Shazron Abdullah commented on CB-6150:

Confirmed the bug. 

Two fixes:
((void(*)(id, SEL, id))objc_msgSend)(obj, normalSelector, command);

if ( ((BOOL(*)(id, SEL, id, int)) objc_msgSend)(plugin, selector, request, navigationType)
== YES) {

> objc_msgSend causes EXC_BAD_ACCESS with plugins on arm64
> --------------------------------------------------------
>                 Key: CB-6150
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 3.4.0
>         Environment: iOS 7.0.6 arm64
>            Reporter: Joris Verbogt
>            Assignee: Shazron Abdullah
>              Labels: core
> This bug was mentioned before in
> The code in CDVCommandQueue line 197:
> objc_msgSend(obj, normalSelector, command);
> Causes a EXC_BAD_ACCESS on arm64.
> According to Apple's docs at
> An exception to the casting rule described above is when you are calling the objc_msgSend
function or any other similar functions in the Objective-C runtime that send messages. Although
the prototype for the message functions has a variadic form, the method function that is called
by the Objective-C runtime does not share the same prototype. The Objective-C runtime directly
dispatches to the function that implements the method, so the calling conventions are mismatched,
as described previously. Therefore you must cast the objc_msgSend function to a prototype
that matches the method function being called.
> This bug can be solved by explicit casting, like so:
> {code}
> ((void(*)(id, SEL, id))objc_msgSend)(obj, normalSelector, command);
> {code}

This message was sent by Atlassian JIRA

View raw message