473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Bug Jit-Compiler?

Hallo NG, (Crossposting hoffentlich angebracht)

folgender Code (VB 2003) sieht etwas chaotisch und z.T. unsinnig aus, aber
ich habe ihn absichtlich nicht entrümpelt, weil sonst das Problem nicht mehr
reproduzierbar ist. Es muss auch niemand den ganzen Code analysieren,
sondern es geht lediglich um das "Count +=1". Erklärung s.unten. Man nehme
eine neues Winforms-Projekt, füge einen Button und folgenden Code hinzu:
Private Sub Button1_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click

Dim sw As Integer
Dim success As Boolean
Dim starttime, endtime, realendtime As DateTime
Dim count As Integer

Try
Try
Dim s As DateTime
Dim ee As DateTime
starttime = Now
endtime = starttime.AddSeconds(10)
Do While Now.Ticks = starttime.Ticks
Loop
s = Now
'Stop
Do
ee = Now
If ee.Ticks <> s.Ticks Then
s = ee
count += 1
End If
Loop Until count = 10 ' ee >= endtime
'realendtime = DateTime.Now
success = True
Finally
End Try
Finally
End Try

If success Then
MsgBox(sw.ToString("0.000000") & " in " _
& realendtime.Subtract(starttime).ToString)
Dim abweichung As Double
abweichung = _
realendtime.Subtract(starttime).TotalSeconds / sw
MsgBox(abweichung.ToString("0.0000000000000"))
MsgBox(count)
End If

End Sub

Problem ist nun: In der Release-Konfiguration, also mit aktivierten
Optimierungen, wird die Schleife mit "Loop Until count = 10" nie beendet.
Wie ich dann herausfand, wird die Zeile

count += 1

umgesetzt mit

mov dword ptr [ebp-18h],1

Von einer Addition ist nirgends etwas zu sehen. Ist irgendwie ein Bug, oder?
Im IL-Code wird aber noch ordnungsgemäß addiert:

//000080: count += 1
IL_0057: ldloc.0
IL_0058: ldc.i4.1
IL_0059: add
IL_005a: stloc.0
Wenn ich z.B. den unteren Block "If success Then" herausnehme und neu
kompiliere, wird daraus plötzlich ein

inc dword ptr [ebp-18h]

So sollte es eigentlich sein. Daher konnte ich den Code auch nicht
entrümpeln.

Armin

Jan 20 '06 #1
2 1054
"Armin Zingler" <az*******@freenet.de> schrieb
Hallo NG, (Crossposting hoffentlich angebracht)


Sorry, posted to the wrong group. :-/
Armin
Jan 20 '06 #2
"Armin Zingler" <az*******@freenet.de> schrieb
Hallo NG, (Crossposting hoffentlich angebracht)


Natürlich nicht. :-( Habe ich in der anderen Gruppe schon richtiggestellt.
Armin

Jan 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Beau In Texas | last post by:
Hello I am building an Embedded C#.NET with CE 4.2 application on a 150MHz ARM with 32MB SDRAM and 64 SD Card (Flash) My problem is, whenever I have to ColdBoot (rare, but it happens)...
1
JIT
by: Mike Peretz | last post by:
For those of you coding windows Application under the framework you must noticed that forms take a performance hit loading the first time. This is because of JIT, I was able to fix this behavior by...
1
by: Olaf Baeyens | last post by:
Something for the C#/JIT wishlist. I am looking at the generated IL Assembler code and the generated real x86 code and I am facinated about the quality of the generated code. It comes to near...
8
by: John | last post by:
Hi, We have a large asp.net app and have a copy out on the web on a shared server. I believe that the first time you run any portion (.aspx) of the app for the first time the code gets...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
0
by: Benny | last post by:
I have been trying to instal AutoCAD 2008 on a single PC and get the following Microsoft .NET Framework security error. I have updated to the latest .NET Framework 2.0 software, however, this...
1
by: diegodsa | last post by:
Hello: i make an application and its work fine, but, in the client machine i cant make it work. the error description is the next: See the end of this message for details on invoking ...
12
by: hjmjao | last post by:
Hi when I run my application for some users it gives me the following message See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ...
0
by: stimpy_cm | last post by:
Hi everyone, I’m not a programmer but have a little notion about how things work. I recently downloaded an emulator for my calculator (Texas Instruments Voyage 200), the program uses a library...
5
by: arggg | last post by:
I want to make my program so if the dll cannot be found the program will not continue to load. Right now it gives the option to either quit or to continue. I want to make it so the user cannot...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.