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

Server crashes while restoring backup if the shadow file already exists [CORE5566] #5833

Closed
firebird-automations opened this issue Jun 12, 2017 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: John Kilin (johnkilin)

Attachments:
test.fbk

gbak -c -rep C:\TEMP\TEST.FBK C:\TEMP\TEST.FDB

Database is configured to have a shadow at C:\TEMP\CITYCARD.SHD. If there's no such a file, restore succeeds. If the file exists, expected error is reported:

gbak: ERROR:I/O error during "CreateFile (create)" operation for file "C:\TEMP\CITYCARD.SHD"
gbak: ERROR: Error while trying to create file
gbak: ERROR: Файл существует.
gbak:Exiting before completion due to errors

but then the engine crashes with the following stack:

msvcr100d.dll!memcmp() Line 127 Asm
engine12.dll!Firebird::MetaName::compare(const Firebird::MetaName & m={...}) Line 90 + 0x38 bytes C++
engine12.dll!Firebird::MetaName::operator==(const Firebird::MetaName & m={...}) Line 96 + 0x32 bytes C++
engine12.dll!PAR_find_proc_field(const Jrd::jrd_prc * procedure=0x00000000033f2260, const Firebird::MetaName & name={...}) Line 771 + 0x16 bytes C++
engine12.dll!Jrd::FieldNode::parse(Jrd::thread_db * tdbb=0x000000000012a4f0, Firebird::MemoryPool & pool={...}, Jrd::CompilerScratch * csb=0x000000000341ad50, const unsigned char blrOp='') Line 4855 + 0x15 bytes C++
engine12.dll!PAR_parse_node(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::CompilerScratch * csb=0x000000000341ad50) Line 1611 + 0x4b bytes C++
engine12.dll!PAR_parse_value(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::CompilerScratch * csb=0x000000000341ad50) Line 1544 + 0xf bytes C++
engine12.dll!parseMap(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::CompilerScratch * csb=0x000000000341ad50, unsigned long stream=0x00000001) Line 3326 + 0x15 bytes C++
engine12.dll!Jrd::UnionSourceNode::parse(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::CompilerScratch * csb=0x000000000341ad50, const short blrOp=0x004c) Line 1641 + 0x1a bytes C++
engine12.dll!PAR_parseRecordSource(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::CompilerScratch * csb=0x000000000341ad50) Line 1281 + 0x15 bytes C++
engine12.dll!PAR_rse(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::CompilerScratch * csb=0x000000000341ad50, short rse_op=0x0043) Line 1306 + 0x15 bytes C++
engine12.dll!PAR_rse(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::CompilerScratch * csb=0x000000000341ad50) Line 1426 + 0x15 bytes C++
engine12.dll!PAR_parse_node(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::CompilerScratch * csb=0x000000000341ad50) Line 1587 + 0x15 bytes C++
engine12.dll!PAR_blr(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::jrd_rel * relation=0x000000000341a750, const unsigned char * blr=0x0000000000129298, unsigned long blr_length=0x000001d8, Jrd::CompilerScratch * view_csb=0x0000000000000000, Jrd::CompilerScratch * * csb_ptr=0x00000000001295f8, Jrd::JrdStatement * * statementPtr=0x0000000000000000, const bool trigger=false, unsigned short flags=0x0000) Line 235 + 0x1a bytes C++
engine12.dll!MET_parse_blob(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::jrd_rel * relation=0x000000000341a750, Jrd::bid * blob_id=0x0000000000129898, Jrd::CompilerScratch * * csb_ptr=0x00000000001295f8, Jrd::JrdStatement * * statementPtr=0x0000000000000000, const bool trigger=false, bool validationExpr=false) Line 7750 + 0x58 bytes C++
engine12.dll!MET_get_dependencies(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::jrd_rel * relation=0x000000000341a750, const unsigned char * blob=0x0000000000000000, const unsigned long blob_length=0x00000000, Jrd::CompilerScratch * view_csb=0x0000000000000000, Jrd::bid * blob_id=0x0000000000129898, Jrd::JrdStatement * * statementPtr=0x0000000000000000, Jrd::CompilerScratch * * csb_ptr=0x0000000000129a18, const Firebird::MetaName & object_name={...}, int type=0x00000001, unsigned short flags=0x0000, Jrd::jrd_tra * transaction=0x000000000308c710, const Firebird::MetaName & domain_validation={...}) Line 5826 + 0x8d bytes C++
engine12.dll!MET_scan_relation(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::jrd_rel * relation=0x000000000341a750) Line 8796 + 0x92 bytes C++
engine12.dll!scan_relation(Jrd::thread_db * tdbb=0x000000000012a4f0, short phase=0x0003, Jrd::DeferredWork * work=0x0000000003414b98, Jrd::jrd_tra * __formal=0x000000000308c710) Line 10983 C++
engine12.dll!DFW_perform_work(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::jrd_tra * transaction=0x000000000308c710) Line 4746 + 0x28 bytes C++
engine12.dll!TRA_commit(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::jrd_tra * transaction=0x000000000308c710, const bool retaining_flag=false) Line 380 C++
engine12.dll!commit(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::jrd_tra * transaction=0x000000000308c710, const bool retaining_flag=false) Line 5484 C++
engine12.dll!JRD_commit_transaction(Jrd::thread_db * tdbb=0x000000000012a4f0, Jrd::jrd_tra * transaction=0x000000000308c710) Line 7729 C++
engine12.dll!Jrd::JTransaction::commit(Firebird::CheckStatusWrapper * user_status=0x000000000012a6e8) Line 2203 C++
engine12.dll!Firebird::ITransactionBaseImpl<Jrd::JTransaction,Firebird::CheckStatusWrapper,Firebird::IReferenceCountedImpl<Jrd::JTransaction,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Jrd::JTransaction,Firebird::CheckStatusWrapper,Firebird::InheritFirebird::ITransaction\ > > > >::cloopcommitDispatcher(Firebird::ITransaction * self=0x00000000024c9040, Firebird::IStatus * status=0x000000000012a9d0) Line 7105 + 0x36 bytes C++
fbclient.dll!Firebird::ITransaction::commitFirebird::CheckStatusWrapper\(Firebird::CheckStatusWrapper * status=0x000000000012a9c8) Line 1109 C++
fbclient.dll!Why::YTransaction::commit(Firebird::CheckStatusWrapper * status=0x000000000012a9c8) Line 4781 C++
fbclient.dll!isc_commit_transaction(__int64 * userStatus=0x000000000012aac0, unsigned int * traHandle=0x000000000012b100) Line 1711 C++
gbak.exe!close_out_transaction(gbak_action action=RESTORE, unsigned int * handle=0x000000000012b100) Line 1741 C++
gbak.exe!gbak(Firebird::UtilSvc * uSvc=0x00000000004b07a0) Line 1321 C++
gbak.exe!main(int argc=0x00000009, char * * argv=0x0000000001c626f0) Line 64 + 0x1f bytes C++
gbak.exe!__tmainCRTStartup() Line 555 + 0x19 bytes C
gbak.exe!mainCRTStartup() Line 371 C
kernel32.dll!BaseThreadInitThunk() + 0xd bytes
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!RtlUserThreadStart() + 0x21 bytes

Commits: 8dbf4e8 8735e33 48d6f37

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

See note 22/Jun/17 12:42 PM

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

reporter: Dmitry Yemanov [ dimitr ] => John Kilin [ johnkilin ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Attachment: test.fbk [ 13140 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 3.0.2 [ 10785 ]

Version: 2.5.7 [ 10770 ]

Version: 3.0.1 [ 10730 ]

Version: 2.5.6 [ 10721 ]

Version: 3.0.0 [ 10740 ]

Version: 4.0 Initial [ 10621 ]

Version: 2.5.5 [ 10670 ]

Version: 2.5.4 [ 10585 ]

Version: 2.5.3 Update 1 [ 10650 ]

Version: 2.1.7 [ 10651 ]

Version: 2.5.3 [ 10461 ]

Version: 2.5.2 Update 1 [ 10521 ]

Version: 2.5.2 [ 10450 ]

Version: 2.5.1 [ 10333 ]

Version: 2.5.0 [ 10221 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

Fix Version: 2.5.8 [ 10809 ]

Fix Version: 3.0.3 [ 10810 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

if exist C:\temp\citycard.fdb del C:\temp\citycard.fdb
if exist C:\temp\citycard.shd del C:\temp\citycard.shd

C:\MIX\firebird\fb40\gbak -rep C:\MIX\firebird\QA\fbt-repo\tmp\c5566.fbk localhost:C:\temp\citycard.fdb
-- OK, finished with creating two files "C:\temp\citycard.*" --

del C:\TEMP\CITYCARD.SHD
-- REPEAT restoring:
C:\MIX\firebird\fb40\gbak -rep C:\MIX\firebird\QA\fbt-repo\tmp\c5566.fbk localhost:C:\temp\citycard.fdb
-- Again OK

del C:\TEMP\CITYCARD.FDB
-- REPEAT restoring:
C:\MIX\firebird\fb40\gbak -rep C:\MIX\firebird\QA\fbt-repo\tmp\c5566.fbk localhost:C:\temp\citycard.fdb
gbak: ERROR:I/O error during "CreateFile (create)" operation for file "C:\TEMP\CITYCARD.SHD"
gbak: ERROR: Error while trying to create file
gbak: ERROR: <localized message about file exists here>
gbak:Exiting before completion due to errors

Fix was incomplete or me wrong soemwhere ?

PS.
WI-T4.0.0.680

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Deferred

Test Details: See note 22/Jun/17 12:42 PM

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