Error 6: Invalid handle

102 visninger
Gå til det første ulæste opslag

Tim J

ulæst,
31. jan. 2023, 13.46.1431.01.2023
til Harbour Users
Today one of my apps started getting an Invalid handle error when doing a dbseek()
Been using it for years and I have never actually seen this particular error before.

Can anyone give me a steer about what to look for?

Tim J

ulæst,
31. jan. 2023, 15.26.0331.01.2023
til Harbour Users
It was doing a seek on an already open file: one of about 50
It had just updated the same file a bunch of times.
At first I wondered if it might be index corruption, but reindexing it did not help

I recently changed to the Harbour 3.2.0dev (r2301231146) build.
I don't know if that is cause or coincidence.

Any help would be appreciated

Przemyslaw Czerpak

ulæst,
31. jan. 2023, 17.50.4931.01.2023
til harbou...@googlegroups.com
Hi,

You have very serious bug in your code and you will have to
check all calls to FClose() or similar function.
It's not the first time someone reports such thing.
One of the most funny situation was when I received from user
DBF file with printer output inside. It was caused by double call
to FClose( nStaticVar ).
The first call closed correct file. Then SET PRINTER TO <cFile>
was executed and then file handle reused. The second call to
FClose() closed this handle and it was reused again by dbUseArea()
but still SET PRINTER TO was active with the same handle number
as the one used by DbUseArea(). What happened you can imagine.
The report directed to printer ended in DBF file corrupting it.
The buggy code was used for many years and suddenly some
other modifications which changed the order in which OS allocated
handles for running application exploited it.

Changing Harbour version does not help you. Of course it possible
that you mask the problem for some time but it will return and the
results can be much worse .

best regards,
Przemek


W dniu 31.01.2023 o 19:46, 'Tim J' via Harbour Users pisze:
Today one of my apps started getting an Invalid handle error when doing a dbseek()
Been using it for years and I have never actually seen this particular error before.

Can anyone give me a steer about what to look for?
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/9ede9986-4621-417e-a84f-fadcf564751an%40googlegroups.com.

Tim J

ulæst,
1. feb. 2023, 07.37.5701.02.2023
til Harbour Users
Wow!  Thank you very much, Przemek!
Just what I need to know.
Now to find it.

Svar alle
Svar til forfatter
Videresend
0 nye opslag