Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault after trying to create cyclic dependency in table and doing select from this table in same connection [CORE4254] #4578

Closed
firebird-automations opened this issue Oct 28, 2013 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @artyom-smirnov

Duplicates CORE1894

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<void const*, Firebird::EmptyStorage<void const*> >::find (this=0xb7fe7418, item=@0x4656080, pos=@0x4656050) at ../src/include/../common/classes/array.h:358
#⁠2 0x083d308d in Firebird::Array<void const*, Firebird::EmptyStorage<void const*> >::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 ~10000 of exactly same frames.

====== Test Details ======

See test for core-1894 (code looks like copy/paste :))

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Completely duplicates CORE1894.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue duplicates CORE1894 [ CORE1894 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Covered by another test(s)

Test Details: See test for core-1894 (code looks like copy/paste :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant