ZEOS 7.1.0-alpha, ParamByName, SIGSEGV Exception, FPC
-
- Fresh Boarder
- Posts: 7
- Joined: 26.07.2013, 10:22
- Location: Germany
ZEOS 7.1.0-alpha, ParamByName, SIGSEGV Exception, FPC
Since I had a hard time to figure out the following problem,
I would like to give a short description of the problem and
its solution for other programming fellows.
Enviroment:
************
- ZEOS 7.1.0-alfa
- Codetyphon 4.4 - 64 Bit
- fpc 2.7.1 - 64 Bit
- Kubuntu 13.04 - 64 Bit
- Database POSTGRESQL 9.1.8
Problem:
************
Sporadic program exceptions (SIGSEGV Exception) running the
debugger, sometimes debugger is crashing, sometimes IDE is
crashing.
The problem is occuring during an assignment of a string to a
parameter with ParamByName of a TZQuery.
Example:
Sample_Q.Params.ParamByName ('F_FIRSTNAME').AsString := 'Hans';
It doesn't matter if the active property of the TZQuery is set to TRUE
or FALSE, this assignment will cause exceptions sporadicly.
It took me many days to find that problem, searching in the debugger
and in assembler.
It seems that the TZQuery has problems with converting the pascal
string to the params.
Solution:
************
The problem could be solved by assigning the datatype of the param
a specific value instead of the standard ftUnknown.
Setting the datatype of the param 'F_FIRSTNAME' to ftString solved
the problem.
Since I never had to set a paramtype inside the DELPHI components
years before, the problem was very subtle to me using CODETYPHON, fpc
and ZEOS.
If anybody gets exceptions with TZQuery, try to set the datatype
of the params by hand to a different value than ftUnknown.
Cheers,
ATILIUS
POST SCRIPTUM:
Since the ZeosLib 7.0 Beta Forum is locked, I had to set the posting here.
I would like to give a short description of the problem and
its solution for other programming fellows.
Enviroment:
************
- ZEOS 7.1.0-alfa
- Codetyphon 4.4 - 64 Bit
- fpc 2.7.1 - 64 Bit
- Kubuntu 13.04 - 64 Bit
- Database POSTGRESQL 9.1.8
Problem:
************
Sporadic program exceptions (SIGSEGV Exception) running the
debugger, sometimes debugger is crashing, sometimes IDE is
crashing.
The problem is occuring during an assignment of a string to a
parameter with ParamByName of a TZQuery.
Example:
Sample_Q.Params.ParamByName ('F_FIRSTNAME').AsString := 'Hans';
It doesn't matter if the active property of the TZQuery is set to TRUE
or FALSE, this assignment will cause exceptions sporadicly.
It took me many days to find that problem, searching in the debugger
and in assembler.
It seems that the TZQuery has problems with converting the pascal
string to the params.
Solution:
************
The problem could be solved by assigning the datatype of the param
a specific value instead of the standard ftUnknown.
Setting the datatype of the param 'F_FIRSTNAME' to ftString solved
the problem.
Since I never had to set a paramtype inside the DELPHI components
years before, the problem was very subtle to me using CODETYPHON, fpc
and ZEOS.
If anybody gets exceptions with TZQuery, try to set the datatype
of the params by hand to a different value than ftUnknown.
Cheers,
ATILIUS
POST SCRIPTUM:
Since the ZeosLib 7.0 Beta Forum is locked, I had to set the posting here.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
ATILIUS_REGULUS,
uff that's a huge surprice! Wondering about the FPC behavior here.
First of all i propose you update your ZeosLib working copy because of this:
http://zeos.firmos.at/viewtopic.php?p=17638#17638
There was a Ubuntu problem only and comparing rowvalues with the current buffer did fail if a value was null previously.
On the other hand (if the issue remains): Are you able to attach a little app which points me to this issue?
Btw. You're usng the 7.1 branch. There is a thread for it: http://zeos.firmos.at/viewforum.php?f=38
uff that's a huge surprice! Wondering about the FPC behavior here.
That i do not understand. IMHO should the IDE set the type automatically on assigning a string and if ParamType = ftUnknown, thought.The problem could be solved by assigning the datatype of the param
a specific value instead of the standard ftUnknown.
Setting the datatype of the param 'F_FIRSTNAME' to ftString solved
the problem.
First of all i propose you update your ZeosLib working copy because of this:
http://zeos.firmos.at/viewtopic.php?p=17638#17638
There was a Ubuntu problem only and comparing rowvalues with the current buffer did fail if a value was null previously.
On the other hand (if the issue remains): Are you able to attach a little app which points me to this issue?
Btw. You're usng the 7.1 branch. There is a thread for it: http://zeos.firmos.at/viewforum.php?f=38
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
-
- Fresh Boarder
- Posts: 7
- Joined: 26.07.2013, 10:22
- Location: Germany
Michael,
Thanks for the quick reply, I am aware that
working with the stable version would be
a good idea.
But since I decided to work with Codetyphon,
I like to stay with the component versions
they deliver. If I would install different component
versions, I will always have to assemble
the components by hand, when a new
codetyphon version is coming out.
The strings which were assigned to ParamByName().AsString
have been containing values and were not empty or null strings.
Also the problem occurred at different places, were strings
have been assigned to ParamByName().AsString.
Currently the problem occurs at a quite big pascal project,
but I tried to produce a little application for you with the
problem. Unfortunatly, the problem could not be reproduced
with the smale application.
Please note, that the SIGSEGV exception occured sporadicly
and not always, which made it extremly difficult to trace them,
sometimes I didn't get an exception for hours, but as the program
became bigger, the exceptions became more frequent and
finally I figured out, that the exception occured during assigning
a string to a param like
Sample_Q.Params.ParamByName ('F_FIRSTNAME').AsString := S;
If I can reproduce the problem with a small sample application,
I will let you know.
Cheers,
ATILIUS
Thanks for the quick reply, I am aware that
working with the stable version would be
a good idea.
But since I decided to work with Codetyphon,
I like to stay with the component versions
they deliver. If I would install different component
versions, I will always have to assemble
the components by hand, when a new
codetyphon version is coming out.
The strings which were assigned to ParamByName().AsString
have been containing values and were not empty or null strings.
Also the problem occurred at different places, were strings
have been assigned to ParamByName().AsString.
Currently the problem occurs at a quite big pascal project,
but I tried to produce a little application for you with the
problem. Unfortunatly, the problem could not be reproduced
with the smale application.
Please note, that the SIGSEGV exception occured sporadicly
and not always, which made it extremly difficult to trace them,
sometimes I didn't get an exception for hours, but as the program
became bigger, the exceptions became more frequent and
finally I figured out, that the exception occured during assigning
a string to a param like
Sample_Q.Params.ParamByName ('F_FIRSTNAME').AsString := S;
If I can reproduce the problem with a small sample application,
I will let you know.
Cheers,
ATILIUS
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
ATILIUS,
So i propuse you follow my advice first before investing time into a sample app and tracking the same issue, propably.
Well that's right. I was running into the same issue. I simply did overwrite the all subfolders of the pl_ZeosDBO\Source folder(not sure yet). So checkout \testing-7.1 from SVN and overwrite the codetyphon used Zeos-files. This will safe your and my time if we allready catched the bug.I will always have to assemble
the components by hand, when a new
codetyphon version is coming out.
well i know. But i had a stable behavior if i simply did update a row-string-value which was empty before. That didn't happen if there was a value assigned before. Insertiation was no problem. The link above points to FireBird but i'm sure it was a common issue for all providers and Ubuntu. Like i wrote in the other thread: I can't say if it's a thing for a bugtracker of FPC. But there is a complete different behavior between Windows and Ubuntu in function AnsiCompStr (didn't test other OS's so i made the workaround gloabal for all non Windows OS's. Just because i've no clue about a Ubuntu define only)Please note, that the SIGSEGV exception occured sporadicly
and not always, which made it extremly difficult to trace them,
sometimes I didn't get an exception for hours, but as the program
became bigger, the exceptions became more frequent and
finally I figured out, that the exception occured during assigning
a string to a param like
Sample_Q.Params.ParamByName ('F_FIRSTNAME').AsString := S;
So i propuse you follow my advice first before investing time into a sample app and tracking the same issue, propably.
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
-
- Fresh Boarder
- Posts: 7
- Joined: 26.07.2013, 10:22
- Location: Germany
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Nice you confirm my advice. Waiting for reply.
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
-
- Fresh Boarder
- Posts: 7
- Joined: 26.07.2013, 10:22
- Location: Germany
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
ATILIUS_REGULUS,
it would be nice if someone can inform the CodeTyphon crew about this issue. We're really sorry about. But the project-manager and me have not so much time to check everything agains each available OS's. Can you write them please?
it would be nice if someone can inform the CodeTyphon crew about this issue. We're really sorry about. But the project-manager and me have not so much time to check everything agains each available OS's. Can you write them please?
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
-
- Fresh Boarder
- Posts: 7
- Joined: 26.07.2013, 10:22
- Location: Germany
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Juergen,
that's very nice. Point them to this and the second thread. I don't know if the can react emmidiately. But everthing is better than nothing..
Cheers, Michael
Edit: Can you update http://www.lazarusforum.de/viewtopic.ph ... 192594f90d too? ((:
that's very nice. Point them to this and the second thread. I don't know if the can react emmidiately. But everthing is better than nothing..
Cheers, Michael
Edit: Can you update http://www.lazarusforum.de/viewtopic.ph ... 192594f90d too? ((:
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
EgonHugeist, Juergen,
I still can confirm that bug in http://zeos.firmos.at/viewtopic.php?p=17638#17638
is resolved, still no other problems detected ...
Regards, Patyi
I still can confirm that bug in http://zeos.firmos.at/viewtopic.php?p=17638#17638
is resolved, still no other problems detected ...
Regards, Patyi
-
- Fresh Boarder
- Posts: 7
- Joined: 26.07.2013, 10:22
- Location: Germany
Addendum:
After installing the files from /testing-7.1/src, the exceptions become less frequent, but I still get some exceptions by assigning a string to ParamByName.
Furthermore, when assigning other datatypes like Int64 or TDate to ParamByName, exceptions arrise also sporadicly.
The problem can be avoided by assigning a datatype to the param like ftDate or ftLargeInt respectivly.
Cheers,
ATILIUS
After installing the files from /testing-7.1/src, the exceptions become less frequent, but I still get some exceptions by assigning a string to ParamByName.
Furthermore, when assigning other datatypes like Int64 or TDate to ParamByName, exceptions arrise also sporadicly.
The problem can be avoided by assigning a datatype to the param like ftDate or ftLargeInt respectivly.
Cheers,
ATILIUS
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
ATILIUS_REGULUS,
i did run our tests on
XUbuntu 13
FireBird2.5
CodeTyphon 4.4
ZeosDBO 7.0.4 and 7.0.3 and 7.1-beta and 7.2-alpa
i can confirm your reported random EXTERNAL SIGDEV's with ALL these revisions. and it happens in the DB unit or Variants of FPC.
Have to pass for the moment. It looks like Zeos(the reported bug of Patyit) and FPC(your report) have a problem in CodeTyphon 4.4.
now i have to fiddle out how to get a stable FPC and the FPC2.7 running on Ubuntu.
patyit,
do you use Parameters in your Queries too?
i did run our tests on
XUbuntu 13
FireBird2.5
CodeTyphon 4.4
ZeosDBO 7.0.4 and 7.0.3 and 7.1-beta and 7.2-alpa
i can confirm your reported random EXTERNAL SIGDEV's with ALL these revisions. and it happens in the DB unit or Variants of FPC.
Have to pass for the moment. It looks like Zeos(the reported bug of Patyit) and FPC(your report) have a problem in CodeTyphon 4.4.
now i have to fiddle out how to get a stable FPC and the FPC2.7 running on Ubuntu.
patyit,
do you use Parameters in your Queries too?
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
EgonHugeist,
Yes almost always, but mostly in form Params[0].AsString rarely
ParamByName('par').AsString. Using string, integer, datetime and float data types,
(not using Int64 or Date data types in parameters)
but have no problems by now on Lazarus 1.1 svn, FPC 2.6.3 svn, FPC 2.7.1 svn, Zeos 7.1.0 svn testing.
Yes almost always, but mostly in form Params[0].AsString rarely
ParamByName('par').AsString. Using string, integer, datetime and float data types,
(not using Int64 or Date data types in parameters)
but have no problems by now on Lazarus 1.1 svn, FPC 2.6.3 svn, FPC 2.7.1 svn, Zeos 7.1.0 svn testing.
-
- Fresh Boarder
- Posts: 7
- Joined: 26.07.2013, 10:22
- Location: Germany
Addendum:
When assigning a string value to a normal variant, no exceptions arise.
Example:
Var
S: String;
V: Variant;
Begin
S := 'Hans';
V := S;
End;
Furthermore, the exceptions become more frequent, if the TZQuery is active during the assining:
Sample_Q.Active := TRUE;
Sample_Q.Params.ParamByName ('F_FIRSTNAME').AsString := 'Hans';
Cheers,
ATILIUS
When assigning a string value to a normal variant, no exceptions arise.
Example:
Var
S: String;
V: Variant;
Begin
S := 'Hans';
V := S;
End;
Furthermore, the exceptions become more frequent, if the TZQuery is active during the assining:
Sample_Q.Active := TRUE;
Sample_Q.Params.ParamByName ('F_FIRSTNAME').AsString := 'Hans';
Cheers,
ATILIUS