# Compiling contracts with solc 0.6.2 (commit.bacdbe57) fails with spawnSync /bin/sh ENOBUFS

**URL:** <https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289>\
**Category:** SDK\
**Created:** [February 17, 2020, 4:15am UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289 "2020-02-17T04:15:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [February 17, 2020, 4:15am UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/1 "2020-02-17T04:15:36Z")

</div>

@pcowgill [reported on Telegram](https://t.me/zeppelinos/10300)

> any idea how to get around this after running oz compile?  
> ✖ Compiling contracts with solc 0.6.2 (commit.bacdbe57)  
> spawnSync /bin/sh ENOBUFS

Using solc 0.6.2  
OpenZeppelin CLI v 2.7.1

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [February 17, 2020, 4:16am UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/2 "2020-02-17T04:16:15Z")

</div>

Hi @pcowgill,

It would be great to reproduce this problem. When you have recovered from the hackathon, any information you could provide would be great.

* * *

ENOBUFS looks like it may be an issue with the compiler:  
[https://github.com/ethereum/solidity/issues/8133](https://github.com/ethereum/solidity/issues/8133)

> ENOBUFS does not sound like a problem with the memory used by the compiler, but rather with the buffers used to send input and output back and forth. Maybe you selected too much output from the compiler and nodejs cannot handle it?

Last time I saw this ([Oz compile fails with spawnSync /bin/sh ENOBUFS](https://forum.openzeppelin.com/t/oz-compile-fails-with-spawnsync-bin-sh-enobufs/1779)) we got around it by changing the compiler version, though you are using solc 0.6.2 which is the latest.

---

<div class="post-metadata">

**Author:** ![pcowgill](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/pcowgill/32/125_2.png) [@pcowgill](https://forum.openzeppelin.com/u/pcowgill)\
**Post date:** [February 19, 2020, 4:54pm UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/3 "2020-02-19T16:54:21Z")

</div>

Thanks for flagging this as an issue.

Sure, I can share a reproduction. We ended up building our contracts using a different tool for speed reasons at the hackathon once we encountered this bug, I’m afraid.

Can you also share an “unreproduction”? That is, an example where it is working? Thanks!

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [February 20, 2020, 1:05am UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/4 "2020-02-20T01:05:30Z")

</div>

Hi @pcowgill,

It would be great to be able to reproduce. I had assumed that this was a compiler issue, so interesting that another build tool didn’t have this issue.

I can compile the following simple example importing from OpenZeppelin Contracts 3.0 Beta with solc 0.6.3 on node 13.8.0. (on Windows Subsystem for Linux)

```auto
$ npx oz compile
✓ Compiled contracts with solc 0.6.3 (commit.8dda9521)

```

> **[abcoathup/SimpleERC721Token](https://github.com/abcoathup/SimpleERC721Token)**
>
> Contribute to abcoathup/SimpleERC721Token development by creating an account on GitHub.

## SimpleERC721Token.sol

```auto
pragma solidity ^0.6.0;

import "@openzeppelin/contracts/token/ERC721/ERC721Full.sol";
import "@openzeppelin/contracts/ownership/Ownable.sol";
import "@openzeppelin/contracts/drafts/Strings.sol";

contract SimpleERC721Token is ERC721Full, Ownable {

    constructor () public ERC721Full("Simple ERC721 Token", "SIM") {
        _setBaseURI("https://example.com/tokens/");
    }

    function setBaseURI(string memory baseURI) public onlyOwner {
        _setBaseURI(baseURI);
    }

    function mint(address to) public onlyOwner {
        uint256 tokenId = totalSupply().add(1);
        _mint(to, tokenId);
        _setTokenURI(tokenId, Strings.fromUint256(tokenId));
    }
}

```

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [March 2, 2020, 4:15am UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/5 "2020-03-02T04:15:14Z")

</div>

Hi @pcowgill,

Would appreciate any information to help reproduce this issue.

Ideally the contract which resulted in this issue, along with the operating system, node, npm and CLI versions.

---

<div class="post-metadata">

**Author:** ![pcowgill](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/pcowgill/32/125_2.png) [@pcowgill](https://forum.openzeppelin.com/u/pcowgill)\
**Post date:** [March 3, 2020, 10:29pm UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/6 "2020-03-03T22:29:53Z")

</div>

These are the contracts that didn’t work with the oz CLI

> **[clr-fund/contracts](https://github.com/clr-fund/contracts)**
>
> Smart contracts (other than the MACI contracts) and tests for cl(ea)r.fund - clr-fund/contracts

---

<div class="post-metadata">

**Author:** ![pcowgill](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/pcowgill/32/125_2.png) [@pcowgill](https://forum.openzeppelin.com/u/pcowgill)\
**Post date:** [March 3, 2020, 10:32pm UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/7 "2020-03-03T22:32:49Z")

</div>

macOS 10.15.3  
Node version - not sure, it was either 10 or 12  
npm version - default when using latest 10 or 12 version with nvm  
CLI version - hmm, wish I knew. Latest as of the day of ETHDenver?

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [March 3, 2020, 10:34pm UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/8 "2020-03-03T22:34:38Z")

</div>

Thanks @pcowgill that is really helpful. I can see if I can reproduce.

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [March 4, 2020, 4:17am UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/9 "2020-03-04T04:17:51Z")

</div>

I tried on Windows Subsystem for Linux using node 10 and node 12 and haven’t been able to reproduce as yet.

---

<div class="post-metadata">

**Author:** ![pcowgill](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/pcowgill/32/125_2.png) [@pcowgill](https://forum.openzeppelin.com/u/pcowgill)\
**Post date:** [March 4, 2020, 5:41pm UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/10 "2020-03-04T17:41:49Z")

</div>

Is there anyone on the OpenZeppelin team with a Mac who can try it sometime when they have a moment? No rush, especially since it took me a while to share the reproduction details. Thanks!

---

<div class="post-metadata">

**Author:** ![pcowgill](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/pcowgill/32/125_2.png) [@pcowgill](https://forum.openzeppelin.com/u/pcowgill)\
**Post date:** [March 4, 2020, 5:46pm UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/11 "2020-03-04T17:46:21Z")

</div>

> [@abcoathup](#):
>
> Using solc 0.6.2  
> OpenZeppelin CLI v 2.7.1

Oh, and I see that this was the oz CLI version ^

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [March 5, 2020, 1:50am UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/12 "2020-03-05T01:50:15Z")

</div>

Hi @pcowgill,

I have created an Issue: [https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1498](https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1498) to track.

Closed solc Issue [ethereum/solidity#8133](https://github.com/ethereum/solidity/issues/8133) has the following comment:

> [ethereum/solidity#8133 (comment)](https://github.com/ethereum/solidity/issues/8133#issuecomment-574240282)  
> ENOBUFS does not sound like a problem with the memory used by the compiler, but rather with the buffers used to send input and output back and forth.

I tried to reproduce with a high memory load but haven't got the error. Will have to try with a Mac.

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [March 9, 2020, 3:41pm UTC](https://forum.openzeppelin.com/t/compiling-contracts-with-solc-0-6-2-commit-bacdbe57-fails-with-spawnsync-bin-sh-enobufs/2289/13 "2020-03-09T15:41:35Z")

</div>

Was not able to reproduce on Linux.
