Issue Details (XML | Word | Printable)

Key: CORE-3786
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Alexander Peshkov
Reporter: Samo Dadela
Votes: 1
Watchers: 2

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

Firebird 2.5.1 Classic (32-bit) Hangs on MacOSX 10.7 (Lion) on DB create after reboot

Created: 08/Mar/12 06:44 PM   Updated: 25/May/16 05:54 AM
Component/s: None
Affects Version/s: 3.0 Initial, 2.5.1
Fix Version/s: 2.5.2, 3.0 Alpha 1

File Attachments: 1. Text File fb_inet_server_localhost_stacktrace_08032012.txt (8 kB)
2. File (0.4 kB)
3. Text File isql_localhost_stacktrace_08032012.txt (2 kB)
4. Text File isql_stacktrace_08032012.txt (4 kB)
5. Text File isql_vg_08032012.txt (21 kB)

MacOSX Lion 10.7.3 (fully updated) - happened also on 10.7.2
Hardware: mac mini server i7 8G RAM

QA Status: Cannot be tested
Test Details: > 3. Reboot!

 Description  « Hide
Firebird hangs with simple db create only first time after the machine is (re)booted.

How to reproduce:
1. Install Firebird Classic MacOSX 32-bit:
    October 04, 2011 / / 14 MB / MacOS X 10.6+ 32-bit Classic, Superclassic & Embedded (Intel) package, compressed
2. Add user to firebird user group:
    # sudo dscl . append Groups/firebird GroupMembership username
3. Reboot!
4. Run:
    # /Library/Frameworks/Firebird.framework/Versions/A/Resources/bin/isql
   SQL> create database '/tmp/hang.db' user 'SYSDBA' password 'masterkey';
   SQL> quit; <---- *** hang when enter is pressed ***

Note: If isql is then killed and the operation is retried - it just works (does not hang)... until the next reboot. The hang happens about 90% of the time.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Samo Dadela added a comment - 08/Mar/12 06:47 PM - edited
Add stacktrace of hang (obtained with killall -11 isql).

Samo Dadela added a comment - 08/Mar/12 06:50 PM - edited
Add test script:
Reboot is required prior to running it to reproduce problem!

Samo Dadela added a comment - 08/Mar/12 07:02 PM
Some comments:
- the "how to reproduce" is only the simplest way to reproduce the problem; it was noticed as random hangs in my app (for example on IBPP::Fetch).
- the problem does not happen on Snow Leopard (10.6); though the 10.6 system may not be comparable since it is a very old (and slow) system.
- after the first hang, if the operation is retried the database is successfully created; also firebird works without a problem until the system is booted again.
- sometimes (very rarely) it can hang twice or more times in a row.
- it seems that once the database is created and the system is rebooted you can connect normally to the previously created database
- tried setting FIREBIRD_LOCK to something different than /tmp/firebird - does not help.
- if FIREBIRD_LOCK is used and the lock files survive reboot; it seams that the problem happens less often (note the 'seams', I might be wrong)

Possible 'workaround':
- before creating your database, call isql to create a dummy database and if it hangs, kill it.
- you should be able to create your real database now.

Samo Dadela added a comment - 08/Mar/12 07:51 PM - edited
Tried using "localhost:/tmp/hang.db" as the database name. BTW: is this Superserver or Superclassic?

This time isql hangs on poll() (Select::select) waiting for fb_inet_server.
However fb_inet_server hangs in a similar way as before.

See attached stacktraces.

Samo Dadela added a comment - 08/Mar/12 07:53 PM - edited
Stacktraces of hang using localhost:/

Samo Dadela added a comment - 08/Mar/12 09:18 PM
Attaching valgrind output of isql hang using "/tmp/hang.db" as the database name.

Valgrind/memcheck (32-bit) was invoked as:


printf "create database '%s' user 'SYSDBA' password 'masterkey';\n" "${DB}"
printf "quit;\n"
) | /usr/local/bin/valgrind \
  --dsymutil=yes \
  --num-callers=50 \
  --max-stackframe=4048000 \
  --track-origins=yes \
  --leak-check=full \
  "${FB}/isql" -q > /tmp/isql_vg_08032012.txt 2>&1

There are some suspicious "points to uninitialized bytes" messages.
Source line numbers are not shown since I don't have the debug version.

See: isql_vg_08032012.txt

Samo Dadela added a comment - 19/Apr/12 06:25 AM
Anyone update on this?

This is a critical issue and it would be nice if it makes it into 2.5.2.