Skip to content

Commit 3dc03dd

Browse files
committed
Fixed #7809: Crash "Fatal lock manager error: Process disappeared in LockManager::acquire_shmem"
(cherry picked from commit 3dba22b)
1 parent bd40df2 commit 3dc03dd

File tree

2 files changed

+256
-414
lines changed

2 files changed

+256
-414
lines changed

src/common/isc_s_proto.h

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ class MemoryHeader
180180
#define USE_FCNTL
181181
#endif
182182

183-
class CountedFd;
184-
class CountedRWLock;
183+
class SharedFileInfo;
185184

186185
class FileLock
187186
{
@@ -191,8 +190,8 @@ class FileLock
191190
enum LockMode {FLM_EXCLUSIVE, FLM_TRY_EXCLUSIVE, FLM_SHARED};
192191

193192
typedef void InitFunction(int fd);
194-
explicit FileLock(const char* fileName, InitFunction* init = NULL); // main ctor
195-
FileLock(const FileLock* main, int s); // creates additional lock for existing file
193+
194+
explicit FileLock(const char* fileName, InitFunction* init = NULL);
196195
~FileLock();
197196

198197
// Main function to lock file
@@ -201,24 +200,18 @@ class FileLock
201200
// Alternative locker is using status vector to report errors
202201
bool setlock(Firebird::CheckStatusWrapper* status, const LockMode mode);
203202

204-
// unlocking can only put error into log file - we can't throw in dtors
203+
// Unlocking can only put error into log file - we can't throw in dtors
205204
void unlock();
206205

206+
// Obvious access to file descriptor
207207
int getFd();
208208

209-
private:
210209
enum LockLevel {LCK_NONE, LCK_SHARED, LCK_EXCL};
211210

211+
private:
212+
Firebird::RefPtr<SharedFileInfo> file;
213+
InitFunction* initFunction;
212214
LockLevel level;
213-
CountedFd* oFile;
214-
#ifdef USE_FCNTL
215-
int lStart;
216-
#endif
217-
class CountedRWLock* rwcl; // Due to order of init in ctor rwcl must go after fd & start
218-
219-
Firebird::string getLockId();
220-
class CountedRWLock* getRw();
221-
void rwUnlock();
222215
};
223216

224217
#endif // UNIX

0 commit comments

Comments
 (0)