Issue Details (XML | Word | Printable)

Key: CORE-3682
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Paul Beach
Reporter: John Roberts
Votes: 0
Watchers: 4
Operations

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

Firebird 2.5.1 OSX Lion hangs on attaching to second database

Created: 01/Dec/11 10:54 AM   Updated: 23/Apr/13 01:26 PM
Component/s: API / Client Library
Affects Version/s: 2.5.1
Fix Version/s: 2.5.2

Time Tracking:
Not Specified

Environment:
OSX Lion 10.7.2
Intel 4 core 8Gb Ram

Planning Status: Unspecified


 Description  « Hide
I attach to 2 separate databases on the same machine in quick succession via localhost. Firebird always opens the first database with no problems but often hangs opening the second database. The only way out is to kill and restart fbserver as subsequent attempts to reattach to the first database fail. Once it works correctly It then continues through the session to attach without error to both databases repeatedly whenever my program is re-started. On shutting down and later reboot firebird often hangs again. Debugging shows my program stops on calling isc_attach_databaseType. System and firebird logs show nothing that I can see as relevant.

I have tried all 32/64 versions of Firebird for OSX except the lipo version and they all exhibit the same problem in Lion.
I have also had similar hang on detaching from a single database on two occasions.

I have tried a trace/audit but get the message that there are no plugins loaded.



 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
berny added a comment - 02/Dec/11 02:13 PM
We have exactly the same problem. Our application open sequentially two databases and 80% of attempts on reboot of the hardware is crashing on open the second Database. So, when I restart the firebird after this affect, firebird is working fine until the next reboot....

Alexander Peshkov added a comment - 07/Dec/11 12:27 PM
What server are you using - classic, superclassic or super?

John Roberts added a comment - 08/Dec/11 06:47 AM
I have tried all 32/64 versions of Firebird for OSX including the lipo version. If my memory is correct this excepts classic. I have used a standard install using the standard packages. I now am using a debug SS version.

berny added a comment - 10/Dec/11 12:23 PM
I can confirm John Roberts comment. I also tried wiht every version of firebird (2.5.1 for OS X) under Lion...most of the time the same issue

John Roberts added a comment - 10/Dec/11 10:40 PM
The debug Firebird SS supplied to me hasn't hung since installed. I have been re-booting several times a day to test.

Paul Beach added a comment - 14/Dec/11 02:55 PM
A problem that seems to be caused by an issue in the installer preupgrade-script. In the interim, if anybody else has this issue
1. Stop the firebird server
2. Run this script

#!/bin/sh
echo "Clean User"
dscl localhost -delete /Local/Default/Users/firebird
echo "Clean Group"
dscl localhost -delete /Local/Default/Groups/firebird
if [ -f "/Library/StartupItems/Firebird" ]; then
echo "Remove Superserver StartupItem"
rm -fr /Library/StartupItems/Firebird
fi
if [ -f "/Library/LaunchDemons/org.firebird.gds.plist" ]; then
echo "Remove Launchd"
launchctl unload /Library/LaunchDemons/org.firebird.gds.plist
rm /Library/LaunchDemons/org.firebird.gds.plist
fi
echo "Remove Framework"
rm -fr /Library/Frameworks/Firebird.framework
echo "Remove Receipt"
rm -fr /Library/Receipts/Firebird*.pkg
echo "Remove /tmp/firebird"
rm -fr /tmp/firebird

3. Re-install Firebird 2.5.x

Alexander Peshkov added a comment - 07/Mar/12 06:21 AM
The visible reason of the bug is not released semaphore in first attachment to database. I could not find anything wrong in firebird, and same code works just fine on MacOS 10.6 and all versions of freebsd (that port is compiled with same defines in x-process sync as Mac port). Therefore looks like there is a problem with System V semaphores in MacOS 10.7.
The fix committed is very bad. First of all, it breaks -c switch in fb_lock_print. Next, it does not fix superclassic which sooner of all will hang in the same manner. Moreover, it can't be front-ported to FB3.
But with it SS starts correctly on any Mac version, therefore it was committed.

Paul Beach added a comment - 07/Mar/12 06:56 AM
If anybody needs a 2.5.1 build with this fix, please contact me directly.

Samo Dadela added a comment - 07/Mar/12 06:42 PM
Same problem.
Lion 10.7.3, mac mini server i7 8G, using embedded (extracted from FirebirdCS-2.5.1-26351-i386.pkg.zip).
Does not happen on 10.6.

Can reproduce it 99% of the time:
1. reboot system
2. start isql
3. isql> create database '/tmp/test.db' user 'SYSDBA' password 'masterkey';
4. isql> quit;
5. hang.....

After killing the hung isql the problem does not happen again until next reboot. (run db creation in a loop for 20 minutes - not one hang).


Paul Beach added a comment - 08/Mar/12 07:10 AM
Samo,
Yours is an unrelated issue, probably due to your home rolled embedded version and ownership issues. The problem is bug refers to only affects SuperClassic and SuperServer not Classic.

Samo Dadela added a comment - 08/Mar/12 07:05 PM
Paul,
Ruled out 'home rolled embedded' by using Classic 32-bit. See CORE-3786.