Solved

Delphi Application Quick on Windows 7 but Slow on Windows 8

Posted on 2013-12-06
19
1,544 Views
Last Modified: 2013-12-17
If anyone can help me with this they will deserve 50000 points not just 500.

We have a database application written in Delphi which has been working well for many years under Win 2000, XP, Vista and 7.

The application is described fully here: www.rcmdesktop.com, with basic technical information here TechnicalInformationForITDepartments

We connect to the ODBC database driver with a TADOConnection and the OLE DB Provider is Microsoft OLE DB Provider for ODBC Drivers (MSDASQL.1).

We use TADODataset->TDatasetProvider->TClientDataset->TDatasource for all datasets and the vast majority of bound controls are DevExpress grids and editors.

Last week was the first time a user installed it onto Windows 8. Things seemed OK until they attempted to open a table with more than 32 records. At that point the application hangs.

We have done some testing on a brand new Win 8 laptop - any table with more than 32 records in any of the many databases we have causes the application to freeze - so we have ruled out data corruption as the cause.

Database utilities, and even a small test app we wrote, can all read & write to tables with >32 records, so we don't think it is the database engine (Mimer SQL 9.2).

We have spent a couple of days trying to fix this but got nowhere.

Can anyone suggest where we might start looking for the cause of this very strange behaviour?
0
Comment
Question by:plumothy
  • 11
  • 4
  • 2
  • +2
19 Comments
 
LVL 30

Expert Comment

by:Marco Gasi
ID: 39702788
I'm not an expert about it but have you read this http://technet.microsoft.com/en-us/library/aa496013%28v=sql.80%29.aspx? Maybe it can help you...
0
 

Author Comment

by:plumothy
ID: 39703006
Thanks for that. Unfortunately, it provides suggestions for optimising a working system. Our problem is different - the system doesn't work at all on Win 8.
0
 
LVL 30

Expert Comment

