ethereum / solidity

Solidity, the Smart Contract Programming Language
https://soliditylang.org
GNU General Public License v3.0
23.11k stars 5.73k forks source link

Segmentation Fault due to a possible syntax error #15223

Closed haoyang9804 closed 3 months ago

haoyang9804 commented 3 months ago

Description

A segmentation fault caused by a possible syntax error.

Environment

Steps to Reproduce

pragma experimental solidity;

class Self: Class1 {}
class Self: Class2 {}

forall (A: (Class1,,Class2), B: Class1)
function f(a: A: Class1, b: B: Class1) {}

forall A: Class1
function g(a: A) {}

Using solc CLI to compile the above code results in a segmentation fault. forall (A: (Class1,,Class2), B: Class1) contains 2 commas between Class1 and Class2, which is a syntax error (maybe).

r0qs commented 3 months ago

Hi @haoyang9804 thanks for opening the issue, but as you can read here: https://github.com/ethereum/solidity/issues/15177#issuecomment-2158185230 there is not guarantee of stability in the experimental pragma, and at the current stage of development we will not be fixing all possible segmentation faults that happen there.

claudioantonio commented 2 weeks ago

This issue was used to create a Solidity compiler bug bounty that looks for new segfault errors on v0.8.27.

r0qs commented 2 weeks ago

This issue was used to create a Solidity compiler bug bounty that looks for new segfault errors on v0.8.27.

Hi @claudioantonio, maybe you mentioned this issue by mistake. Note that this segfault occurs under the experimental pragma and thus it is not relevant to find bugs under such experimental features, since they are not considered stable and not widely tested anyway.

claudioantonio commented 2 weeks ago

This issue was used to create a Solidity compiler bug bounty that looks for new segfault errors on v0.8.27.

Hi @claudioantonio, maybe you mentioned this issue by mistake. Note that this segfault occurs under the experimental pragma and thus it is not relevant to find bugs under such experimental features, since they are not considered stable and not widely tested anyway.

Yes, @r0qs ! What I meant to say was that we got inspired by this issue and implemented a validation for only accepting proposals of segfault errors if they do not use the experimental pragma. 😉 Thanks for the heads up!