EStringListError inside ConstructURL

The BETA tester's forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
DPStano
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 16.05.2016, 09:21

EStringListError inside ConstructURL

Postby DPStano » 10.05.2017, 08:02

I'm getting this error callstack from multiple users anyone have idea whats wrong, connect is called in thread, each thread has own connection

Delphi 2009

EStringListError: List index out of bounds (1)
Classes: 0 TStringList.Get
Classes: 0 TStrings.Error
Classes: 0 TStringList.Get
Classes: 0 TStrings.IndexOfName
Classes: 0 TStrings.GetValue
ZURL: 435 TZURL.DoOnPropertiesChange
Classes: 0 TStringList.Changed
Classes: 0 TStringList.SetUpdateState
Classes: 0 TStrings.EndUpdate
Classes: 0 TStrings.SetTextStr
ZURL: 133 TZURLStringList.SetTextStr
ZDbcIntfs: 1389 TZDriverManager.ConstructURL
ZAbstractConnection: 722 TZAbstractConnection.ConstructURL
ZAbstractConnection: 849 TZAbstractConnection.Connect

marsupilami
Gold Boarder
Gold Boarder
Posts: 534
Joined: 17.01.2011, 14:17

Re: EStringListError inside ConstructURL

Postby marsupilami » 11.05.2017, 20:49

Hello DPStano,

to me this look like it either is a bug in the TStringList / TStrings or like a memory corruption. Most probably the latter one since exactly the same call succeeded two lines earlier.

Some databases (MySQL?) require you to have only one call to the connect method at a time. So it might make sense to make sure that only one thread calls the connect method of its TZConnection object at the same time.

With best regards,

Jan

DPStano
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 16.05.2016, 09:21

Re: EStringListError inside ConstructURL

Postby DPStano » 16.05.2017, 11:20

it caused by calling Connect in thread maybe DriverManager should be protected by mutex or FURL should be method var or something like that

marsupilami
Gold Boarder
Gold Boarder
Posts: 534
Joined: 17.01.2011, 14:17

Re: EStringListError inside ConstructURL

Postby marsupilami » 17.05.2017, 19:08

Hello DPStano,

do you have a suggestion on hot to do that? Honestly I don't have much time for doing imporovements currently.

With best regards,

Jan

DPStano
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 16.05.2016, 09:21

Re: EStringListError inside ConstructURL

Postby DPStano » 16.06.2017, 12:42

TZDriverManager as global object has to be threadsafe so all access to its private members has to be locked by some Lock TCriticalSection or some Mutex

i'd remove private FURL and add it as var in ConstructURL, ResolveDatabaseUrl, ResolveDatabaseUrl
FDrivers should not change during program runtime so it does need locking, probably
FLoggingListeners updates (AddLoggingListener,RemoveLoggingListener, HasLoggingListener) have to be locked
FLoginTimeout and FHasLoggingListener are atomic

marsupilami
Gold Boarder
Gold Boarder
Posts: 534
Joined: 17.01.2011, 14:17

Re: EStringListError inside ConstructURL

Postby marsupilami » 18.06.2017, 14:11

Hello DPStano,

could you possibly prepare a patch for this? I am still working on other bugs and don't have as much time for Zeos as I would like to have...

With best regards,

Jan


Return to “ZeosLib 7.2 Betatest Forum”

Who is online

Users browsing this forum: No registered users and 1 guest