Stream: git-wasmtime

Topic: wasmtime / issue #3710 Cranelift: CLIF function names ove...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2022 at 10:46):

FreddieLiardet labeled issue #3710:

.clif Test Case

test.clif:

test interpret

function %abcdefghijklmopq(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmopq(1, 0) == 1

function %abcdefghijklmopqr(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmopqr(1, 0) == 1

Steps to Reproduce

$ ./target/debug/clif-util test cranelift/filetests/filetests/runtests/test.clif
FAIL cranelift/filetests/filetests/runtests/test.clif: interpret

Caused by:
    unexpected trap: UnknownFunctionName("%abcdefghijklmopqr")
1 tests
Error: 1 failure

Expected Results

Both tests run without error.

Actual Results

Function with longer name causes error. (16 vs 17 chars)

Versions and Environment

Cranelift version or commit: 90e7cef56c03cd6644a991123a872d7e3b1c70c4

Operating system: Ubuntu 18.04

Architecture: x86_64

Extra Info

Seems to occur with test interpret/; run: %function only.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2022 at 10:46):

FreddieLiardet labeled issue #3710:

.clif Test Case

test.clif:

test interpret

function %abcdefghijklmopq(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmopq(1, 0) == 1

function %abcdefghijklmopqr(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmopqr(1, 0) == 1

Steps to Reproduce

$ ./target/debug/clif-util test cranelift/filetests/filetests/runtests/test.clif
FAIL cranelift/filetests/filetests/runtests/test.clif: interpret

Caused by:
    unexpected trap: UnknownFunctionName("%abcdefghijklmopqr")
1 tests
Error: 1 failure

Expected Results

Both tests run without error.

Actual Results

Function with longer name causes error. (16 vs 17 chars)

Versions and Environment

Cranelift version or commit: 90e7cef56c03cd6644a991123a872d7e3b1c70c4

Operating system: Ubuntu 18.04

Architecture: x86_64

Extra Info

Seems to occur with test interpret/; run: %function only.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2022 at 10:46):

FreddieLiardet opened issue #3710:

.clif Test Case

test.clif:

test interpret

function %abcdefghijklmopq(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmopq(1, 0) == 1

function %abcdefghijklmopqr(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmopqr(1, 0) == 1

Steps to Reproduce

$ ./target/debug/clif-util test cranelift/filetests/filetests/runtests/test.clif
FAIL cranelift/filetests/filetests/runtests/test.clif: interpret

Caused by:
    unexpected trap: UnknownFunctionName("%abcdefghijklmopqr")
1 tests
Error: 1 failure

Expected Results

Both tests run without error.

Actual Results

Function with longer name causes error. (16 vs 17 chars)

Versions and Environment

Cranelift version or commit: 90e7cef56c03cd6644a991123a872d7e3b1c70c4

Operating system: Ubuntu 18.04

Architecture: x86_64

Extra Info

Seems to occur with test interpret/; run: %function only.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2022 at 10:51):

FreddieLiardet edited issue #3710:

.clif Test Case

test.clif:

test interpret

function %abcdefghijklmnop(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmnop(1, 0) == 1

function %abcdefghijklmnopq(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmnopq(1, 0) == 1

Steps to Reproduce

$ ./target/debug/clif-util test cranelift/filetests/filetests/runtests/test.clif
FAIL cranelift/filetests/filetests/runtests/test.clif: interpret

Caused by:
    unexpected trap: UnknownFunctionName("%abcdefghijklmnopq")
1 tests
Error: 1 failure

Expected Results

Both tests run without error.

Actual Results

Function with longer name causes error. (16 vs 17 chars)

Versions and Environment

Cranelift version or commit: 90e7cef56c03cd6644a991123a872d7e3b1c70c4

Operating system: Ubuntu 18.04

Architecture: x86_64

Extra Info

Seems to occur with test interpret/; run: %function only.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2022 at 12:04):

bjorn3 commented on issue #3710:

There is a hard-coded limit of 16 bytes for test case names. https://github.com/bytecodealliance/wasmtime/blob/90e7cef56c03cd6644a991123a872d7e3b1c70c4/cranelift/codegen/src/ir/extname.rs#L45 Replacing it with a Box<[u8]> (or Box<str> would work I guess. It would increase the alignment of ExternalName from 32bit to 64bit on 64bit systems though.

view this post on Zulip Wasmtime GitHub notifications bot (May 04 2022 at 21:05):

cfallin commented on issue #3710:

I believe this is an intentional limit meant to keep the size of instructions reasonable. We could indirect through a pool of names/labels held in the function, but that would add overhead for the common case. As suggested by the TESTCASE_NAME_LENGTH constant, this case is meant to be used for standalone tests rather than production embeddings, so the length restriction is IMHO not quite as critical.

I'm doing some issue gardening and so I think I am going to go ahead and close this as "working according to design" but I'm open to arguments about how to support this (stuffing a Box inside the instruction just for the test use-case is probably not the right answer) if someone feels strongly.

view this post on Zulip Wasmtime GitHub notifications bot (May 04 2022 at 21:05):

cfallin closed issue #3710:

.clif Test Case

test.clif:

test interpret

function %abcdefghijklmnop(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmnop(1, 0) == 1

function %abcdefghijklmnopq(i64, i64) -> i64 {
block0(v0: i64, v1: i64):
    v2 = iadd v0, v1
    return v2
}
; run: %abcdefghijklmnopq(1, 0) == 1

Steps to Reproduce

$ ./target/debug/clif-util test cranelift/filetests/filetests/runtests/test.clif
FAIL cranelift/filetests/filetests/runtests/test.clif: interpret

Caused by:
    unexpected trap: UnknownFunctionName("%abcdefghijklmnopq")
1 tests
Error: 1 failure

Expected Results

Both tests run without error.

Actual Results

Function with longer name causes error. (16 vs 17 chars)

Versions and Environment

Cranelift version or commit: 90e7cef56c03cd6644a991123a872d7e3b1c70c4

Operating system: Ubuntu 18.04

Architecture: x86_64

Extra Info

Seems to occur with test interpret/; run: %function only.


Last updated: Dec 23 2024 at 12:05 UTC