Closed Bug 778727 Opened 12 years ago Closed 6 years ago

ByteArray uncompress failure causes Memory leaks

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86_64
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dschaffe, Unassigned)

References

Details

Attachments

(2 files)

A memory leak was injected into the shell from Workers changes.   The testcase compresses a simple string, modifies a byte so the uncompress should fail, then does the uncompress.  The correct exception is thrown but the debug shell reports Memory leaks.

I believe the memory leak will also reproduce with the deflate/zlib compression if the correct byte is modified to cause zlib to fail.

steps to reproduce:
1) build the debug shell
2) compile the testcase into .abc  (abc testfile is attached)
bug.as:
import flash.utils.ByteArray
var b1:ByteArray = new ByteArray();
b1.writeUTF("string");
b1.compress("lzma");
var b2:ByteArray = new ByteArray();
var i:uint=120;
b2.clear();
b1.position = 0;
b1.readBytes(b2);
var byteOffset:uint = i / 8;
var bitOffset:uint  = i % 8;
var oldByte:uint = b2[byteOffset];
var oldBit:uint  = (oldByte >> bitOffset) & 0x1;
var newByte:uint = (oldByte ^ (oldBit << bitOffset)) & 0xFF;
b2[byteOffset] = newByte;
var result;
try {
    b2.uncompress("lzma");
} catch (e) {
    print("i="+i+" error="+e.toString());
}

3) run:
$ avmshell_d bug.abc
i=120 error=Error: Error #2058
Leaks!Trace/BPT trap: 5

actual is :
i=120 error=Error: Error #2058
Leaks!Trace/BPT trap: 5

expected should be no leak:
i=120 error=Error: Error #2058
Attached file testcase source
Attached file testcase binary abc
Blocks: 695061
changeset: 7516:b4e4ed919a2d
user:      Dan Schaffer <Dan.Schaffer@adobe.com>
summary:   bug 778727: disable failing testcases due to bug when ByteArray uncompresses invalid error (r=dschaffe)

http://hg.mozilla.org/tamarin-redux/rev/b4e4ed919a2d
Tamarin is a dead project now. Mass WONTFIX.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: