1. Alexander Manes
  2. PowerBuilder
  3. Wednesday, 7 December 2022 10:25 PM UTC

Hello everybody,

since PB2021 (and still in PB2022) customers irregularly report application crashes which we did not have before.
In a recent case we were finally able to track this down to a very special behavior we see in PB2021 and PB2022.

We would like to know whether this is a bug (that will be fixed) or whether this is a change by design which we need to understand entirely to make the appropriate changes to our applications?!

What we discovered:

In our applications, we react to Key Events, e.g. ESC for closing an applocation window, and we also react to custom User Events which are sent from a DLL written in C++ to our applications frame windows. 

We discovered that, starting with PB2021, when such a Key Event or User Event is fired, the normal code executing which is currently happening in our application is interrupted and the code of the Key Event or User Event (and all subsequent function calls from this code) is executed immediately. After all that code from the Key Event or User Event is executed, normal code execution is continuing from the step where it was interrupted.

This sometimes causes the crashes e.g. when opening a window is suddenly interrupted by the Key Event or User Event and the code of these events wants to access components which are not yet initialized because opening and initialization of the window is not completed yet.

Prior to PB2021, this behavior was different: e.g. the window opened completely and Key Events and User Events were queued in a message queue and executed afterwards. There was no interruption of code execution.

We were forced to do a quick workaround by writing a second event and calling this event with "Post Event ue_myuserevent2" from the original User Event "ue_myuserevent". Using "Post Event" actually restored the behavior we knew up until PB2019.

Why is this? Can anyone explain whether this is a bug or by design?

 

--- Code Examples and Call Stacks ---

The call stack in the first screenshot shows, that the opening process of a response window is suddenly interrupted, here in the middle of the resize event, when the User Event "ue_handlemessageext" is fired and reached our application's frame windows:

 

The second screenshot shows our workaround:

Inside the User Event that interrupts normal code execution, we use "Post Event" to a second event which contains the actual code we want to execute AFTER the window is completely openend. Of course, "Post Event" puts this at the end of the message queue.
But do we really need to go through all of our code and make these changes for PB2021 and following PB versions???

 


Responses (3)
  1. Likes
  2. Latest
  3. Oldest
Loading...

Find Questions by Tag

.EXE .NET 6.0 .NET Assembly .NET Core 3.1 .NET Core Framework .NET DataStore .NET Std Framework 32-bit 64-bit ADO.NET AEM AI Algorithm Amazon AWS Android Apache API APK App Store App Store (Apple) Appeon Workspace Appeon Xcelerator Plug-in Architecture Array ASE Asynchronous Methods Authentication AutoBuild AutoCompiler Automated Testing Automation AutoScript Azure Barcode Base64 Batch BigData BLOB Branch & Merge Browser Bug Build Button C# C# Class Importer C# Editor C# Model generator Calendar Camera Certificate Chrome Citrix Class Client Client/Server Cloud Cluster Collection COM Command Line Compiler Compression Computed Field Configuration Controls Cookies Cordova Crash Cross-Platform Crosstab CSharpAssembly CSharpObject CSS CSV Cursor Data Database Database Driver Database Painter Database Profile Database Provider DataObject DataSource DataStore DataStore (C#) DataStore (PS) DataType DataWindow DATE DATETIME DB2 Debug Debugger Debugging Deployment Design DLL DO-WHILE Dockable Docker Documentation DOUBLE Download DragDrop Edge Edit Style Editor Elevate Conference Email Embedded SQL Emulator Encoding Encryption Enhancement Request Entity Entity Framework ERP Error Event Event Handler Event Handling Excel Exception Export Expression External Functions F# Field File File Access Filter Firefox Firewall Font FOR-NEXT Foreground Format Function Garbage Collection GeoLocation Git Graph HANA Hash Header HTML/5 HTTP/S HTTPClient Icon IDE Identity IIS IMAPI Import InfoMaker Inheritance Installation Integer IntelliSense Interface Internet Internet Explorer iOS IPA iPad iPhone IWA J# Java JavaScript JBoss JDBC JOIN JSON JSONGenerator JSONParser Kestrel Label Lambda Large File LDAP Library License LINQ Linux OS Load Balancing Localization Localized PBVM Log In Log Out Logging LONG LONGLONG macOS MAPI Maps MDI Memory Memory Leak Menu Merge MessageBox Messagging Method Migration MIME TYPE Mobile Model ModelStore ModelStore (C#) MSOLEDBSQL Multi Threading MVC MySQL n-Tier Namespace NativePDF NVO OAuth ODATA ODBC Office Offline OLE OLEDB Online Open Source OpenAPI OpenSSL Oracle OrcaScript Other Outlook Output Package Parameter Patch PayPal PB Classic PB Native PB.NET PBC PBD PBDOM PBG PBJVM PBL PBNI PBORCA PBVM PBX PDF Performance Permission PFC Picture Pipeline Play Store (Google) Plugin Popup Port POST PostgreSQL PowerBuilder PowerBuilder (Appeon) PowerBuilder (SAP) PowerBuilder Compiler PowerBuilder Runtime PowerClient PowerScript (PS) PowerScript IDE PowerScript Migrator PowerServer PowerServer Mobile PowerServer Toolkit PowerServer Web PowerServerLabel Print Properties Proxy Publish PULL PUSH Query Regression Release Renew Resize Response REST Retrieve RibbonBar RibbonBar Builder Rich Text Roadmap RPC Runtime Packager SaaS Scaffolding Script SDI SDK Security Server Service Session Single Sign-on Size SMTP SMTPClient SnapDevelop SOAP Sort Source Code Speech Recognition SQL SQL Anywhere SQL Server SqlBuilder SqlExecutor SQLite SqlModelMapper Storage Stored Procedure Subscription SVN Swagger Syntax TabbedBar TabbedView Tablet TabPage Target TE Control Testing Text TFS Theme TIME Timer TLS/SSL Tomcat TortoiseGit TortoiseSVN Transaction Transparency Trial Trigger TRY-CATCH TX Control Type UI ULONG UltraLite Uninstall Unit Test Unit Testing UNIX OS Update Upgrade Upload URL User Center User Object UWP Validation VARCHAR Variable Versioning Visual Studio Visual Studio Code VM Voice Warning WCF Web API Web Extensions Web Service WebBrowser WebForms WebLogic WebSphere WildFly WinAPI Window Windows OS WinForms Wizard Workgroup Workspace WPF XCODE XHTML XML Zoom

Helpful?

If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.