Bug 5231 - class_addProperty doesn't exist in iOS4
Summary: class_addProperty doesn't exist in iOS4
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 5.3.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2012-05-22 06:30 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2012-06-04 15:40 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Rolf Bjarne Kvinge [MSFT] 2012-05-22 06:30:14 UTC
class_addProperty doesn't exist in iOS4, so we need to handle this gracefully instead of crashing like this:

http://lists.ximian.com/pipermail/monotouch/2012-May/009735.html
Comment 1 Mikkel 2012-05-24 10:40:28 UTC
Hello,

I think I'm hitting the same issue, although, I'm not getting an exception (MD 3.0.1). The following crash is on an iPhone 3G using MT 5.3.3:

Incident Identifier: 62157FE4-9164-41D8-8BE0-42A7D662AB7F
CrashReporter Key:   5586deda210cf5799b821d3656fe891eb06f22bf
Hardware Model:      iPhone1,2
Process:         MYAPP [752]
Path:            /var/mobile/Applications/DC18E886-8990-4D2D-9FA7-66694D3C4CFF/MYAPP.app/MYAPP
Identifier:      MYAPP
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2012-05-24 16:21:14.332 +0200
OS Version:      iPhone OS 4.2.1 (8C148)
Report Version:  104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread:  0

Dyld Error Message:
  Symbol not found: _class_addProperty
  Referenced from: /var/mobile/Applications/DC18E886-8990-4D2D-9FA7-66694D3C4CFF/MYAPP.app/MYAPP
  Expected in: /usr/lib/libobjc.A.dylib
  Dyld Version: 179.7

Thread 0 Crashed:
0   dyld                          	0x2fe01080 dyld_fatal_error + 0
1   dyld                          	0x2fe028e6 dyld::halt(char const*) + 46
2   dyld                          	0x2fe02996 dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 158
3   libSystem.B.dylib             	0x35e1dff8 dyld_stub_binder + 12
4   MYAPP                   	 	0x0077a6c8 0x1000 + 7837384
5   dyld                          	0x2fe0c2be ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 210
6   dyld                          	0x2fe0c44e ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 14
7   dyld                          	0x2fe0a02e ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 258
8   dyld                          	0x2fe0a488 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 36
9   dyld                          	0x2fe01f2e dyld::initializeMainExecutable() + 374
10  dyld                          	0x2fe06528 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**) + 1484
11  dyld                          	0x2fe01286 dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*) + 506
12  dyld                          	0x2fe01058 _dyld_start + 48

Thread 0 crashed with ARM Thread State:
    r0: 0x2fe2ac70    r1: 0x00000000      r2: 0x0000033c      r3: 0x2fe2ac20
    r4: 0x2fe2ac70    r5: 0x01221e1c      r6: 0x2fdffa70      r7: 0x2fdfec54
    r8: 0x2fe2d644    r9: 0x2fe2a938     r10: 0x2fe2b070     r11: 0x00000000
    ip: 0x2fe0923d    sp: 0x2fdfec50      lr: 0x2fe028ed      pc: 0x2fe01080
  cpsr: 0x00000010

Binary Images:
    0x1000 -   0x90cfff +MYAPP armv6  <00a4b5eb857e33dcbb118015c709c6b8> /var/mobile/Applications/DC18E886-8990-4D2D-9FA7-66694D3C4CFF/MYAPP.app/MYAPP
