[Firebird-devel] [FB-Tracker] Created: (CORE-6458) Impossible to cancel query

2020-12-22 Thread Artyom Smirnov (JIRA)
Impossible to cancel query
--

 Key: CORE-6458
 URL: http://tracker.firebirdsql.org/browse/CORE-6458
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 RC 1
Reporter: Artyom Smirnov


To reproduce it enough to create long query in isql and try to cancel it with 
Ctlr-C:

create database 'localhost:/tmp/test';
create sequence g;
select count(i) from (select gen_id(g,1) i from rdb$types a,rdb$types 
b,rdb$types c,rdb$types d);

Looks like it was broken after merging query restart functionality 
(9ac2238c3d3552c35530606ba91a7752e5bab05c).



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6338) Embedded server crashing on short connects to database which want to be sweeped

2020-06-19 Thread Artyom Smirnov (JIRA)
Embedded server crashing on short connects to database which want to be sweeped
---

 Key: CORE-6338
 URL: http://tracker.firebirdsql.org/browse/CORE-6338
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.5
 Environment: linux
Reporter: Artyom Smirnov


In some cases firebird server can craft such database, which crashes embedded 
server if embedded connection too short to complete sweep.

To reproduce stop firebird, make sure running user will have all permissions to 
work as embedded and run included script.
Script will emulate database crafting by disabling sweep, inserting data but 
nor commit nor rollback it and enabling sweep. Next connections CAN crash, but 
not always. If crafted database will be properly sweeped crashes disappearing.
Stacktraces telling it crashing during exit, but stack with segfault smashed.

Reproducing script:

https://gist.github.com/artyom-smirnov/9f7f3d873f34fc12dcd721cab92818e3

or

#!/bin/bash
rm -f repro.fdb f

ISQL=bin/isql
GFIX=bin/gfix

cat << EOF > create.sql
create database 'repro.fdb';
create table test(test varchar(255));
EOF

cat << EOF > connect.sql
connect 'repro.fdb' user 'sysdba' password 'masterkey';
exit;
EOF

cat << EOF > gdbinit
set \$_exitcode = -1
run
if \$_exitcode != -1
quit
end
EOF

$ISQL -u sysdba -p masterkey -i create.sql
$GFIX -user sysdba -pass masterkey -h 0 repro.fdb

mkfifo f
cat f | $ISQL -u sysdba -p masterkey repro.fdb&
ISQL_PID=$!
exec 3>f
for i in `seq 1 1000`; do
cat << EOF > f
insert into test values('text');
EOF
done

kill -KILL $ISQL_PID

$GFIX -user sysdba -pass masterkey -h 1 repro.fdb

while true; do gdb -x gdbinit --args $ISQL -u sysdba -p masterkey -i 
connect.sql; done
#while true; do $ISQL -u sysdba -p masterkey -i connect.sql; done

Stack with crash looks smashed:

Thread 6 "isql" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffebfff700 (LWP 90529)]
0x753bfd72 in ?? ()
(gdb) bt
#0  0x753bfd72 in ?? ()
#1  0x0010 in ?? ()
#2  0x77bc6340 in ?? ()
#3  0xebffecb0 in ?? ()
#4  0x758e60e2 in ?? ()
#5  0x0001 in ?? ()
#6  0x14000218 in ?? ()
#7  0x in ?? ()
(gdb) 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6038) Srp user manager sporadically creates users which can not attach

2019-03-29 Thread Artyom Smirnov (JIRA)
Srp user manager sporadically creates users which can not attach


 Key: CORE-6038
 URL: http://tracker.firebirdsql.org/browse/CORE-6038
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 3.0.4
 Environment: Ubuntu 18.10 x86_64, Cent OS 6/7 x86_64
Reporter: Artyom Smirnov


To reproduce this bug enough to create user/try to login/drop user many times.

I digged into Srp manager and found it happen with some "magic" salts. For 
example: AE7A9732FB795098A4ECE3CE28BD01C4363E870F9AD399AFBEE2CBC6FBB30580

If you try to set this constant salt in SrpManagement.cpp all newly created 
users will be unable to authenticate (SrpServer.cpp: SrpServer::authenticate 
"if (clientProof == serverProof)" always false).

Reproducing script:

#!/bin/bash

BIN=/opt/firebird/bin/
DBPATH=/tmp/test
DB=localhost:$DBPATH

cat << EOF > /tmp/prepare
create database '$DB' user sysdba password 'masterkey';
drop user test;
EOF

cat << EOF > /tmp/sql
connect '$DB' user sysdba password 'masterkey';
create user test password 'test';
connect '$DB' user test password 'test';
connect '$DB' user sysdba password 'masterkey';
drop user test;
EOF

rm $DBPATH
$BIN/isql -i /tmp/prepare

set -e

while true; do
$BIN/isql -b -i /tmp/sql
done


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-6027) Server hang on new attachment right after trace session stop

2019-03-19 Thread Artyom Smirnov (JIRA)
Server hang on new attachment right after trace session stop


 Key: CORE-6027
 URL: http://tracker.firebirdsql.org/browse/CORE-6027
 Project: Firebird Core
  Issue Type: Bug
  Components: TRACEMGR
Affects Versions: 3.0.4
 Environment: Linux x86_64
Reporter: Artyom Smirnov


Test script 
(https://gist.github.com/artyom-smirnov/076879ff9edff7f2b58147eb5665f0ed):
#!/bin/bash

DB_PATH=/tmp/testdb.fdb
DB=localhost:$DB_PATH
ISQL="/opt/firebird/bin/isql -q -u SYSDBA -p masterkey"

cat << EOF > /tmp/fbtrace_custom.conf
database
{
enabled = true
format = 0
log_connections = true
log_statement_start =true
}
EOF

cat << EOF > /tmp/createdb.sql
create database '$DB';
EOF

cat << EOF > /tmp/q.sql
connect '$DB';
exit 0;
EOF

rm -f $DB_PATH

$ISQL -i /tmp/createdb.sql

while true; do
/opt/firebird/bin/fbtracemgr -se service_mgr -user SYSDBA -password 
masterkey -start -c /tmp/fbtrace_custom.conf &
rdbtracemgr_pid=$!
sleep 1
kill -TERM $rdbtracemgr_pid
$ISQL -i /tmp/q.sql
done


Run as:
sudo -u firebird ./test.sh

Result will be like this and then server will hang:

Trace session ID 1 started
Trace session ID 2 started
Trace session ID 3 started
Trace session ID 4 started
Trace session ID 5 started
Trace session ID 6 started
Trace session ID 7 started
Trace session ID 8 started
Trace session ID 9 started
Trace session ID 10 started
Trace session ID 11 started
Trace session ID 12 started
Trace session ID 13 started
Trace session ID 14 started
Trace session ID 15 started
Trace session ID 16 started
./test.sh: line 41:  5872 Segmentation fault  (core dumped) 
/opt/firebird/bin/fbtracemgr -se service_mgr -user SYSDBA -password masterkey 
-start -c /tmp/fbtrace_custom.conf
Trace session ID 17 started
Trace session ID 18 started
./test.sh: line 41:  5903 Segmentation fault  (core dumped) 
/opt/firebird/bin/fbtracemgr -se service_mgr -user SYSDBA -password masterkey 
-start -c /tmp/fbtrace_custom.conf
Trace session ID 19 started
I/O error during "lseek" operation for file "/tmp/firebird/fb_trace_ggAtlF"
-Error while trying to read from file
-Bad file descriptor
Trace session ID 21 started
I/O error during "lseek" operation for file "/tmp/firebird/fb_trace_ggAtlF"
-Error while trying to read from file
-Bad file descriptor
Trace session ID 23 started
I/O error during "lseek" operation for file "/tmp/firebird/fb_trace_ggAtlF"
-Error while trying to read from file
-Bad file descriptor
I/O error during "lseek" operation for file "/tmp/firebird/fb_trace_ggAtlF"
-Error while trying to read from file
-Bad file descriptor
I/O error during "lseek" operation for file "/tmp/firebird/fb_trace_ggAtlF"
-Error while trying to read from file
-Bad file descriptor
I/O error during "lseek" operation for file "/tmp/firebird/fb_trace_ggAtlF"
-Error while trying to read from file
-Bad file descriptor
I/O error during "lseek" operation for file "/tmp/firebird/fb_trace_ggAtlF"
-Error while trying to read from file
-Bad file descriptor
I/O error during "lseek" operation for file "/tmp/firebird/fb_trace_ggAtlF"
-Error while trying to read from file
-Bad file descriptor
I/O error during "lseek" operation for file "/tmp/firebird/fb_trace_ggAtlF"
-Error while trying to read from file
-Bad file descriptor
Trace session ID 31 started

Backtrace of hanged server:

#0  __pthread_mutex_lock_full (mutex=0x7f8ddf3b6010) at 
../nptl/pthread_mutex_lock.c:313
#1  0x7f8ddc25e315 in Firebird::SharedMemoryBase::mutexLock 
(this=0x7f8ddbdd3bc0) at /usr/home/firebird/3.0.4/src/common/isc_sync.cpp:3437
#2  0x7f8ddc1c12d0 in Jrd::ConfigStorage::acquire 
(this=this@entry=0x7f8ddb8a7230)
at /usr/home/firebird/3.0.4/src/jrd/trace/TraceConfigStorage.cpp:308
#3  0x7f8ddc1c8215 in Jrd::StorageGuard::StorageGuard 
(storage=0x7f8ddb8a7230, this=)
at 
/usr/home/firebird/3.0.4/src/jrd/trace/../../jrd/trace/../../jrd/trace/TraceConfigStorage.h:172
#4  Jrd::TraceManager::update_sessions (this=this@entry=0x7f8ddb4c0070) at 
/usr/home/firebird/3.0.4/src/jrd/trace/TraceManager.cpp:184
#5  0x7f8ddbf92ecb in Jrd::TraceManager::needs (this=0x7f8ddb4c0070, e=0) 
at /usr/home/firebird/3.0.4/src/jrd/../jrd/trace/TraceManager.h:125
#6  0x7f8ddbf85a1a in Jrd::JProvider::internalAttach (this=, 
user_status=0x7f8dd9391590, 
filename=0x7f8dd939172c "/opt/firebird/security3.fdb", 
dpb_length=, dpb=, existingId=0x0)
at /usr/home/firebird/3.0.4/src/jrd/jrd.cpp:1874
#7  0x7f8ddbe82e58 in Firebird::IProviderBaseImpl > > > > > 
>::cloopattachDatabaseDispatcher(Firebird::IProvider*, Firebird::IStatus*, char 
const*, unsigned int, unsigned char const*) () from 
/opt/firebird/plugins/libEngine12.so
#8  0x7f8ddf469df6 in 
Firebird::IProvider::attachDatabase 
(dpb=0x7f8dd93917a8 "\001M", dpbLength=34, 
fileName=0x7f8dd939172c "/opt/firebird/se

[Firebird-devel] [FB-Tracker] Created: (CORE-6012) Possible server/utilities hang because of infinity loop in AbstractString::vprintf

2019-02-25 Thread Artyom Smirnov (JIRA)
Possible server/utilities hang because of infinity loop in 
AbstractString::vprintf
--

 Key: CORE-6012
 URL: http://tracker.firebirdsql.org/browse/CORE-6012
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Beta 1, 3.0.4, 3.0.3, 4.0 Alpha 1, 3.0.2, 3.0.1, 
3.0.0, 4.0 Initial, 3.0.5, 4.0 Beta 2, 3.0.6
Reporter: Artyom Smirnov


The problem is because only result of vsnprintf checked, but not cause of this 
result (e.g. errno).

One of case with this issue I've got and reproduced is hanging gsec on CentOS 6 
which have bug in glibc (https://sourceware.org/bugzilla/show_bug.cgi?id=6530)

For example simple reproduction for FB 3.x/4.x: shutdown server, create system 
audit file with service auditing and add it to firebird.conf:

services
{
enabled = true
log_filename = /tmp/log
log_services = true
log_service_query = false
}

Run gsec with locale which is not POSIX or C:

LANG=en_US.utf8 bin/gsec -user SYSDBA -password masterkey -add test -pw test

vprintf will get string like "-user SYSDBA -ADD \377TEST\377 -PW \377test\377" 
and will hang on it, because vsnprintf result always be -1 and errno always be 
84.

All versions affected by infinity loop hang, because this part of code is same, 
but this particular case of course will hang only on 3.x/4.x.

What about:
1. Checking errno in vprintf and at least throw exception instead hang?
2. Cleanup service terminal symbols in TracePluginImpl::log_event_service_start 
before passing it to vprintf?


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5972) External engine trigger crashing server if table have computed field

2018-12-06 Thread Artyom Smirnov (JIRA)
External engine trigger crashing server if table have computed field


 Key: CORE-5972
 URL: http://tracker.firebirdsql.org/browse/CORE-5972
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Beta 1, 3.0.5
Reporter: Artyom Smirnov


Reproduction steps (on master):

1. Create simple UDR trigger in examples/udr/Triggers.cpp and build it.

FB_UDR_BEGIN_TRIGGER(dummy)
FB_UDR_EXECUTE_TRIGGER
{
printf("test! \n");
}
FB_UDR_END_TRIGGER

2. Execute it on table with computed field:

create database 'localhost:/tmp/test_trig.fdb';
create table test(id int, comp int computed by (1));
create trigger dummy after insert on test external name 'udrcpp_example!dummy' 
engine udr;
insert into test values(1);

3. Server will crash.

Stacktrace:

Thread 5 "firebird" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x70c04700 (LWP 15380)]
__memmove_sse2_unaligned_erms () at 
../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:311
311 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file 
or directory.
(gdb) bt 6
#0  __memmove_sse2_unaligned_erms () at 
../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:311
#1  0x74e62d82 in CVT_move_common (from=0x70c02440, 
to=0x70c02450, decSt=..., cb=0x747cc700) at 
/workspace/rdb/firebird_master/src/common/cvt.cpp:1508
#2  0x74a85e45 in CVT_move (from=0x70c02440, to=0x70c02450, 
decSt=...) at /workspace/rdb/firebird_master/src/jrd/../jrd/cvt_proto.h:74
#3  0x74b4d66f in MOV_move (tdbb=0x70c03580, from=0x70c02440, 
to=0x70c02450) at /workspace/rdb/firebird_master/src/jrd/mov.cpp:449
#4  0x74977d9f in Jrd::ExtEngineManager::Trigger::setValues 
(this=0x74378c80, tdbb=0x70c03580, msgBuffer=..., rpb=0x7fffe8fe55f0)
at /workspace/rdb/firebird_master/src/jrd/ExtEngineManager.cpp:983
#5  0x749777e8 in Jrd::ExtEngineManager::Trigger::execute 
(this=0x74378c80, tdbb=0x70c03580, action=1, oldRpb=0x0, 
newRpb=0x7fffe8fe55f0)
at /workspace/rdb/firebird_master/src/jrd/ExtEngineManager.cpp:914
(More stack frames follow...)
(gdb) f 1
#1  0x74e62d82 in CVT_move_common (from=0x70c02440, 
to=0x70c02450, decSt=..., cb=0x747cc700) at 
/workspace/rdb/firebird_master/src/common/cvt.cpp:1508
1508memcpy(p, q, length);
(gdb) p q
$1 = (const UCHAR *) 0x0


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5665) Inconsistency of formatting double precision values between linux and windows

2017-11-20 Thread Artyom Smirnov (JIRA)
Inconsistency of formatting double precision values between linux and windows
-

 Key: CORE-5665
 URL: http://tracker.firebirdsql.org/browse/CORE-5665
 Project: Firebird Core
  Issue Type: Bug
  Components: ISQL
Affects Versions: 3.0.2
Reporter: Artyom Smirnov
Priority: Minor


Also probably inconsistency of formatting values in range -1 < 0 < 1. Padding 
zeros not always rendered right.

set list;
select char_length(cast(cast(0 as double precision) as varchar(20))),
  char_length(cast(cast(0.1 as double precision) as varchar(20))),
  char_length(cast(cast(1 as double precision) as varchar(20))),
  char_length(cast(cast(1.1 as double precision) as varchar(20))) from 
rdb$database;

on linux result is:
CHAR_LENGTH 17
CHAR_LENGTH 18
CHAR_LENGTH 17
CHAR_LENGTH 17

on windows result is:
CHAR_LENGTH 18
CHAR_LENGTH 18
CHAR_LENGTH 17
CHAR_LENGTH 17


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5645) Wrong transaction can be passed to external engine

2017-10-19 Thread Artyom Smirnov (JIRA)
Wrong transaction can be passed to external engine
--

 Key: CORE-5645
 URL: http://tracker.firebirdsql.org/browse/CORE-5645
 Project: Firebird Core
  Issue Type: Bug
  Components: API / Client Library, Engine
Affects Versions: 4.0 Alpha 1, 3.0.2
Reporter: Artyom Smirnov


Can't give reproducible code+query right now, but may be description may be 
enough.

In ExtEngineManager.cpp in 
ExtEngineManager::ExternalContextImpl::setTransaction newTransaction obtained 
from tdbb and assigned to internalTransaction if newTransaction is differs from 
internalTransaction, and then externalTransaction created. But if transaction 
were committed, and by chance object of newly created internal transaction will 
have same address, new external transaction will not be created, and thus 
plugin will get wrong transaction.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5409) Non-utf8 input from stdin in isql seems broken on linux

2016-11-30 Thread Artyom Smirnov (JIRA)
Non-utf8 input from stdin in isql seems broken on linux
---

 Key: CORE-5409
 URL: http://tracker.firebirdsql.org/browse/CORE-5409
 Project: Firebird Core
  Issue Type: Bug
  Components: ISQL
Affects Versions: 3.0.1, 3.0.0, 3.0.2
 Environment: Linux
Reporter: Artyom Smirnov
Priority: Minor


Prepare file in some non-utf8 encoding. Found this example text in 
fbt-repository:

echo 'recreate table "ĄČĘĢÆĖŠŚÖÜØ£"(
"ąčęėįšųūž" varchar(50) character set dos775
,"Õisu ja kariste järved" blob sub_type 1 character set dos775
);' | iconv -f utf8 -t cp775 > test775.sql

Try to execute it from stdin:

cat  test775.sql | bin/isql -ch dos775 -u sysdba -p masterkey 
localhost:/tmp/test.fdb 
Use CONNECT or CREATE DATABASE to specify a database

And we will get error:

Expected end of statement, encountered EOF

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

   

--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4676) Crash on unexpected client disconnection with opened transaction

2015-01-29 Thread Artyom Smirnov (JIRA)
Crash on unexpected client disconnection with opened transaction


 Key: CORE-4676
 URL: http://tracker.firebirdsql.org/browse/CORE-4676
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.4
Reporter: Artyom Smirnov


Reproducing:

Run isql and execute:
create database 'a';
create table a(id int);
insert into a values('1');

Do not commit anything. Then do:
killall -9 isql

Server will crash.

Bug probably introduced with commit 11366: This should fix CORE-4558: 
SuperServer dies when client is disconnected abnormally during the index 
navigational scan.
Commit slightly changed attachment release order so now all attachment requests 
released before dsql_dbb instance destroying which have pointers to already 
destroyed requests. On second releasing of requests server crashing.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4288) Server crashes if execute DDL statement in autonomous transaction

2013-12-05 Thread Artyom Smirnov (JIRA)
Server crashes if execute DDL statement in autonomous transaction
-

 Key: CORE-4288
 URL: http://tracker.firebirdsql.org/browse/CORE-4288
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.3
Reporter: Artyom Smirnov


set term !;
execute block
as
begin
in autonomous transaction do
execute statement('create table a(a int)');
end!
set term ;!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-4254) Segfault after trying to create cyclic dependency in table and doing select from this table in same connection

2013-10-28 Thread Artyom Smirnov (JIRA)
Segfault after trying to create cyclic dependency in table and doing select 
from this table in same connection
--

 Key: CORE-4254
 URL: http://tracker.firebirdsql.org/browse/CORE-4254
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 2.5.2 Update 1, 2.5.3
 Environment: Ubuntu 13.10 x86_64
RHEL 5.4 x86
Reporter: Artyom Smirnov


Cyclic dependency will not appear, as expected, but query compilation will 
segfault. Stacktrace have ton of CMP_pass1 (like cyclic dependency actually 
exist). On next connection crash can not be reproduced.

Reproducing query for isql:
create database 'test.fdb';

create table t (
n integer,
n1 computed by (n),
n2 computed by (n1)
);
commit;

alter table t alter n1 computed by (n2);
commit;

select * from t;

Stacktrace:
(gdb) bt
#0  0x0040ec3a in mcount () from /lib/libc.so.6
#1  0x083d3008 in Firebird::Array >::find (this=0xb7fe7418, item=@0x4656080, pos=@0x4656050) at 
../src/include/../common/classes/array.h:358
#2  0x083d308d in Firebird::Array >::exist (this=0xb7fe7418, item=@0x4656080) at 
../src/include/../common/classes/array.h:372
#3  0x083d2c1f in Firebird::PublicHandle::isKnownHandle (this=0xb7deb084) at 
../src/common/classes/PublicHandle.cpp:70
#4  0x0809d40d in Jrd::Database::checkHandle (this=0xb7deb084) at 
../src/dsql/../dsql/../jrd/Database.h:357
#5  0x0809d53c in CHECK_TDBB (tdbb=0x5054780) at ../src/dsql/../jrd/jrd.h:963
#6  0x0809d5c4 in SET_TDBB (tdbb=@0x4656500) at ../src/dsql/../jrd/jrd.h:1002
#7  0x08170d6c in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226794) 
at ../src/jrd/cmp.cpp:3653
#8  0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb72267d4) 
at ../src/jrd/cmp.cpp:3967
#9  0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226814) 
at ../src/jrd/cmp.cpp:3967
#10 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226854) 
at ../src/jrd/cmp.cpp:3967
#11 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226894) 
at ../src/jrd/cmp.cpp:3967
#12 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb72268d4) 
at ../src/jrd/cmp.cpp:3967
#13 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226914) 
at ../src/jrd/cmp.cpp:3967
#14 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226954) 
at ../src/jrd/cmp.cpp:3967
#15 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226994) 
at ../src/jrd/cmp.cpp:3967
#16 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb72269d4) 
at ../src/jrd/cmp.cpp:3967
#17 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226a14) 
at ../src/jrd/cmp.cpp:3967
#18 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226a54) 
at ../src/jrd/cmp.cpp:3967
#19 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226a94) 
at ../src/jrd/cmp.cpp:3967
#20 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226ad4) 
at ../src/jrd/cmp.cpp:3967
#21 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226b14) 
at ../src/jrd/cmp.cpp:3967
#22 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226b54) 
at ../src/jrd/cmp.cpp:3967
#23 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226b94) 
at ../src/jrd/cmp.cpp:3967
#24 0x08172032 in CMP_pass1 (tdbb=0x5054780, csb=0xb73a87f8, node=0xb7226bd4) 
at ../src/jrd/cmp.cpp:3967

Here ~1 of exactly same frames.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel