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

Michael Van Canneyt michael at freepascal.org
Thu Oct 2 13:11:45 CEST 2014



On Thu, 2 Oct 2014, Reinier Olislagers wrote:

> On 02/10/2014 12:19, Mark Morgan Lloyd wrote:
>> Reinier Olislagers wrote:
>>> On 30/09/2014 22:05, Mark Morgan Lloyd wrote:
>>>> Marco van de Voort wrote:
>>>>> In our previous episode, Sven Barth said:
>>>>>> It is indeed true that all units are initialized once the main code
>>>> Reinier: did you get as far as looking in Dynlibs for an error message
>>>> immediately after trying to connect to the database?
>>>
>>> No, I didn't.
>>
>> Assuming you've got >= 2.6.2, modify your code to look like this:
>
> Sorry to be a bit abrupt here but I'm not really interested in tweaking
> this either. I've submitted a bug report which was closed. If anybody
> else wants to look into this, fine by me, but I won't spend any more
> time on it.
>
> Some background: if I'm using e.g. FPC-provided units that just happen
> to load dlls dynamically (such as sqldb but probably also others) I, as
> a programmer, do not necessarily know or want to know that
> implementation detail. Rather than messing with havint to adapt code for
> those scenarios I'll just not use the initalization sections at all as I
> documented on the wiki.

That is my conclusion since ages: I don't use initialization sections,
except maybe to initialize a variable.

You quickly learn this when you need to debug e.g. windows services.

Michael.



More information about the fpc-pascal mailing list