View Issue Details

IDProjectCategoryView StatusLast Update
0000370LDMud 3.3Efunspublic2005-05-15 13:02
ReporterGnomi Assigned Tolars 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi686OSDebian GNU/LinuxOS Version3.0
Product Version3.3 
Fixed in Version3.3 
Summary0000370: unique_array with an unbound lambda leaks it structures
DescriptionHi,

unique_array(({this_object()}), unbound_lambda(0,0)) not just doesn't raise an error (what it should), it also leaks some memory:


2005.02.21 16:50:58 --- Garbage Collection ---
2005.02.21 16:50:58 GC pass 1: Freed 1 objects.
Freeing destructed object 'w/gnomi/LPC_zst'
freeing large block 0x089b9450 mempools.c 491 size 0x00000029
  By object: (destructed) (not in list)
  By program: Not found at old address.
089b9470: 00 00 00 00 f4 94 9b 08 84 00 00 00 7c b6 a4 08 ....ô.......|¶¤.
089b9480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
089b9490: ec b1 06 00 74 b4 a4 08 00 00 00 00 00 00 00 00 ì±..t´¤.........
089b94a0: 00 00 00 00 00 00 00 00 fe b4 06 00 a4 91 9b 08 ........þ´..¤...
089b94b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

1 large blocks freed
freeing small block 0x093b0cc8 (user 0x093b0cd0) array.c 3040
  By object: (destructed) (not in list)
  By program: Not found at old address.
093b0ce4: 15 00 00 00 86 34 05 08 2c 2d dc 08 08 95 a7 08 .....4..,-Ü...§.
093b0cf4: 48 00 00 38 1a 04 62 4e d0 dd ff bf 00 00 00 H..8..bNÐÝÿ¿...

freeing small block 0x08a794ec (user 0x08a794f4) interpret.c::allocate_uninit_array 14449
  By object: (destructed) (not in list)
  By program: Not found at old address.
08a79508: 01 00 00 00 01 00 00 00 2f 52 6f 6f a8 a8 05 09 ......../Roo¨¨..
08a79518: 05 00 00 00 48 20 fb 08 b2 04 00 38 ab d8 58 ab ....H û.²..8«ØX«
08a79528: d0 dd ff bf 00 00 00 ÐÝÿ¿...

freeing small block 0x08dc2d10 (user 0x08dc2d18) mempools.c 486
  By object: (destructed) (not in list)
  By program: Not found at old address.
08dc2d2c: 00 00 00 00 78 00 00 00 70 94 9b 08 00 00 00 00 ....x...p.......
08dc2d3c: 00 00 00 00 00 00 00 00 00 00 00 00 1e 01 00 68 ...............h
08dc2d4c: 46 1f 04 32 18 40 dc 08 00 00 00 F..2.@Ü....

3 small blocks freed
2005.02.21 16:50:58 GC freed 1 destructed objects.

Greetings,
Gnomi.
TagsNo tags attached.

Activities

Gnomi

2005-02-21 10:12

manager   ~0000348

regreplace("a","a",unbound_lambda(0,0),0) raises an error (correctly), but also leaks memory:

2005.02.21 17:09:53 --- Garbage Collection ---
2005.02.21 17:09:53 GC pass 1: Freed 1 objects.
freeing small block 0x0824b0b4 (user 0x0824b0bc) mregex.c 631
  By object: (not in list)
  By program: Not found at old address.
0824b0d0: 00 00 00 04 3c 42 14 09 a2 06 00 68 2d 7d 8f de ....<B..¢..h-}.Þ
0824b0e0: 24 b0 24 08 04 00 00 $°$....

1 small blocks freed
2005.02.21 17:09:53 GC freed 0 destructed objects.

lars

2005-02-26 02:03

reporter   ~0000351

Corrected in 3.3.682.

The unique_array() (or more precisely: the callback code) didn't check for uncalleable closures, and therefore forgot to remove arguments from the stack, which caused the cleanup code for unique_array()'s internal structures to not be executed.

Similar, regreplace() didn't have proper cleanup code in place, as originally it didn't allow closures and thus couldn't have runtime errors in the middle of the operation.

Issue History

Date Modified Username Field Change
2005-02-21 10:01 Gnomi New Issue
2005-02-21 10:12 Gnomi Note Added: 0000348
2005-02-26 02:03 lars Status new => resolved
2005-02-26 02:03 lars Fixed in Version => 3.3
2005-02-26 02:03 lars Resolution open => fixed
2005-02-26 02:03 lars Assigned To => lars
2005-02-26 02:03 lars Note Added: 0000351
2005-05-15 13:02 lars Status resolved => closed