Issue Details (XML | Word | Printable)

Key: CORE-4624
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Michał Ziemski
Votes: 1
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Firebird handles ':' characters in mount table entries invalid

Created: 24/Nov/14 02:17 PM   Updated: 23/Sep/15 11:31 AM
Component/s: Engine
Affects Version/s: 2.5.3, 3.0 Beta 1
Fix Version/s: 2.5.4, 3.0 Beta 2

File Attachments: 1. Text File firebird-docker.patch (0.5 kB)

Environment: CentOs 7 Docker 1.3.1

QA Status: Cannot be tested


 Description  « Hide
When running under docker Firebird won't start.

As far as I was able to debug the issue the reason is as follows:

Under Docker the mount table looks somewhat like follows:
/dev/mapper/docker-9:1-3063-cf43ec04ee218f73bcc6e0b31f04c73a7c2df8b838a4a391b3b70462d58345e0 on / type ext4 (rw,relatime,discard,stripe=16,data=ordered)

It contains a colon character ':' which is handled specially somewhere in src/jrd/isc_file.cpp
As a result only the former part "/dev/mapper/docker-9" gets prepended to the file name in
the call to isc_expand_filename with expand_mounts = true



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michał Ziemski added a comment - 24/Nov/14 02:46 PM
I've found a workaround to acrually run fb inside a docker container.
The trick is not to have any databases (including security2.fdb on the main mount point.

Start a docker container with some volume mounted.
Inside the container copy security2.fdb to the mounted volume and replace the original
security2.fdb with a link to the file on the mounted volume.

Now firebird will now start without problems.

Sean Leyne added a comment - 24/Nov/14 09:29 PM
Michal,

It seems this was an issue related to your setup/configuration within docker container, not a Firebird issue. Correct?

Michał Ziemski added a comment - 25/Nov/14 07:42 AM
Actually it seems to be a problem with firebird failing to interpret the colon character in the
device name. As far as I understand the code in src/jrd/isc_file.cpp firebird is checking
the type of device (disk, nfs, etc) the database is on. It does so heuristicly by looking for ':' and '/' characters.
The device name provided by docker (as far as I understand what's going on - this is my first time using gdb in 10 years or so) is not being interpreted correctly.

Alexander Peshkov added a comment - 25/Nov/14 09:52 AM
Michal, you are absolutely right - it's a bug in a code that does not expect ':' in file name.

Marcus Brinkmann added a comment - 20/Jan/15 03:11 AM
This is a work-around.for CORE-4624, a bug in firebird where it interprets a /dev/mapper/ filename with a colon as an NFS volume. This happens in Docker on Fedora 21.

Alexander Peshkov added a comment - 22/Jan/15 10:34 AM - edited
Fix required modification of OS-dependent code.
I want results of at least MAC build before backporting it to 2.5.