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

gbak terminates/crashes when a read error occurs during restore #7996

Closed
ilya071294 opened this issue Feb 8, 2024 · 2 comments
Closed

gbak terminates/crashes when a read error occurs during restore #7996

ilya071294 opened this issue Feb 8, 2024 · 2 comments

Comments

@ilya071294
Copy link
Collaborator

FB5 on Linux.
When os_read function fails to read a backup file, gbak (or the server process in a case of restore via services) terminates/crashes with this backtrace:

#0  0x00007fb90d47541f in raise ()
#1  0x00007fb90d45f895 in abort ()
#2  0x00007fb8fc2ed24f in __gnu_cxx::__verbose_terminate_handler()
#3  0x00007fb8fca28316 in __cxxabiv1::__terminate(void (*)()) ()
#4  0x00007fb8fcac1cc9 in __cxa_call_terminate ()
#5  0x00007fb8fca27fc1 in __gxx_personality_v0 ()
#6  0x00007fb90de353c4 in _Unwind_RaiseException_Phase2 ()
#7  0x00007fb90de35a61 in _Unwind_RaiseException ()
#8  0x00007fb8fca284c7 in __cxa_throw ()
#9  0x00007fb8fc2e3b6a in Firebird::system_call_failed::raise (syscall=0x7fb8fcacb118 "pthread_mutex_destroy", error_code=16)
#10 0x00007fb8fc853d12 in Firebird::Mutex::~Mutex (this=0x7fb783a20138, __in_chrg=<optimized out>)
#11 Burp::IOBuffer::~IOBuffer (this=0x7fb783a200f0, __in_chrg=<optimized out>)
#12 Burp::RestoreRelationTask::~RestoreRelationTask (this=this@entry=0x7fb8bb07d4f0, __in_chrg=<optimized out>)
#13 0x00007fb8fc2da7b1 in (anonymous namespace)::restore (tdgbl=<optimized out>, provider=<optimized out>, file_name=<optimized out>, database_name=<optimized out>)
#14 0x00007fb8fc8ae251 in RESTORE_restore (file_name=file_name@entry=0x7fb78d659960 "backup.fbk", database_name=database_name@entry=0x7fb78d659a20 "database.fdb")
#15 0x00007fb8fc877744 in gbak (uSvc=<optimized out>)
#16 0x00007fb8fc879728 in BURP_main (uSvc=0x7fb862c44340)
#17 0x00007fb8fc556818 in Jrd::Service::run (arg=arg@entry=0x7fb862c44340)
#18 0x00007fb8fc912349 in (anonymous namespace)::ThreadArgs::run (this=<synthetic pointer>)
#19 (anonymous namespace)::threadStart (arg=0x7fb85fe4aa50)
#20 0x00007fb90da6358e in start_thread ()
#21 0x00007fb90d53a2d3 in clone ()

RestoreRelationTask::m_buffers contains 2 buffers, and one of them stayed locked (IOBuffer::m_locked is true). AFAIU, this happend because the buffer was pointed by ioBuf in RestoreRelationTask::fileReader and it was not unlocked when the exception occured.

@hvlad hvlad self-assigned this Feb 8, 2024
hvlad added a commit that referenced this issue Feb 8, 2024
@hvlad
Copy link
Member

hvlad commented Feb 8, 2024

Should be fixed in v5.0-release, please check

@ilya071294
Copy link
Collaborator Author

Should be fixed in v5.0-release, please check

The issue is fixed.

hvlad added a commit that referenced this issue Feb 8, 2024
Fixed similar case if file write is failed during backup.
hvlad added a commit that referenced this issue Feb 8, 2024
hvlad added a commit that referenced this issue Feb 8, 2024
Fixed similar case if file write is failed during backup.
@hvlad hvlad closed this as completed Feb 8, 2024
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

3 participants