LoginSignup
6
6

More than 5 years have passed since last update.

64bit iOSシミュレータでファイル操作関連でSIGABRTする件の回避方法

Posted at

j2objcに限らずですが、ファイル操作関連のコードで、64bitの実機では動くのに、シミュレータで動かしたときに、以下のようなエラーを吐いて落ちることがあります。

Xcodeエラー内容

Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
stat$INODE64 
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
fstat$INODE64 

原因

iOSシミュレータのバグらしいです。64bit用の関数を用意し忘れたようです( ̄▽ ̄;) アップルさんてばうっかりさんね。

つまり回避不能!?
いやいや、広大なネットの海を泳げば、適切なキーワードがあれば、世界の人が教えてくれます。あとは想像の翼を広げて・・・

回避方法

ないなら定義してやればいいじゃない。
てことで、main.mにないと言われた関数を作ってやればOK.

main.m
int stat$INODE64( const char *path, struct stat *sb )
{
    return stat( path, sb );
}

int fstat$INODE64( int fd, struct stat *sb )
{
    return fstat( fd, sb );
}

参考ページ

https://github.com/google/j2objc/issues/395
http://www.tokoro.me/2012/09/02/ghunit-jenkins-coverage/

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6