[fpc-pascal]FPC Problem with reAllocMem...
James Mills
prologic at prologitech.com
Tue Feb 11 05:00:32 CET 2003
Hi all,
I've annoyed you guys enough with pointers, objects and clases :P I'm
sorry :)
This bugs me though as to why this program crashes at the 4th call to
addNick(nick: String);
Here is the gdb results, and attached is the source code if anyone is
willing to have a look.
thank you very much :)
James
$ gdb datatest
gdb: Symbol `emacs_ctlx_keymap' has different size in shared object, consider re-linking
GNU gdb 2002-04-01-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-linux"...
(gdb) break datanicks.pas:47
Breakpoint 1 at $8058f2d: file datanicks.pas, line 47.
(gdb) run
Starting program: /home/pircsrv/src/test/datanicks/datatest
sizeOf(TNick) = 4
Memory available before getMem: 261856
Memory available after getMem: 261840
Command: a
Nick to add: prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)
Breakpoint 1, ADDNICK (valDATA='prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)')
at datanicks.pas:47
47 MM := memAvail;
(gdb) c
Continuing.
Memory available before addNick: 261792
string = prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)
num tokens = 9
ll is well in FPC
Memory available after addNick: 259680
Command: a
Nick to add: prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)
Breakpoint 1, ADDNICK (valDATA='prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)')
at datanicks.pas:47
47 MM := memAvail;
(gdb) c
Continuing.
Memory available before addNick: 259712
string = prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)
num tokens = 9
All is well in FPC
Memory available after addNick: 257600
Command: a
Nick to add: prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)
Breakpoint 1, ADDNICK (valDATA='prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)')
at datanicks.pas:47
47 MM := memAvail;
(gdb) c
Continuing.
Memory available before addNick: 257632
string = prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)
num tokens = 9
All is well in FPC
Memory available after addNick: 255520
Command: a
Nick to add: prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)
Breakpoint 1, ADDNICK (valDATA='prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)')
at datanicks.pas:47
47 MM := memAvail;
(gdb) c
Continuing.
Memory available before addNick: 255552
string = prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)
num tokens = 9
Program received signal SIGSEGV, Segmentation fault.
$08062697 in _SYSLINUX ()
(gdb) bt
#0 $08062697 in _SYSLINUX ()
#1 $080628ab in _SYSLINUX ()
#2 $08061f23 in _SYSLINUX ()
#3 $080591c6 in ADDNICK (valDATA='prologic 1 1044896365 prologic daisy test.prologitech.com 0 :ProLogiTech (www.prologitech.com)')
at datanicks.pas:66
#4 $08065b17 in main () at datatest.pas:21
(gdb)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: datanicks.tar.gz
Type: application/octet-stream
Size: 4527 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20030211/bf9c4885/attachment.obj>
More information about the fpc-pascal
mailing list