Giveth / giveth-dapp

Giveth Dapp for crowdfunding and managing donations on the ethereum blockchain.
https://beta.giveth.io
GNU General Public License v3.0
359 stars 230 forks source link

Nodejs: possible memory leak detected #297

Closed mex20 closed 4 years ago

mex20 commented 6 years ago

When using the DApp, the following warning is logged:

events.js:138 (node) warning: possible EventEmitter memory leak detected. 31 listeners added. Use emitter.setMaxListeners() to increase limit.
a.addListener @ events.js:138

When compiling the DApp, the following warning is logged:

(node:8744) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit
status-open-bounty commented 6 years ago

Current balance: 1.926290 ETH Contract address: 0x47ec2d2408eb9c52de1736ba67d783846c7ad307 QR Code Network: Mainnet To claim this bounty sign up at https://openbounty.status.im and make sure to update your Ethereum address in My Payment Details so that the bounty is correctly allocated. To fund it, send ETH or ERC20/ERC223 tokens to the contract address.

debragail commented 6 years ago

@mex20 what's the bounty price for this?

vojtechsimetka commented 6 years ago

@debragail we are assigning it now. Should be in before next thursday.

stefek99 commented 6 years ago

I was running truffle

CTRL + c to kill it

Got the error that you describe.

Might be truffle related, not Giveth Dapp related?

eth_getBalance
eth_getBalance
eth_getBalance
eth_getBalance
eth_getBalance
eth_getBalance
eth_getBalance
eth_getBalance
eth_getBalance
eth_getBlockByNumber
net_version
^C^C^C^C^C^C^L^C^C^C^C^C(node:9035) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit
^C^C^C^C^C^C^C^C^C^C^Cnet_version
eth_getBalance
vojtechsimetka commented 6 years ago

Thanks @stefek99. We also think this is in one of the libraries we depend on (definitely not truffle). Nontheless, it should be fixed :).

ewingrj commented 6 years ago

I'm 99.99% sure this is in the web3.js lib.

georgiemathews commented 6 years ago

any instructions for reproducing the leak?

debragail commented 6 years ago

is this happening in all versions or is this with the latest build? Tempted to climb through the branches to find the last stable build.

ewingrj commented 6 years ago

see #356 for more context

debragail commented 6 years ago

Was this closed by ovx?

vojtechsimetka commented 6 years ago

@debragail no

bookmoons commented 5 years ago

I've been trying to reproduce this without success. Is it possible web3 has updated?

The described mechanism leads me to believe this test script should cause the warning. It runs 100 contract creations. But it gives me no warning.

const Web3 = require('web3')
const { MiniMeToken } = require('minimetoken')

const nodeAddress = 'http://localhost:8545'
const provider = new Web3.providers.HttpProvider(nodeAddress)
const web3 = new Web3(provider)

const address = '0xA7f08778123787f2b9EdFe83843d4C02E9d8B97f'
const contracts = []
for (let i = 0; i < 100; i++) {
  const contract = new MiniMeToken(web3, address)
  contracts.push(contract)
}
bookmoons commented 5 years ago

I'm also not seeing a warning in log output, but there a lot of messages and I'm not really sure where it's supposed to show up.

vojtechsimetka commented 5 years ago

Thank you @bookmoons , it does seem that the error is no longer present. Let me thoroughly verify again and I'll come back.

mroberts10 commented 5 years ago

Hey Vojtech, has this issue been sorted? Was there some sort of web3 update?

mroberts10 commented 5 years ago

Kay can you remove the funds

geleeroyale commented 5 years ago

Someone has to claim them - do it @mroberts10 =)

Please follow this procedure:

1 - register on openbounty.status.im to link your github account to a metamask account 2 - sumbit an empty PR with the following comment: fixes #[your issue number] (without the square brackets) 3 - Ping @geleeroyale, to accept the PR

debragail commented 5 years ago

I believe this is a known issue with node that I ran into with @status-open-bounty last year.

arbreton commented 4 years ago

@geleeroyale Can this be closed?

geleeroyale commented 4 years ago

We should keep it open as a reminder (or make a category with stale status bounties) ... the bounty never was claimed, so there are still 1.9ETH sitting in the bounty contract

debragail commented 4 years ago

what's the status?

aminlatifi commented 4 years ago

@geleeroyale I couldn't find this issue in giveth gitcoin active issues! Is it over? Can we close this issue?

geleeroyale commented 4 years ago

This issue is ancient. There are almost 2 Eth, sitting in a smart contract at Status. You can close it if you want @aminlatifi - I don't think these bounties will ever be paid out. We asked for that, but seems like the Status team straight up abandoned it without ever releasing the funds that were on there :-(

corpetty commented 4 years ago

Who is the repo owner for this bounty? I have the admin account that can release the funds (it took some digging) but it is a multisignature wallet. The other signer is the owner of this repo.

corpetty commented 4 years ago

The address in question that I'm looking to track down is this one: https://etherscan.io/address/0x701d0ECB3BA780De7b2b36789aEC4493A426010a.

You can find me at security@status.im, security on status, or petty#7979 on discord. I am currently in contact with @aminlatifi on Discord so you can go through him if need be.

I will also monitor this thread.

corpetty commented 4 years ago

Funds have been drained and @geleeroyale has control of them. This can be closed, and we sincerely apologize for the wait and inconvenience of this.

aminlatifi commented 4 years ago

Thanks @corpetty