Re: [fpc-pascal] DLL calling Firebird 2: crashes at the end

2014-09-29 Thread Graeme Geldenhuys
On 2014-09-28 10:32, Michael Van Canneyt wrote: > I do a lot of work with firebird embedded, and I've never even come close > to the problems you're experiencing ? +1 Using Embedded and C/Server in a few projects under Windows and Linux (unofficial support) and it works fine here too. I use FPC'

[fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Reinier Olislagers
Apparently my crashes in a dll that use Firebird have to do with initialization sections in my business layer creating a single instance of my db layer. Distilled reproducible code that demonstrates problem: https://bitbucket.org/reiniero/fpc_laz_patch_playground/downloads/dllcrash.zip 1. Please

Re: [fpc-pascal] DLL calling Firebird 2: crashes at the end

2014-09-29 Thread Reinier Olislagers
On 28/09/2014 18:10, Michael Van Canneyt wrote: > From your story, I doubt your problems are Firebird related. Firebird > (or any other DB client lib) just uses the buffers you provide. Except that - as I mentioned - replacing my db layer calling Firebird with a dummy layer that does nothing resol

Re: [fpc-pascal] Is it possible to use top directory of subtree with -Fu -Fi -Fl options?

2014-09-29 Thread Tony Papadimitriou
OK, I think I realized what the problem is. The * will apparently search in all subdirectories but (apparently again) one level deep. So, if you have something like: \progs\pascal\units\a \progs\pascal\units\a\b and you give -Fu\progs\pascal\units\* it will look in \progs\pascal\units\a but

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Mark Morgan Lloyd
Reinier Olislagers wrote: Apparently my crashes in a dll that use Firebird have to do with initialization sections in my business layer creating a single instance of my db layer. Distilled reproducible code that demonstrates problem: https://bitbucket.org/reiniero/fpc_laz_patch_playground/downlo

Re: [fpc-pascal] Is it possible to use top directory of subtree with -Fu -Fi -Fl options?

2014-09-29 Thread leledumbo
> So, is there a way to do this, i.e., specify the 'root' director for your units/includes and have it look at all files underneath regardless of nesting level? No, that's how -Fu is designed. -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Is-it-possible-t

[fpc-pascal] Internal error 200706094

2014-09-29 Thread Victor Matuzenko
Hi! I have a large project and it compiles under 32 bits cpu, but doesn't under 64 bits. Here is a minimal problematic part: = [doj@larion ~/temp]$ cat ptrtransform.pas {$MODE OBJFPC} const C = -1; var A: array[0..1] of Pointer; begin Wri

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Reinier Olislagers
On 29/09/2014 11:19, Mark Morgan Lloyd wrote: > Reinier Olislagers wrote: >> 2. In businesslayer.pas, $define CRASH to see the problem. >> The code in question is: >> initialization >> DBLayer:=TDBInterface.Create; >> >> finalization >> DBLayer.Free; >> ... so probably initialization order play

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Reinier Olislagers
On 29/09/2014 11:19, Mark Morgan Lloyd wrote: > Reinier Olislagers wrote: > What happens if you move the responsibility for initialising and closing > the database connection to the app-level code? In other words, the app > does something like Ok, after eliminating some PEBKAC, my real dll works f

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread José Mejuto
El 29/09/2014 a las #4, Reinier Olislagers escribió: What I would like to know what is the cause of this problem - dlls being loaded before some kind - what kind? - of initialization is complete? Anyway, I'll keep digging; probably first looking at geting postgresql support in anyway. _

Re: [fpc-pascal] Is it possible to use top directory of subtree with -Fu -Fi -Fl options?

2014-09-29 Thread waldo kitty
On 9/29/2014 5:00 AM, Tony Papadimitriou wrote: OK, I think I realized what the problem is. The * will apparently search in all subdirectories but (apparently again) one level deep. So, if you have something like: \progs\pascal\units\a \progs\pascal\units\a\b and you give -Fu\progs\pascal\uni

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Reinier Olislagers
On 29/09/2014 16:51, José Mejuto wrote: > El 29/09/2014 a las #4, Reinier Olislagers escribió: > You must not initialize dbengine in the Initialization section and must > not finalize it in that place (maybe only as last chance) because > initialization order and finalization order is undefined by

Re: [fpc-pascal] Internal error 200706094

2014-09-29 Thread waldo kitty
On 9/29/2014 5:48 AM, Victor Matuzenko wrote: IMO the problem is the transformation -1 into an unsigned value. (Unsigned(-1) > Max(Signed).) How can I rewrite this code to make it correct? I want to use constants to calculate offsets from untyped pointer. have you tried using a typed const? c

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Mark Morgan Lloyd
Reinier Olislagers wrote: On 29/09/2014 11:19, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: 2. In businesslayer.pas, $define CRASH to see the problem. The code in question is: initialization DBLayer:=TDBInterface.Create; finalization DBLayer.Free; ... so probably initialization order

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Reinier Olislagers
On 29/09/2014 17:41, Mark Morgan Lloyd wrote: > Reinier Olislagers wrote: >> On 29/09/2014 11:19, Mark Morgan Lloyd wrote: >>> Reinier Olislagers wrote: 2. In businesslayer.pas, $define CRASH to see the problem. The code in question is: initialization DBLayer:=TDBInterface.Cre

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Mark Morgan Lloyd
Reinier Olislagers wrote: On 29/09/2014 17:41, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: On 29/09/2014 11:19, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: 2. In businesslayer.pas, $define CRASH to see the problem. The code in question is: initialization DBLayer:=TDBInterface.

[fpc-pascal] how do I get Run Time info from a published method?

2014-09-29 Thread Dennis Poon
say for example: type TmyClass = class published procedure Something (sender : Tobject);virtual; end; var myClass : TmyClass; then somewhere AddMethodToQueue(@myclass.Something); Is it possible within AddMethodToQueue, I can query the Run Time Type Info of the