[Mono-bugs] [Bug 551494] New: new Uri causes exception when run in the debugger

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Oct 30 14:21:58 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=551494


           Summary: new Uri causes exception when run in the debugger
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Debugger
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: duane at wandless.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


I had to add the try catch to begin to understand the crash.  At first the app
would just become unresponsive.

I added this code to an empty iPhone project.  Uri uriValue = null is class
variable.

            try
            {
                    uriValue = new Uri("http://www.yahoo.com");
            }
            catch (Exception err)
            {
                Console.WriteLine("error={0}", err.Message);
            }

While in the debugger this causes:
error=startIndex > this.length
Parameter name: startIndex

"  at System.String.IndexOf (Char value, Int32 startIndex) [0x00063] in
/Users/plasma/src/WORK/monotouch-1.1/mcs/class/corlib/System/String.cs:1116 \n 
at System.Uri.ParseNoExceptions (UriKind kind, System.String uriString)
[0x00144] in
/Users/plasma/src/WORK/monotouch-1.1/mcs/class/System/System/Uri.cs:1422 \n  at
System.Uri.Parse (UriKind kind, System.String uriString) [0x00011] in
/Users/plasma/src/WORK/monotouch-1.1/mcs/class/System/System/Uri.cs:1341 \n  at
System.Uri.ParseUri (UriKind kind) [0x00000] in
/Users/plasma/src/WORK/monotouch-1.1/mcs/class/System/System/Uri.cs:1211 \n  at
System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00064] in
/Users/plasma/src/WORK/monotouch-1.1/mcs/class/System/System/Uri.cs:209 \n  at
System.Uri..ctor (System.String uriString) [0x00000] \n  at
testcase1.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app,
MonoTouch.Foundation.NSDictionary options) [0x00000] in
/Users/me/PixSrc/MonoTouch/tokyo/i2/testcase1/Main.cs:32 "


sometimes this code would yield this stack info.  But never did I see both. 
And usually when not in the debugger the code executes.

Loaded assembly: /Users/dwandless/Library/Application Support/iPhone
Simulator/User/Applications/6AF69083-09FE-48CE-9CFE-2A85DEF0EBF6/testcase1.app/testcase1.exe

Loaded assembly: /Users/dwandless/Library/Application Support/iPhone
Simulator/User/Applications/6AF69083-09FE-48CE-9CFE-2A85DEF0EBF6/testcase1.app/monotouch.dll
Loaded assembly: /Users/dwandless/Library/Application Support/iPhone
Simulator/User/Applications/6AF69083-09FE-48CE-9CFE-2A85DEF0EBF6/testcase1.app/System.dll

Resolved pending breakpoint at 'Main.cs:32' to Boolean
testcase1.AppDelegate:FinishedLaunching ():6.

Resolved pending breakpoint at 'Main.cs:39' to Boolean
testcase1.AppDelegate:FinishedLaunching ():22.

Resolved pending breakpoint at 'Main.cs:45' to Boolean
testcase1.AppDelegate:FinishedLaunching ():62.

Resolved pending breakpoint at 'Main.cs:40' to Boolean
testcase1.AppDelegate:FinishedLaunching ():28.
* Assertion: should not be reached at
./../../../mono/mini/debugger-agent.c:2251
Stacktrace:

  at (wrapper managed-to-native)
MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr)
<0x00004>
  at (wrapper managed-to-native)
MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr)
<0x00004>
  at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00038] in
/Users/plasma/src/WORK/monotouch-1.1/iphone/monotouch/UIKit/UIApplication.cs:26
  at MonoTouch.UIKit.UIApplication.Main (string[]) [0x00000] in
/Users/plasma/src/WORK/monotouch-1.1/iphone/monotouch/UIKit/UIApplication.cs:31
  at testcase1.Application.Main (string[]) [0x00000] in
/Users/dwandless/PixSrc/MonoTouch/tokyo/iPIX2/testcase1/Main.cs:14
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object
(object,intptr,intptr,intptr) <IL 0x0001d, 0x00090>

Native stacktrace:

    0   testcase1                           0x00094e0a
mono_handle_native_sigsegv + 266
    1   libSystem.B.dylib                   0x904a1b9b _sigtramp + 43
    2   ???                                 0xffffffff 0x0 + 4294967295
    3   libSystem.B.dylib                   0x9052fb99 raise + 26
    4   libSystem.B.dylib                   0x90545c50 abort + 93
    5   testcase1                           0x001e8e4c g_logv + 195
    6   testcase1                           0x001e8e7e g_log + 44
    7   testcase1                           0x000aafde insert_breakpoint + 94
    8   testcase1                           0x000b5952 jit_end + 402
    9   testcase1                           0x00173a13
mono_profiler_method_end_jit + 99
    10  testcase1                           0x0000d075
