![]() |
Programmabsturz nur bei Released Version
Hallo zusammen,
bin gerade dabei, für einen Kunden eine ältere Anwendung zu überarbeiten, die eine DLL-Schnittstelle zu einem Druckmessgerät benutzt. Leider habe ich nicht den vollständigen Quellcode bekommen und musste mir die fehlende Teile selbst bauen. Die Anwendung läuft soweit und auch die Schnittstelle funktioniert. Aber nur, wenn ich die Debug-Version verwende. Sobald ich die Anwendung als Release kompiliere, stürzt die Anwendung ohne Fehlermeldung ab sobald auf die DLL-Schnittstelle zugegriffen wird. Die Schnittstelle ist von Systronik, benutzt aber verschiedene QT Bibliotheken. Hat jemand eine Idee? Danke für jede Hilfe Stefan Menten |
AW: Programmabsturz nur bei Released Version
Sieht man was in der Windows Ereignisanzeige?
Bei mir hatte es mal tief im Kernel geknallt, hing aber nicht von Release oder debug ab, sondern hing an einer bestimmten serverversion von Windows. |
AW: Programmabsturz nur bei Released Version
.. Du kannst eventuell mehr sehen, wenn Du dich mit einer anderen Delphi Instanz an den (Release)-Prozess anhängst.
Run- Attach to process Grüße Klaus |
AW: Programmabsturz nur bei Released Version
32 oder 64 Bit? Ist vielleicht in einer Variante ASLR aktiv und in der anderen nicht?
|
AW: Programmabsturz nur bei Released Version
Evtl. nicht korrekt vorbereitete Parameter beim Aufruf einer API Funktion. Meiner Erfahrung nach geht sowas in der IDE oft gut, aber 'in der freien Wildbahn' nicht.
|
AW: Programmabsturz nur bei Released Version
Speicherrandomisierung (ASLR), Codeoptimierung usw., es kann vieles sein, was sich zwischen Release und Debug unterscheiden tut.
Wenn solo oder beim Debuggen in der IDE ... auch da kommen dann z.B. noch Timing-Probleme dazu, beim Threadding usw., welche dann beim Debuggen seltener auftritt. Aber grundsätzlich deutet es darauf hin, dass es eigentlich irgendwo ein Problem gibt. (in eurem Code oder Fremdkomponenten) |
AW: Programmabsturz nur bei Released Version
Hallo zusammen,
danke für die Antworten. Ich habe die Optimierung ausgeschaltet und dann funktioniert es. Kann sein, dass die Schnittstellendatei der DLL nicht stimmt. Die musste ich rekonstruieren weil sie im Quellcode vom Kunden gefehlt hat. Da muss ich den noch mal antriggern, das er mir einen Kontakt zum Lieferantren der Geräte macht. Danke und Gruß Stefan |
AW: Programmabsturz nur bei Released Version
Hi,
I have thoughts on this : Zitat:
So : 1) If there is warnings then handle them all, make sure they are not silenced too for some units with compiler directives. 2) Delphi compiler generate different code for optimized and non-optimized, but one thing is always there, is the heavy usage of the stack, some times the compiler does good job and skip the stack variables storage for every variable, but one thing is sure, with no optimization it always have a copy on the stack of all local variables including record and most likely will save the parameter to the local function/procedure to the stack too, this will leads to expanded stack with no optimization and shorter stack and more condensed with optimization, so in theory without optimization the stack grow further and more likely to land on zero filled stack, and with optimization it more likely will land on already used stack position (aka dirty stack !), in other words, uninitialized variable in a hidden way or non-direct way was zeroed and worked as initialized when the optimization was disabled, look for those, remember this, if you have filled a field in a locally declared record the compiler will not warn about other fields, and will see it as initialized, so a record on the stack easily can produce your problem. 3) Try to enable optimize per unit with compiler directive (adding it on top of the unit file), it might/could narrow your search, though this is tedious, yet it is faster than reviewing all the code, procedure by procedure and line by line. Hope that help and good luck. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:41 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz