Subject ISQL hangs at the very beginning
Author Jaroslaw Swierczynski
Hello,

I have a problem with isql. No matter what I do (executing it with or
without database name), it hangs right away:

# isql
Use CONNECT or CREATE DATABASE to specify a database

At this point, isql starts to eat CPU (FB doesn't seem to do it), the
machine is unresponsive and it only helps when I kill isql (it takes
some time until the system processes the command). FB does not quit.
Nothing in firebird.log.

I had the same problem a few weeks ago. Back then I assumed that the
server was bothered with connection attempts from applications that
tried to contact it as it was Interbase (I've been migrating from IB)
because when I turned off all those applications, isql started to
work. And firebird.log was not empty at that time, unfortunatelly I
don't recall what kind of errors were showing.

Now the other applications are still not running, yet isql has started
to hang. It's even better, shutdown FB and isql still hangs...

Another interesting thing is that when I don't kill isql it after some
time (not sure what time since I left it overnight) it segfaults like
this:

#0 re_clear_display (el=0x7f800) at refresh.c:1112
#1 0x00052d2c in read_prepare (el=0x7f800) at read.c:382
#2 0x000532a0 in el_gets (el=0xff262a00, nread=0x20000000) at read.c:454
#3 0x0004df58 in readline (p=<value optimized out>) at readline.c:386
#4 0x0001c8f8 in readNextInputLine ()
#5 0x0001c99c in getNextInputChar ()
#6 0x0002a8c4 in do_isql ()
#7 0x0002bc68 in ISQL_main ()
#8 0x00013e24 in _start ()

The segfaulting line is:

el->el_display[i][0] = '\0';

gdb claims that el_display is null. I have had a quick look at the
code and my best guess is that rl_initialize() in
readline.c:readline() returns -1 because resources could not be
allocated by el_init() and readline() does not check rl_initialzie()'s
return code. If I'm right, it might indicate memory leaks in isql but
this is a long shot and I have no idea how to further debug this.

Build info:

Firebird from branch B2_1_Release, checked out on December 18, 2008
Built on Solaris 9 SPARC, running on Solaris 10 SPARC

Any help will be appreciated. Thanks.

Take care,
Jarek