0x2fe00000 - 0x2fe29fff  dyld armv6  <617f6daf4103547c47a8407a2e0b90de> /usr/lib/dyld
0x30270000 - 0x3027bfff  ITSync armv6  <a451205e89373cbdf0832688085e8f72> /System/Library/PrivateFrameworks/ITSync.framework/ITSync
0x3027c000 - 0x3027efff  IOMobileFramebuffer armv6  <f42bbbf67195a7b98d67ad021bba4784> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer
0x3027f000 - 0x3038dfff  CFNetwork armv6  <d6eeee83216ee9c553134f069f37cbc2> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x303f5000 - 0x30444fff  Security armv6  <cf625b4dc7ea928891313444ef64a7cb> /System/Library/Frameworks/Security.framework/Security
0x30445000 - 0x3055cfff  libicucore.A.dylib armv6  <8968ff3f62d7780bb1bd75026a7628d0> /usr/lib/libicucore.A.dylib
0x305aa000 - 0x30612fff  libvDSP.dylib armv6  <9d264733fc675943c082bd3b9b567b59> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
0x30613000 - 0x3064dfff  MobileCoreServices armv6  <beb473ce80390554bb4af21554522286> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
0x3065c000 - 0x3066efff  libbsm.0.dylib armv6  <51e7bb18da9afa44a33e54e42fbd0707> /usr/lib/libbsm.0.dylib
0x3066f000 - 0x306c6fff  CoreMedia armv6  <cd5e9398c161f129146931e888e1c92e> /System/Library/Frameworks/CoreMedia.framework/CoreMedia
0x306f0000 - 0x306fefff  libz.1.dylib armv6  <84592e96bae1a661374b0f9a5d03a3a0> /usr/lib/libz.1.dylib
0x306ff000 - 0x30729fff  PrintKit armv6  <74f9710fa01a33b5bb04c4aeabd6be7d> /System/Library/PrivateFrameworks/PrintKit.framework/PrintKit
0x307d7000 - 0x3082afff  IOKit armv6  <20da5e822f21a8d0a7c5b3e149330efd> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x30831000 - 0x3083bfff  AccountSettings armv6  <eca67ab04f724e1fa7c6406c88e75433> /System/Library/PrivateFrameworks/AccountSettings.framework/AccountSettings
0x30a04000 - 0x30aa3fff  ProofReader armv6  <2734920b62f174c17aeeb15f371615ef> /System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
0x30ad6000 - 0x30b1afff  AddressBook armv6  <1f30c3370dad27331a491ba4b190813c> /System/Library/Frameworks/AddressBook.framework/AddressBook
0x30b3d000 - 0x30b9cfff  CoreAudio armv6  <ccc4bace0d6eca79a32ed84d566f72e9> /System/Library/Frameworks/CoreAudio.framework/CoreAudio
0x32d7d000 - 0x32d89fff  libkxld.dylib armv6  <f74f359de7bbe3ccdc37fa6f332aebf4> /usr/lib/system/libkxld.dylib
0x32d95000 - 0x32e5cfff  libobjc.A.dylib armv6  <429841269f8bcecd4ba3264a8725dad6> /usr/lib/libobjc.A.dylib
0x32e5d000 - 0x32ecdfff  libsqlite3.dylib armv6  <87b9bb47687902d9120d03d1da9eb9fc> /usr/lib/libsqlite3.dylib
0x33055000 - 0x33061fff  SpringBoardServices armv6  <fd0c472436b3306f5b56118c93c8a423> /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
0x33062000 - 0x3306ffff  MobileBluetooth armv6  <2b68516e1321011a4efbee2947d463c6> /System/Library/PrivateFrameworks/MobileBluetooth.framework/MobileBluetooth
0x33070000 - 0x338bffff  WebCore armv6  <aa3b6827f051da7a3494c9bee4ebe290> /System/Library/PrivateFrameworks/WebCore.framework/WebCore
0x33a21000 - 0x33a6afff  CoreLocation armv6  <a69399375024b2bfae8bb96e845f4fd0> /System/Library/Frameworks/CoreLocation.framework/CoreLocation
0x33ab4000 - 0x33ab4fff  Accelerate armv6  <cdde24a7ad004b2b2e600cd4f3ac5eb7> /System/Library/Frameworks/Accelerate.framework/Accelerate
0x33bbc000 - 0x33c0afff  CoreText armv6  <16c9582fdffb598178287c6ce9fd6897> /System/Library/Frameworks/CoreText.framework/CoreText
0x33c16000 - 0x33d73fff  libGLProgrammability.dylib armv6  <aec6b54ffd532bb607aab4acbab679b6> /System/Library/Frameworks/OpenGLES.framework/libGLProgrammability.dylib
0x33d85000 - 0x33e71fff  QuartzCore armv6  <77cd91ff21fe6c58c309f2c82eb95ca5> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x33e72000 - 0x33e81fff  GraphicsServices armv6  <af20aba0ec96e7b7c42bb55ac763c784> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x33ead000 - 0x33f6efff  ImageIO armv6  <0c1b6f466667ff345f2399d8142a9d10> /System/Library/Frameworks/ImageIO.framework/ImageIO
0x33f78000 - 0x33f79fff  CoreSurface armv6  <5e290514380c626e9b0f9f9985b9dc7a> /System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface
0x343a0000 - 0x343bffff  Bom armv6  <f41bef81e23e2bff59155e5ce46762d3> /System/Library/PrivateFrameworks/Bom.framework/Bom
0x343c0000 - 0x344bdfff  JavaScriptCore armv6  <3547c92c1efc0522b087e7f10eba7728> /System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore
0x34b52000 - 0x34f1ffff  libLAPACK.dylib armv6  <0eb734c91165416224b98c943ff6476b> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
0x34f20000 - 0x35014fff  libiconv.2.dylib armv6  <01916d6784f4de8f3746978faae9c5fa> /usr/lib/libiconv.2.dylib
0x35015000 - 0x35022fff  CoreVideo armv6  <7b100fd5fdf98db1cd0f0649e7f6f316> /System/Library/Frameworks/CoreVideo.framework/CoreVideo
0x35087000 - 0x35148fff  AddressBookUI armv6  <fea72732451610277e22a667d35ad76d> /System/Library/Frameworks/AddressBookUI.framework/AddressBookUI
0x35151000 - 0x35272fff  Foundation armv6  <6bdeb19a1fcb93e2930dadb50416f881> /System/Library/Frameworks/Foundation.framework/Foundation
0x3529b000 - 0x352a6fff  libbz2.1.0.dylib armv6  <6aa8a4ed0906a495d059ace9125f525d> /usr/lib/libbz2.1.0.dylib
0x352dc000 - 0x35342fff  libBLAS.dylib armv6  <11a3677a08175a30df1b3d66d7e0951a> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
0x35348000 - 0x353b0fff  GMM armv6  <adcdfedd491ac237b385b6c2d7f684e3> /System/Library/PrivateFrameworks/GMM.framework/GMM
0x35406000 - 0x35406fff  vecLib armv6  <8f914b3e8a581d49fb21d2c0ff75be03> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
0x35407000 - 0x3540afff  MobileInstallation armv6  <456ed7fe6dd9fcd8e78df425085b1452> /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
0x35541000 - 0x35547fff  MBX2D armv6  <fad4955cab36e0179df6f8f27d365b8f> /System/Library/PrivateFrameworks/MBX2D.framework/MBX2D
0x35815000 - 0x3581afff  AssetsLibraryServices armv6  <224b3cf992a01814f91481244e3213eb> /System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
0x3581b000 - 0x35877fff  libGLImage.dylib armv6  <7c1049f20c4e64591c09d3ac00c7d3ab> /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
0x358bc000 - 0x358c3fff  liblockdown.dylib armv6  <f470dea180ddf23886df75eb256d3888> /usr/lib/liblockdown.dylib
0x358cc000 - 0x358cffff  libgcc_s.1.dylib armv6  <bed95ed187350ce27d22ed241ef892ea> /usr/lib/libgcc_s.1.dylib
0x358d3000 - 0x35d4ffff  UIKit armv6  <14ec6c926b8bda71b73136f6e1a6ac1b> /System/Library/Frameworks/UIKit.framework/UIKit
0x35d5a000 - 0x35e98fff  libSystem.B.dylib armv6  <70571c1e697e2ae7f7a9b1a499453bb6> /usr/lib/libSystem.B.dylib
0x35f7e000 - 0x35fc2fff  VideoToolbox armv6  <101dbbcd34cc3231a8be3fd6392556aa> /System/Library/PrivateFrameworks/VideoToolbox.framework/VideoToolbox
0x35fdb000 - 0x36162fff  CoreGraphics armv6  <9a1d72fa9549d83abc1e735ba37a4dc2> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x36167000 - 0x36178fff  DataAccessExpress armv6  <c112bd2791eb706526db25407ec117d4> /System/Library/PrivateFrameworks/DataAccessExpress.framework/DataAccessExpress
0x36179000 - 0x36255fff  WebKit armv6  <83da207070be989ba81dba3a83d5206a> /System/Library/PrivateFrameworks/WebKit.framework/WebKit
0x36269000 - 0x36278fff  OpenGLES armv6  <37eda5ddcff210dd321157da35a87a5e> /System/Library/Frameworks/OpenGLES.framework/OpenGLES
0x36279000 - 0x36362fff  MapKit armv6  <d28b96a0107a7822fda677ed28901c0c> /System/Library/Frameworks/MapKit.framework/MapKit
0x363f3000 - 0x363f9fff  MobileKeyBag armv6  <2d83bf6a43bab972d77a1a6e0f3b03d2> /System/Library/PrivateFrameworks/MobileKeyBag.framework/MobileKeyBag
0x36500000 - 0x36508fff  ProtocolBuffer armv6  <8ed6e560e85eecfaf625219a8247aea4> /System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer
0x365db000 - 0x365f9fff  libresolv.9.dylib armv6  <9c94634beea733e754dc115737b6e63c> /usr/lib/libresolv.9.dylib
0x36746000 - 0x3683cfff  libxml2.2.dylib armv6  <9c44d05cc67f1ebabd795903e581724e> /usr/lib/libxml2.2.dylib
0x3694c000 - 0x3694ffff  libAccessibility.dylib armv6  <74e0f77cc276a9412be268c795fdcbca> /usr/lib/libAccessibility.dylib
0x36955000 - 0x36a1ffff  Celestial armv6  <11172a6ee53bdf067548cd4496bc5fe0> /System/Library/PrivateFrameworks/Celestial.framework/Celestial
0x36a2d000 - 0x36a30fff  CrashReporterSupport armv6  <00bc60f690e6328b64e7a7b718edf45a> /System/Library/PrivateFrameworks/CrashReporterSupport.framework/CrashReporterSupport
0x36a31000 - 0x36a74fff  CoreTelephony armv6  <cabbce0fa7630065dc7e7d3ca3bc616c> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x36c1c000 - 0x36c26fff  AggregateDictionary armv6  <f7429444c955e4f13c6761d20032ab52> /System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary
0x36c2b000 - 0x36de1fff  AudioToolbox armv6  <bb65e8ed531fe5923eb8ac00a7c0d87d> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x36de2000 - 0x36e16fff  AppSupport armv6  <783e14db9585fd063c0c2a755cd121b6> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
0x36e2e000 - 0x37140fff  GeoServices armv6  <570238d025d41838cc888a0b3f28f4b2> /System/Library/PrivateFrameworks/GeoServices.framework/GeoServices
0x37141000 - 0x37184fff  SystemConfiguration armv6  <207f362e707871e74a292cfd1ea7893d> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x372aa000 - 0x37477fff  MediaToolbox armv6  <21ceabd0e5de17ad4e883c85fcd34d51> /System/Library/PrivateFrameworks/MediaToolbox.framework/MediaToolbox
0x37478000 - 0x3747dfff  IOSurface armv6  <ffd66ca04dfe7d382d6961f0df3839ff> /System/Library/PrivateFrameworks/IOSurface.framework/IOSurface
0x3748d000 - 0x374f8fff  libstdc++.6.dylib armv6  <eccd1d7183e73587b2c0aa5755a19c39> /usr/lib/libstdc++.6.dylib
0x374f9000 - 0x375e4fff  CoreFoundation armv6  <ab0eac0ddd5b4ae1bf8541116e3c0bd1> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x37731000 - 0x37736fff  libGFXShared.dylib armv6  <bd1c480607cc286288db1ca1aec64180> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
0x37992000 - 0x37999fff  libMobileGestalt.dylib armv6  <de9b417e7278742e90b30b1ad45f31fa> /usr/lib/libMobileGestalt.dylib
MYAPP

Can I do something to prevent this or should I wait for the next update?

Mikkel
Comment 2 Rolf Bjarne Kvinge [MSFT] 2012-05-29 17:22:25 UTC
Fixed in monotouch master (72fb3e59db63976e63416ae9b126a646e32476de).

The next release with this fix will be 5.3.5.
Comment 3 Duncan Mak 2012-06-04 15:40:27 UTC
This commit has been picked onto the 5.3.4 release.

The cherry-pick hash is abd3c5c3e15d89cfe55d2343663ff116f798ea8e