Bug 266 - While Overriding UITextField's TextRect method and setting a placeholder will cause an app crash
Summary: While Overriding UITextField's TextRect method and setting a placeholder will...
Status: RESOLVED DUPLICATE of bug 265
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-08-11 10:10 UTC by Jason Trahan
Modified: 2011-08-11 16:14 UTC (History)
2 users (show)

Tags: UITextField Placeholder
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 DUPLICATE of bug 265

Description Jason Trahan 2011-08-11 10:10:17 UTC
Steps to reproduce.
1. Create a new class and inherit UITextField
2. Override the TextRect method but do not make any changes
3. Initialize an instance of the inherited UITextField and set the PlaceHolder Property.

Workaround:
[Export("textRectForBounds:")]
RectangleF TextRectFix()
{
   var rect = base.TextRect(this.Bounds);
   return RectangleF.Inflate(rect, -5, -5);
}


Stacktrace:

  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
  at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Developer/MonoTouch/Source/monotouch/monotouch/UIKit/UIApplication.cs:26
  at MonoTouch.UIKit.UIApplication.Main (string[]) [0x00000] in /Developer/MonoTouch/Source/monotouch/monotouch/UIKit/UIApplication.cs:31
  at MonoKeyboardTestProject.Application.Main (string[]) [0x00000] in /Volumes/Projects/MonoTouch/MonoKeyboardTestProject/MonoKeyboardTestProject/Main.cs:13
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>

Native stacktrace:

	0   MonoKeyboardTestProject             0x000d0de8 mono_handle_native_sigsegv + 343
	1   MonoKeyboardTestProject             0x0000f74c mono_sigsegv_signal_handler + 322
	2   libSystem.B.dylib                   0x99da905b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   MonoKeyboardTestProject             0x0029fe59 monotouch_x86_double_abi_stret_trampoline + 144
	5   UIKit                               0x01d707b8 -[UITextField placeholderRectForBounds:] + 138
	6   UIKit                               0x01d70e97 -[UITextField layoutSubviews] + 618
	7   QuartzCore                          0x031b1a5a -[CALayer layoutSublayers] + 181
	8   QuartzCore                          0x031b3ddc CALayerLayoutIfNeeded + 220
	9   QuartzCore                          0x031590b4 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
	10  QuartzCore                          0x0315a294 _ZN2CA11Transaction6commitEv + 292
	11  UIKit                               0x01cd69c9 -[UIApplication _reportAppLaunchFinished] + 39
	12  UIKit                               0x01cd6e83 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 690
	13  UIKit                               0x01ce1617 -[UIApplication handleEvent:withNewEvent:] + 1533
	14  UIKit                               0x01cd9abf -[UIApplication sendEvent:] + 71
	15  UIKit                               0x01cdef2e _UIApplicationHandleEvent + 7576
	16  GraphicsServices                    0x0404f992 PurpleEventCallback + 1550
	17  CoreFoundation                      0x00ea2944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
	18  CoreFoundation                      0x00e02cf7 __CFRunLoopDoSource1 + 215
	19  CoreFoundation                      0x00dfff83 __CFRunLoopRun + 979
	20  CoreFoundation                      0x00dff840 CFRunLoopRunSpecific + 208
	21  CoreFoundation                      0x00dff761 CFRunLoopRunInMode + 97
	22  UIKit                               0x01cd67d2 -[UIApplication _run] + 623
	23  UIKit                               0x01ce2c93 UIApplicationMain + 1160
	24  ???                                 0x09eb4ed3 0x0 + 166416083
	25  ???                                 0x09eb4ca4 0x0 + 166415524
	26  ???                                 0x09eb42a4 0x0 + 166412964
	27  ???                                 0x09eb40fc 0x0 + 166412540
	28  ???                                 0x09eb424e 0x0 + 166412878
	29  MonoKeyboardTestProject             0x0000f507 mono_jit_runtime_invoke + 1332
	30  MonoKeyboardTestProject             0x001ed259 mono_runtime_invoke + 137
	31  MonoKeyboardTestProject             0x001ef940 mono_runtime_exec_main + 669
	32  MonoKeyboardTestProject             0x001eed2a mono_runtime_run_main + 843
	33  MonoKeyboardTestProject             0x000a3093 mono_jit_exec + 200
	34  MonoKeyboardTestProject             0x002a163d main + 4060
	35  MonoKeyboardTestProject             0x00002819 _start + 208
	36  MonoKeyboardTestProject             0x00002748 start + 40

Debug info from gdb:

dyld: could not load inserted library: /Users/Lunatik/Library/Application Support/iPhone Simulator/4.3/Applications/6FA37E53-04E7-4178-B12A-DEF0AEF25447/MonoKeyboardTestProject.app/monotouch-fixes.dylib


=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Comment 1 Jason Trahan 2011-08-11 10:12:32 UTC
This also happens when overriding just the PlaceHolderRect method.
Comment 2 Sebastien Pouliot 2011-08-11 16:14:46 UTC
same ABI issue as 265 (test case also part of 265)

*** This bug has been marked as a duplicate of bug 265 ***