by:Marco Gasi
ID: 39703067
Unfortunately I don't know nothing about this: I was sorry you didn't receive help and I tried to give you something, but I really don't find anything helpful googling about this issue.
Good luck :(
0
 

Author Comment

by:plumothy
ID: 39703498
I now have a bit more information that may help the experts to get me started diagnosing this problem.

I ran a tool called WhatIsHang. It has produced a report just after our application stopped responding - unfortunately, it doesn't mean much to me. I have attached this report.

Does it give anyone a clue as to where I should start looking?
RCMDesktopHangInfo.txt
0
 

Author Comment

by:plumothy
ID: 39703516
More information which may help. Attached is information from the Windows Event Log.

To view it, extract RCMDesktopHang.txt and change the extension to evtx (not permitted by EE in the zip file!).

There doesn't seem to be much in there but I hope it means something to you experts.
RCMDesktopHang.zip
0
 
LVL 24

Expert Comment

by:jimyX
ID: 39703997
>   "Database utilities, and even a small test app we wrote, can all read & write to tables with >32 records,
>   so we don't think it is the database engine (Mimer SQL 9.2)."

I suggest you get in touch with Mimer Support for more details about any incompatibility of their previous versions. Since the Mimer Website does not expressly indicate that their product is supported in Win 8, until latest version release. There is where you should be digging.


What makes you think it could be your application? My doubts are about the DB Engine.

Since it's clear that what is causing your application to freeze is the records when they reach 32. Then that is what you should be after.

Why 32 records? What happens to make the records reach 32 and then stop? Do you add the records one by one or one transaction adds many records (>32) but your application hangs when adding the record number 32?

Have you tried to upgrade the DB engine? Did you try to set your application's compatibility to Win 7.

Your application with the latest release of Mimer Engine (10.1) under Win 8 might give you better information. So if it freezes then you will be sure it's not the DB.

Based on Mimer Website I quote:
"This is Mimer SQL Engine 9.3.8C for 32-bit Windows (including Windows Vista, Windows 200x and Windows XP)."

Even in the release of version 10.0.7, they did not make it clear that they support Win 8:
"This is Mimer SQL 10.0.7E 32-bit versions of the Windows operating system."

Until version 10.1, Win 8 was introduced:
"This is Mimer SQL 10.1.1A for Windows (including Windows 8, Windows 7, Windows Vista, Windows 200x and Windows XP)."
0
 

Author Comment

by:plumothy
ID: 39704530
Thank you for your lengthy response.

I suggest you get in touch with Mimer Support for more details about any incompatibility of their previous versions. Since the Mimer Website does not expressly indicate that their product is supported in Win 8, until latest version release. There is where you should be digging.
Something I thought I had mentioned (but I can now see that I didn't - my apologies) is that earlier versions of our application (up to Apr this year) work just fine on Win 8. So, that suggests Mimer is OK. We have indeed contacted Mimer support and are still waiting for their response.

Initially, we thought changes to our application since April must be causing the problem. We have made two major enhancements and a few minor fixes since then. The major changes were addition of multi-language support (which did not involve any interaction with databases or Mimer whatsoever) and a new view of the data (which just made use of existing datasets).

The application has several forms, some of which open a single dataset and some of which open multiple datasets. Additional testing today has shown that forms which open a single dataset can cope with more than 32 records. It would appear to be the forms with multiple datasets open (even if it is only 2) that hit this 32 record limit.

Why 32 records? What happens to make the records reach 32 and then stop? Do you add the records one by one or one transaction adds many records (>32) but your application hangs when adding the record number 32?
I would love to know why 32. If we open a form which connects to a dataset which already has >32 records then it hangs at ClientDataset.Open. If we are adding records then it hangs when clicking on anything that (I presume) results in a call to ClientDataset.Insert when attempting to add the 33rd record.

This happens in forms that have not been touched for months, even years. There have been only minor changes to the central data module (certainly nothing that would have an application-wide effect).

Have you tried to upgrade the DB engine? Did you try to set your application's compatibility to Win 7.
We haven't tried a later version of Mimer yet - I suppose we may have to just to lead the investigation one way or the other. Win 7 compatibility made no difference.

We shall keep digging and post any additional information if and when it appears.
0
 
LVL 29

Expert Comment

by:fibo
ID: 39707876
My 2 cents:
I would suspect some problem related to 32-64 bits.
- Can you check if your win8 is running 32 or 64 (I would think 64)
- In your Win7 machines: have you 64 machines which run your program 0K?
0
 

Author Comment

by:plumothy
ID: 39707903
- Can you check if your win8 is running 32 or 64 (I would think 64)
Most are 64, some 32.

- In your Win7 machines: have you 64 machines which run your program 0K?
Yes, plenty.

I have older versions of my application running happily in all 32/64 bit variants of Win7 & 8.

The newer versions run fine in any version of Win 7, but fail in any version of Win 8 (incl 8.1).
0
The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

 

Author Comment

by:plumothy
ID: 39707907
Results of yesterday's testing...

The earliest version of my application that fails in Win 8 was the first to be produced by Delphi XE4.

So I suspected XE4 and I compiled today's version of my app in XE3.

But, it also fails with more than 32 records on Win 8 (fine in Win 7).

Today I shall go back to an earlier version of my DevExpress controls and see if that helps.
0
 
LVL 36

Expert Comment

by:Geert Gruwez
ID: 39714054
with process explorer you can see what handles/files etc it accesses
> click your exe and then set the lower pane to handles

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

maybe that can shed a light of what the app is doing and what file/handle is opened causing the lock
0
 

Author Comment

by:plumothy
ID: 39714277
OK, thanks. I have installed Process Explorer. It gives a load of information which doesn't mean much to me. I couldn't see any file handles that looked wrong (but I wouldn't really know).

I have attached mini dumps from before and after the crash in the hope that someone may see a clue to point me in the right direction.
RCMDesktopBeforeCrash.dmp
RCMDesktopAfterCrash.dmp
0
 

Author Comment

by:plumothy
ID: 39722337
Here is an update: I have now been able to install Delphi on a Windows 8 laptop and now have a madExcept bug report.

This report is attached.

I would appreciate it if someone who understands the report better than me can see if it holds any clues.
RCMDesktopBugReport.txt
0
 
LVL 36

Expert Comment

by:Geert Gruwez
ID: 39723395
using a threaded quicksort to sort 32 records ???
my best guess is you're experiencing a deadlock  in the quicksort procedure
that would give a freeze

if you didn't write this quicksort yourself then you'll have to send the madexcept bugreport to rcmdesktop helpdesk

it's also possible that devexpress is the problem
so you might have to wait on 2 vendors
0
 

Author Comment

by:plumothy
ID: 39723540
Brilliant - thanks for having a look.

I am the author of RCM Desktop so I know that it does not call quicksort.

Can ask you to elaborate a little on why you are blaming quicksort before I go complaining to Dev Express?

The table that was being opened had more than 32 records (but not many more). I presume quicksort would have been attempting to sort through all of them.

This is real progress at last!
0
 
LVL 36

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 39723667
check the first lines of the bug report
that's the last thing it's doing

it's waiting for multiple objects in threads initiated from a quicksort

main thread ($1d48):
77608668 +000 KERNELBASE.dll                                   WaitForMultipleObjectsEx
004bbbfa +056 RCMDesktop.exe System.SyncObjs                   THandleObject.WaitFor
00768a7e +00e RCMDesktop.exe dxThreading               461  +1 TdxThreadPoolHelper.WaitForThreads
00768ded +095 RCMDesktop.exe dxThreading               594 +22 TdxMultithreadedSort.SortListChunks
00768c61 +04d RCMDesktop.exe dxThreading               532  +6 TdxMultithreadedSort.Sort
0076b72c +038 RCMDesktop.exe dxCoreClasses             407  +3 dxQuickSortList
0076c676 +012 RCMDesktop.exe dxCoreClasses            1337  +1 TdxFastList.Sort

rats the markup doesn't work inside the code block
so i removed the code block
0
 

Author Comment

by:plumothy
ID: 39723702
Ok - many thanks for that. It looks like enough to ask Dev Express to take a look at it.

Unfortunately, they will ask for a sample project that reproduces it - not easy!

I will wait for their answer and then it may be time to close this question...
0
 
LVL 36

Expert Comment

by:Geert Gruwez
ID: 39723739
now and then they are helpful at devex
providing they have a test case

but that's with all the vendors ... :)
0
 

Author Closing Comment

by:plumothy
ID: 39724257
Thanks to all who tried to help. But it was Geert_Gruwez who set me onto the right path.

It was indeed a problem with DevExpress multi-threading sorting code. It is a new feature that is obviously not thread-safe in my situation!

They have told me how to switch it off and my application now works OK on Windows 8.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now