Skip to content

pthread_rwlock_unlock() fails called in ~SharedMemoryBase() for a wrong thread #7253

@mariuszzy

Description

@mariuszzy

First of all please be gentle, I'm not a multithreaded software expert. This is my atemtp to build Firebird 4.0.1.2692-0 under Solaris 10 x86 with GCC 8.5.

There are two symptoms:

  1. In the log file an error is reported:
    Operating system call pthread_rwlock_unlock failed. Error code 1
    rwlock end-operation error
    operating system directive endRead(): pthread_rwlock_unlock failed
    Not owner
  2. isql connection stalls.

An error is raised in RWLock::endRead(). What I 've figured out is that ~SharedMemoryBase() destructor tries to FileLock::unlock() but is not the thread for which FileLock::setlock() was done. A simple trace is as follows:

  • SharedMemoryBase::SharedMemoryBase(): thread: 2 file: fb_tpc_c1000000200000008c56000000000000_0
  • SharedMemoryBase::SharedMemoryBase(): thread: 2 file: fb_tpc_c1000000200000008c56000000000000_0
  • SharedMemoryBase::~SharedMemoryBase(): thread: 2 file: fb_tpc_c1000000200000008c56000000000000_0
  • SharedMemoryBase::~SharedMemoryBase(): thread: 4 file: fb_tpc_c1000000200000008c56000000000000_0

I have ServerMode = Classic in firebird.conf

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions