firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Using fbclient.dll in an application to connect localhost database followed by create an hostless database raised Shared memory error

Open ccy opened this issue 3 years ago • 1 comments

I have a strange case here. The case happen to both Firebird 3.0 and 4.0.

Here are the steps:

  1. In Windows, install x64 firebird from setup file.
  2. Make sure the firebird service is running and listen to port 3050.
  3. I use firebird OO API like fb_get_master_interface: IMaster to test
  4. Connect to localhost:employee and close the connection.
  5. Without closing the application, using IMaster.getDispatcher.createDatabase to create an embedded database using hostless URI and an error shall prompt:
	MappingIpc: Cannot initialize the shared memory region
	Shared memory area is probably already created by another engine instance in another Windows session

By reversing the steps:

  1. In application, using IMaster.getDispatcher.createDatabase to create an embedded database using hostless URI
  2. Without closing application, connect to localhost:employee andit prompt same error:
	MappingIpc: Cannot initialize the shared memory region
	Shared memory area is probably already created by another engine instance in another Windows session

Using same fbclient.dll and access localhost:employee (open and close) followed by create an hostless database raise the exception.

ccy avatar Oct 13 '22 15:10 ccy

It is fixed in master branch (see d0e33f11) but decision to backport fix into v4 is not confirmed yet as it could create some incompatibilities when 4.0.2 and 4.0.3 (with fix) run at the same time

hvlad avatar Oct 13 '22 16:10 hvlad

Any chance to include the fix into Firebird 4.0 release?

ccy avatar Feb 17 '23 08:02 ccy

Backported into v4, try next snapshot build

hvlad avatar Apr 10 '23 18:04 hvlad