Subject Firebird Memory Exhausted
Author call.assist
Hi All

We are running Linux with FB 1.53 classic
Linux CHERYL 2.6.18-92.1.22.el5 #1 SMP Tue Dec 16 12:03:43 EST 2008 i686 i686 i386 GNU/Linux

We had a backup job fail last night with an interesting error :

Fatal lock manager error: invalid lock id (137636), errno: 2
--No such file or directory
gbak: adjusting an invalid decompression length from 17 to 14
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: do not recognize table attribute 0 -- continuing
gbak: ERROR: expected record length
gbak: Exiting before completion due to errors
*** glibc detected *** ./gbak: double free or corruption (!prev): 0x09cae640 ***
======= Backtrace: =========
/lib/libc.so.6[0x8f9d06]
/lib/libc.so.6(cfree+0x90)[0x8fd1e0]
/usr/lib/libfbembed.so.1[0x25f272]
/usr/lib/libfbembed.so.1[0x25f346]
/usr/lib/libfbembed.so.1(gds__free+0x28)[0x1296b8]
/gbak[0x8084734]
/gbak[0x807fcaf]
/lib/libc.so.6(__libc_start_main+0xdc)[0x8a6dec]
/gbak(isc_start_transaction+0x41)[0x8049e11]
======= Memory map: ========
00110000-00111000 rwxp 00110000 00:00 0
00111000-002b2000 r-xp 00000000 fd:00 20840530 /opt/firebird/lib/libfbembed.so.1.5.3
002b2000-002da000 rwxp 001a0000 fd:00 20840530 /opt/firebird/lib/libfbembed.so.1.5.3
002da000-002e2000 rwxp 002da000 00:00 0
00677000-00726000 r-xp 00000000 fd:00 4315976 /usr/lib/libstdc++.so.5.0.7
00726000-0072b000 rwxp 000ae000 fd:00 4315976 /usr/lib/libstdc++.so.5.0.7
0072b000-00730000 rwxp 0072b000 00:00 0
0077a000-0079f000 r-xp 00000000 fd:00 5767185 /lib/libm-2.5.so
0079f000-007a0000 r-xp 00024000 fd:00 5767185 /lib/libm-2.5.so
007a0000-007a1000 rwxp 00025000 fd:00 5767185 /lib/libm-2.5.so
00873000-0088d000 r-xp 00000000 fd:00 5767207 /lib/ld-2.5.so
0088d000-0088e000 r-xp 00019000 fd:00 5767207 /lib/ld-2.5.so
0088e000-0088f000 rwxp 0001a000 fd:00 5767207 /lib/ld-2.5.so
00891000-009ce000 r-xp 00000000 fd:00 5767209 /lib/libc-2.5.so
009ce000-009d0000 r-xp 0013d000 fd:00 5767209 /lib/libc-2.5.so
009d0000-009d1000 rwxp 0013f000 fd:00 5767209 /lib/libc-2.5.so
009d1000-009d4000 rwxp 009d1000 00:00 0
009ff000-00a01000 r-xp 00000000 fd:00 5768017 /lib/libdl-2.5.so
00a01000-00a02000 r-xp 00001000 fd:00 5768017 /lib/libdl-2.5.so
00a02000-00a03000 rwxp 00002000 fd:00 5768017 /lib/libdl-2.5.so
00a23000-00a24000 r-xp 00a23000 00:00 0 [vdso]
00f58000-00f98000 rwxs 00000000 fd:00 20447242 /opt/firebird/isc_lock1.CHERYL
05614000-0561f000 r-xp 00000000 fd:00 5767265 /lib/libgcc_s-4.1.2-20080102.so.1
0561f000-05620000 rwxp 0000a000 fd:00 5767265 /lib/libgcc_s-4.1.2-20080102.so.1
05aa8000-05ab1000 r-xp 00000000 fd:00 5769512 /lib/libcrypt-2.5.so
05ab1000-05ab2000 r-xp 00008000 fd:00 5769512 /lib/libcrypt-2.5.so
05ab2000-05ab3000 rwxp 00009000 fd:00 5769512 /lib/libcrypt-2.5.so
05ab3000-05ada000 rwxp 05ab3000 00:00 0
05b3a000-05b7a000 r-xp 00000000 fd:00 4314556 /usr/lib/libncurses.so.5.5
05b7a000-05b82000 rwxp 00040000 fd:00 4314556 /usr/lib/libncurses.so.5.5
05b82000-05b83000 rwxp 05b82000 00:00 0
08048000-0808f000 r-xp 00000000 fd:00 20840451 /opt/firebird/bin/gbak
0808f000-08099000 rwxp 00046000 fd:00 20840451 /opt/firebird/bin/gbak
09ac2000-09d33000 rwxp 09ac2000 00:00 0
b7e00000-b7e21000 rwxp b7e00000 00:00 0
b7e21000-b7f00000 --xp b7e21000 00:00 0
bfa26000-bfa3b000 rwxp bfa26000 00:00 0 [stack]
/opt/firebird/drdbmaint.sh: line 6: 2040 Aborted ./gbak -R -user x-pas x/opt/firebird/drdbase.gbk /opt/firebird/drdbasetmp.fdb




I rebooted, and now can create a new backup, but when i try to restore it i get the following :

root@CHERYL bin]# ./gbak -R -user x -pas x /opt/firebird/drdbase.gbk /opt/firebird/drdbasetmp.fdb
gbak: ERROR: System memory exhausted
gbak: Exiting before completion due to errors
Segmentation fault

I Restored i copy using IBOConsole from a Windows PC and that seems to have worked

Anyone any ideas?

Mem: 2595604k total, 490316k used, 2105288k free, 28708k buffers
Swap: 1048568k total, 0k used, 1048568k free, 378260k cached



Cheers
Andrew