Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heap-buffer-overflow error is reported on the tf.avgPool function when using the WebAssembly (WASM) backend #8409

Open
liliquan0118 opened this issue Oct 4, 2024 · 0 comments
Assignees

Comments

@liliquan0118
Copy link

Please make sure that this is a bug. As per our
GitHub Policy,
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow.js installed from (npm or script link):compile from source
  • TensorFlow.js version (use command below):tfjs-4.2.0
  • Browser version: Chrome Version 129.0.6668.89 (Official Build) (64-bit)
  • Tensorflow.js Converter Version:

Describe the current behavior
When running the following code under the tfjs-backend-wasm package compiled with the "-fsanitizer=address" option, AddressSanitizer detected an error with the message " AddressSanitizer: heap-buffer-overflow on address 0x143020e0 at pc 0x000b553c bp 0x12963670 sp 0x1296367c."

        var input=tf.ones([20,13,12]);
        var filterSize = [4,1]
        var strides = 1
        var pad = 0
        var dimRoundingMode = "round"
        var prediction =  tf.avgPool(input,filterSize,strides,pad,dimRoundingMode);

The error messages as follows:
image

Describe the expected behavior
The program gives a normal numerical result and does not encounter memory errors.
Standalone code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/CodePen/any notebook.

To reproduce this issue, you need to compile the tfjs-backend-wasm source code with the option "-fsanitizer=address," and then run the above code under the compiled package. I have included the compiled package in the attachment, and you can reproduce the issue by running "bug.html" in reproducecode.zip directly.
reproduce-bug8408.zip

Other info / logs Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants