graphprotocol / graphprotocol/graph-node

out of bounds memory access wasm backtrace

Open
#4,563 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/runtime bug Stale
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

Bug report

Deployed a local subgraph using graph-node v0.30.0 and got into this issue :
#4317 same issue but this is on mainnet
Did you look into this @tilacog
subgraph git
https://github.com/Amxx/subgraphs/tree/master/subgraphs/common

Relevant log output
wasm trap: out of bounds memory access	
wasm backtrace:	    
0: 0x1d42 - <unknown>!~lib/util/memory/memcpy	  
1: 0x1e8b - <unknown>!~lib/memory/memory.copy	   
2: 0x36e2 - <unknown>!~lib/string/String#replaceAll	    
3: 0x387e - <unknown>!../node_modules/@openzeppelin/subgraphs/src/fetch/erc1155/replaceURI	    
4: 0x3c3e - <unknown>!../node_modules/@openzeppelin/subgraphs/src/fetch/erc1155/fetchERC1155Token	   
5: 0x3db3 - <unknown>!../node_modules/@openzeppelin/subgraphs/src/datasources/erc1155/registerTransfer	    
6: 0x4843 - <unknown>!../node_modules/@openzeppelin/subgraphs/src/datasources/erc1155/handleTransferBatch
in handler handleTransferBatch at block #16899351 (b1e020fd883a5a65f091fe52c275fcdcde1fabbb1a6b48a33bcd941e2e8ade19)
IPFS hash

No response

Subgraph name or link to explorer

Amxx subgraphs ERC-721 ERC-1155

Some information to help us out
  • Tick this box if this bug is caused by a regression found in the latest release.
  • Tick this box if this bug is specific to the hosted service.
  • I have searched the issue tracker to make sure this issue is not a duplicate.
OS information

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the wasm backtrace for handleTransferBatch at block #16899351, following replaceURI, fetchERC1155Token, and registerTransfer in the referenced OpenZeppelin subgraph code. Reproduce the out-of-bounds memory access using the linked Amxx subgraph if possible; done means the handler no longer triggers this trap and the relevant behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.