mono_jit_compile_method_with_opt + 2181
    11  testcase1                           0x0000daa9 mono_jit_runtime_invoke
+ 841
    12  testcase1                           0x0016819b mono_runtime_invoke + 75
    13  testcase1                           0x00205e90 monotouch_trampoline +
1552
    14  UIKit                               0x00eda5db -[UIApplication
_performInitializationWithURL:sourceBundleID:] + 432
    15  UIKit                               0x00ee3a0a -[UIApplication
_runWithURL:sourceBundleID:] + 594
    16  UIKit                               0x00ee0b88 -[UIApplication
handleEvent:withNewEvent:] + 1532
    17  UIKit                               0x00edc6d3 -[UIApplication
sendEvent:] + 71
    18  UIKit                               0x00ee30b5
_UIApplicationHandleEvent + 5048
    19  GraphicsServices                    0x03227ef1 PurpleEventCallback +
1533
    20  CoreFoundation                      0x003feb80 CFRunLoopRunSpecific +
3888
    21  CoreFoundation                      0x003fdc48 CFRunLoopRunInMode + 88
    22  UIKit                               0x00edae69 -[UIApplication _run] +
611
    23  UIKit                               0x00ee4003 UIApplicationMain + 1157
    24  ???                                 0x057e80ea 0x0 + 92176618
    25  ???                                 0x057e7eba 0x0 + 92176058
    26  ???                                 0x057e724a 0x0 + 92172874
    27  ???                                 0x057e70ac 0x0 + 92172460
    28  ???                                 0x057e7161 0x0 + 92172641
    29  testcase1                           0x0000d7fd mono_jit_runtime_invoke
+ 157
    30  testcase1                           0x0016819b mono_runtime_invoke + 75
    31  testcase1                           0x0016d37b mono_runtime_exec_main +
251
    32  testcase1                           0x0016ffa5 mono_runtime_run_main +
405
    33  testcase1                           0x00208996 main + 2470
    34  testcase1                           0x00002c86 start + 54

Debug info from gdb:

warning: Trying to remove a section from the ordered section list that did not
exist at 0x2e9000.
warning: Could not find object file
"/var/folders/dw/dw4h6pSeFyq4PSZ0GcNCLk+++TQ/-Tmp-/tmp7b6a6e2.tmp/main.o" - no
debug information available for
"/var/folders/dw/dw4h6pSeFyq4PSZ0GcNCLk+++TQ/-Tmp-/tmp7b6a6e2.tmp/main.m".

Attaching to process 2332.
Reading symbols for shared libraries . done
Reading symbols for shared libraries
................................................................................
done
0x90446af9 in read$UNIX2003 ()
  6 port# 0x3803 0x9043b7da in mach_msg_trap ()
  5 port# 0x3603 0x90446afe in read$UNIX2003 ()
  4 port# 0x3403 0x9043b816 in semaphore_wait_trap ()
  3 port# 0x3003 0x90469782 in __semwait_signal ()
  2 port# 0x1f03 0x9043b7da in mach_msg_trap ()
* 1 port# 0x207  0x90446af9 in read$UNIX2003 ()

Thread 6 (process 2332):
#0  0x9043b7da in mach_msg_trap ()
#1  0x9043bf47 in mach_msg ()
#2  0x003fe382 in CFRunLoopRunSpecific ()
#3  0x003fdc48 in CFRunLoopRunInMode ()
#4  0x03464803 in RunWebThread ()
#5  0x90468f39 in _pthread_start ()
#6  0x90468dbe in thread_start ()

Thread 5 (process 2332):
#0  0x90446afe in read$UNIX2003 ()
#1  0x000b78e0 in debugger_thread (arg=0x0) at
./../../../mono/mini/debugger-agent.c:4937
#2  0x001d69a6 in thread_start_routine (args=0x70007a8) at
./../../../mono/io-layer/wthreads.c:286
#3  0x0020110c in GC_start_routine (arg=0x5144f60) at
./../../libgc/pthread_support.c:1390
#4  0x90468f39 in _pthread_start ()
#5  0x90468dbe in thread_start ()

Thread 4 (process 2332):
#0  0x9043b816 in semaphore_wait_trap ()
#1  0x001109c0 in finalizer_thread (unused=0x0) at
./../../../mono/metadata/gc.c:1022
#2  0x001a2196 in start_wrapper (data=0x6e015a0) at
./../../../mono/metadata/threads.c:662
#3  0x001d69a6 in thread_start_routine (args=0x70006b0) at
./../../../mono/io-layer/wthreads.c:286
#4  0x0020110c in GC_start_routine (arg=0x5144f60) at
./../../libgc/pthread_support.c:1390
#5  0x90468f39 in _pthread_start ()
#6  0x90468dbe in thread_start ()

