Autor Beitrag
N8Falter74
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D7 Prof
BeitragVerfasst: Mo 05.12.05 16:42 
Hallo Forum,

ich habe ein Problem mit der MD5 Hash Unit (md5.pas) von Dimka Maslov
mail@endimus.com, web-site: www.endimus.com

Wobei ich der Meinung bin, das es weniger an der Routiene als an Delphi liegt. Folgendes Phänomen tritt recht häufig in Programmen auf, die diese Unit verwenden:
Bei der Berechnung eines MD5 Hash bricht das Programm mit einem Variablenüberlauf in der
procedure FF(var a: UINT4; b, c, d, x, s, ac: UINT4) ab.

Und jetzt kommts: Wenn der Fehler auftritt, tritt er immer beim Berechnen eines MD5 Hash auf. Wenn ich allerdings das Programm nochmals kompiliere, läuft die MD5 Hash Berechnung ohne Fehler. Manchmal muss ich die Programme auch mehrmals kompilieren - solange bis die EXE ohne
Fehler läuft.

Das sollte ja eigendlich auf einen Hardware Defekt an meinem PC hinweisen, aber warum tritt dann dieser Fehler nur bei dieser einen Unit auf? Der Fehler ist auch unabhängig von der Projekt größe. Ein 10 Zeilen Programm macht den gleichen Mist wie eine komplexe Anwendung mit mehreren MB großer EXE.

Bin etwas ratlos, hat jemand eine Idee woran das liegen kann?

Die MD5.PAS hat ca. 13KB, wenn Sie zur Problemlösung beitragen kann, lade ich Sie gerne hoch.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 05.12.05 17:37 
Welcher Art ist der Fehler?
AV, OutOfBounds, Rangecheck?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
N8Falter74 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D7 Prof
BeitragVerfasst: Fr 09.12.05 12:18 
Hallo

hat etwas gedauert, aber bis gerade ist der fehler nicht mehr aufgetreten.
Die Fehlermeldung lautet:

Debugger Exception
Im Projekt xxxx ist eine Exception der Klasse EIntOverflow aufgetreten. Meldung 'Integerüberlauf'
Prozess wurde.....

Hmm - so langsam glaube ich, dass mein Entwicklungs PC den Geist aufgibt.


Hier die Funktion:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure FF(var a: UINT4; b, c, d, x, s, ac: UINT4);
begin
  a := a + _F(b, c, d) + x + ac;
  a := ROTATE_LEFT (a, s);
  a := a + b;
end;


Werte sind:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
a := 1732584190
b := 4023233417
c := 2562383102
d := 271733878
x := 1127236408
s := 7
ac := 3614090360


Komisch komisch...
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 09.12.05 14:43 
Deaktiviere einmal in den Compiler-Optionen Bound-, Overflow- und Range-Checking. Über eintsprechende Compiler-Direktiven geht das auch lokal für die Unit (IIRC $Q und $R).

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.