Home
What's New
Dev Tools
Services
Feedback
Site Map

1. PowerBuilder Bugs: Introduction

PowerBuilder is a very large product and, in any release, will have a number of bugs. Fortunately PowerSoft does seem to do a good job at finding and fixing serious bugs before making the latest version available for general use. However, in any release, there are a significant number of smaller bugs that developers will encounter. It is rare that a bug you find cannot be worked around in some manner. By definition, a workaround is usable but not ideal.

2. Qualifying Bugs as your Problem or PowerBuilder's

The first thing to do when dealing with a tricky bug is to try to determine for certain whether the problem is yours or PowerBuilder's.

If PowerBuilder GPFs without giving an application error, then you have generally found a bona fide PowerBuilder bug. On the other hand, if you've received a clear PowerBuilder application error (e.g. divide by zero, array boundary exceeded, invalid row/column referenced), then this is usually a clear code problem that can be fixed by debugging. A full list of execution error numbers of their meanings is provided on this site.

With most tricky bugs, you simply get unpredictable results. Careful debugging should lead you to the line or line(s) with the problem but the solution is unclear and you have to determine whether it is a PowerBuilder problem. Here are some actions to take to determine if the problem is PowerBuilder's and not yours:

Action Details
Check your Search Path Check / confirm your search path to confirm all your application objects are where you expect
Re-optimize & regenerate Re-optimize all your PBLs and do a full rebuild/regenerate on your application (regenerate/rebuild twice to be sure). Use the project painter to be sure. Consider using a simple/safe EXE configuration to reduce the number of problems that you can encounter.
Check Help Carefully check the help: are you sure that you are using utilities/events correctly?
Check Sample Code If there are relevant examples in the PowerBuilder (and/or PFC) examples directory, see how similar actions are carried out there. The help code samples often don't include enough "meat" to really understand a point but the sample applications that PowerSoft provides do
Check Instatiation - If working with an non-visual object (NVO or custom class user object), are you sure that you have created the object?
- Conversely, have you confirmed that you've destroyed the object? Have you destroyed the object once (and not twice)?
- Have you made sure that you don't execute lines of code after you've destroyed the object or closed the window?
- If you've tried to close a window, have you posted the close? If you are in the window open or pre-open event, you are liable to get a GPF if you issue a close before the window initialization is complete. Posting the close avoids this.
Implement the Solution differently Try to implement the apparent problem in a parallel manner (e.g. use a function instead of an event or vice-versa, uses GetItem instead of Object syntax) and see if the problem goes away. If the problem does go away in a parallel setting, this will almost certainly rule out the problem as yours.
Check the Infobase Detailed instructions on checking the Infobase online are provided below.
Ask others for Help Particularly if you haven't been using PowerBuilder for at least 6 months, try to check with a more experienced developer to see if he or she thinks it is a PowerBuilder problem. If there is no one in house, the PowerBuilder NewsGroups are a very good source.

Also review the table "cryptic errors that mean something" for possible problems/solutions.

If your problem occurs in an EXE but not the development environment, check a tip on that topic.

3. Looking for the Problem on PowerSoft's Website

PowerSoft keeps a list of known/acknowledged problems on their website. Unfortunately, PowerSoft technicians are often terse in their bug descriptions so it is sometimes difficult to associate your problem with one on the website.

PowerBuilder keeps the problems listed in what they call their their Solved Cases or "Infobase". You can get an Infobase shipped on CD ROM but it gets out of date, as soon as it is shipped. Accessing the infobase on their website is much better since it is updated weekly.

Go to Solved Cases/InfoBase, to access the information on the web. Starting at this point, the instructions below will help you find your problem, if it is listed on their site:

4. If the Bug is Not on their Website

If the bug is not listed on the website, consider contacting PowerSoft technical support -- it will help determine whether it is actually their problem. If it is their problem, it will soon be listed on their website and that will help all PowerBuilder developers.

Details on contacting technical support are provided on this site's PB Technical Support page.

5. Working around known PowerBuilder Problems

5a. When Problem in on Infobase

If you find your exact problem on the PowerSoft Infobase website (or Infobase CD), you will know the problem is not with your code. There are two items you need to closely check for a bug listed on their website:

Often, the bug is listed on the InfoBase but the release that it was fixed in is not given and/or that release with the fix is not yet available. Of course if you just reported the bug, a fix will not be available yet.

5b. When Problem is not on Infobase or if InfoBase has no Solution

In the cases where there is no immediate solution from PowerSoft, you will have to try to come up with your own workaround. Some standard workarounds to consider:

Sample PB Problem Sample Workaround Solution(s)
Parameter passing problem e.g. PowerBuilder fails to pass the parameter/argument or it corrupts parameter(s) - make the problem parameter(s) into instance variables or put the parameter(s) onto a user object where caller and callee can access them.
- try to pass the parameter to a function, instead of an event
- try to avoid passing the value that causes the problem (e.g. Null)

Note: over the years, PowerBuilder has had a number of bugs related to passing nulls or more complex items like structures, arrays
A problem occurs when using a event (or function) - try to re-implement the logic in a function (or event)
A problem occurs in a PowerBuilder or PFC function - re-develop the function yourself long-hand, if feasible
- approach the problem differently so other functions can be used
Problem with a particular PowerBuilder visual control/feature (e.g. something implemented in a painter like a checkbox or as a hot key) - try to implement the feature slightly differently (e.g. choose a slightly different option for the control, if available)
- use another control or don't use this feature (e.g. hot key) until it is fixed
Problem with DW object syntax for some values (e.g. Null) - re-implement the logic using the traditional GetItem/SetItem or Describe/Modify commands
- make sure the offending value (e.g. Null) cannot occur
The handle to an object changes unpredictably (e.g. a variable referencing a drop down DW child or NVO no longer references the object) - re-obtain the handle to the object before performing the operation (e.g. redo GetChild(), go through the control list again, etc.)

A general caution: there is a much higher frequency of PowerBuilder bugs in very new features. Where feasible, shy away from using new features until a few maintenance releases have passed.


Copyright Woodger Computing Inc.