Thread 3 (process 2332):
#0  0x90469782 in __semwait_signal ()
#1  0x90495621 in nanosleep$UNIX2003 ()
#2  0x001b8ca0 in collection_thread (unused=0x0) at
./../../../mono/io-layer/collection.c:34
#3  0x90468f39 in _pthread_start ()
#4  0x90468dbe in thread_start ()

Thread 2 (process 2332):
#0  0x9043b7da in mach_msg_trap ()
#1  0x9043bf47 in mach_msg ()
#2  0x000d813a in mach_exception_thread (arg=0x0) at
./../../../mono/mini/mini-darwin.c:131
#3  0x0020110c in GC_start_routine (arg=0x5144f60) at
./../../libgc/pthread_support.c:1390
#4  0x90468f39 in _pthread_start ()
#5  0x90468dbe in thread_start ()

Thread 1 (process 2332):
#0  0x90446af9 in read$UNIX2003 ()
#1  0x00094f4a in mono_handle_native_sigsegv (signal=6, ctx=0xbfffda7c) at
./../../../mono/mini/mini-exceptions.c:1808
#2  <signal handler called>
#3  0x9049c912 in __kill ()
#4  0x9049c904 in kill$UNIX2003 ()
#5  0x9052fb99 in raise ()
#6  0x90545c50 in abort ()
#7  0x001e8e4c in g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR,
format=0x28d5dc "* Assertion: should not be reached at %s:%d\n",
args=0xbfffdb8c "�h)") at ../../../../eglib/src/goutput.c:79
#8  0x001e8e7e in g_log (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR,
format=0x28d5dc "* Assertion: should not be reached at %s:%d\n") at
./../../../eglib/src/goutput.c:89
#9  0x000aafde in g_malloc0 [inlined] () at :2251
#10 0x000aafde in insert_breakpoint (seq_points=<value temporarily unavailable,
due to optimizations>, ji=0x70845dc, bp=0x6e42860) at
./../../../mono/mini/debugger-agent.c:2253
#11 0x000b5952 in jit_end (prof=0x0, method=0x700010c, jinfo=0x70845dc,
result=0) at ../../../../mono/mini/debugger-agent.c:2329
#12 0x00173a13 in mono_profiler_method_end_jit (method=0x700010c,
jinfo=0x70845dc, result=0) at ../../../../mono/metadata/profiler.c:327
#13 0x0000d075 in mono_jit_compile_method_with_opt (method=0x700010c,
opt=64055679, ex=0xbfffdd6c) at ../../../../mono/mini/mini.c:4258
#14 0x0000daa9 in mono_jit_runtime_invoke (method=0x700010c, obj=0x6d85fa0,
params=0xbfffddd0, exc=0x0) at ../../../../mono/mini/mini.c:4499
#15 0x0016819b in mono_runtime_invoke (method=0x700010c, obj=0x0, params=0x0,
exc=0x0) at ../../../../mono/metadata/object.c:2590
#16 0x00205e90 in monotouch_trampoline ()
#17 0x00eda5db in -[UIApplication
_performInitializationWithURL:sourceBundleID:] ()
#18 0x00ee3a0a in -[UIApplication _runWithURL:sourceBundleID:] ()
#19 0x00ee0b88 in -[UIApplication handleEvent:withNewEvent:] ()
#20 0x00edc6d3 in -[UIApplication sendEvent:] ()
#21 0x00ee30b5 in _UIApplicationHandleEvent ()
#22 0x03227ef1 in PurpleEventCallback ()
#23 0x003feb80 in CFRunLoopRunSpecific ()
#24 0x003fdc48 in CFRunLoopRunInMode ()
#25 0x00edae69 in -[UIApplication _run] ()
#26 0x00ee4003 in UIApplicationMain ()
#27 0x057e80ea in ?? ()
#28 0x057e7eba in ?? ()
#29 0x057e724a in ?? ()
#30 0x057e70ac in ?? ()
#31 0x057e7161 in ?? ()
#32 0x0000d7fd in mono_jit_runtime_invoke (method=0x58565ec, obj=0x0,
params=0xbffff02c, exc=0x0) at ../../../../mono/mini/mini.c:4654
#33 0x0016819b in mono_runtime_invoke (method=0x58565ec, obj=0x0, params=0x0,
exc=0x0) at ../../../../mono/metadata/object.c:2590
#34 0x0016d37b in mono_runtime_exec_main (method=0x58565ec, args=0x6d96b20,
exc=0x0) at ../../../../mono/metadata/object.c:3525
#35 0x0016ffa5 in mono_runtime_run_main (method=0x58565ec, argc=0,
argv=0xbffff1b0, exc=0x0) at ../../../../mono/metadata/object.c:3305
#36 0x00208996 in main ()

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list