View Issue Details

IDProjectCategoryView StatusLast Update
0026801FPCCompilerpublic2014-09-30 10:30
ReporterReinier OlislagersAssigned ToJonas Maebe  
Status closedResolutionnot fixable 
Platformx64 (with x86 compiler)OSWindows 
Product Version2.7.1 
Summary0026801: Library initialization support for database applications
DescriptionCurrently, instantiating a class that sets up an sqldb Firebird connection in the initialization section of a unit leads to access violations. (Similar code works in a regular program, not a library)

Moving the instantiation out of the initialization section does work.

I understand initialization order is not defined but it would be nice if support were available for this.
Steps To ReproduceSee attached example.
Requirements: any Firebird server (or presumably embedded db though untested)

1. Please update your Firebird server details in dbinterface.pas to your
situation (hostname etc)
2. In businesslayer.pas, $define CRASH to see the problem.
3. Compile library and test program and run.
Additional InformationFurther points/discussion:
José Mejuto:

Mark Morgan Lloyd:
Tagsdll, library
Fixed in Revision
Attached Files


Reinier Olislagers

2014-09-30 08:29

developer (3,275 bytes)

Jonas Maebe

2014-09-30 10:08

manager   ~0077806

From :

The entry-point function should perform only simple initialization or termination tasks. It must not call the LoadLibrary or LoadLibraryEx function (or a function that calls these functions), because this may create dependency loops in the DLL load order. This can result in a DLL being used before the system has executed its initialization code.

I.e., what you are doing is unsupported ("must not call the LoadLibrary or LoadLibraryEx function"). I think that on most unix platforms, trying to load libraries from other the init function of other libraries is not supported either.

Issue History

Date Modified Username Field Change
2014-09-30 08:29 Reinier Olislagers New Issue
2014-09-30 08:29 Reinier Olislagers File Added:
2014-09-30 08:35 Reinier Olislagers Tag Attached: dll
2014-09-30 08:35 Reinier Olislagers Tag Attached: library
2014-09-30 10:08 Jonas Maebe Note Added: 0077806
2014-09-30 10:08 Jonas Maebe Status new => resolved
2014-09-30 10:08 Jonas Maebe Resolution open => not fixable
2014-09-30 10:08 Jonas Maebe Assigned To => Jonas Maebe
2014-09-30 10:30 Reinier Olislagers Status resolved => closed