intel / yarpgen

Yet Another Random Program Generator
Other
484 stars 53 forks source link

Array with size > 8GB generated, invalid on 32-bit targets #183

Open acoplan-arm opened 1 year ago

acoplan-arm commented 1 year ago

With the seed 10690367908864332818 (on commit 29a67b2def8b2031b8f3ae033ba45675d216a5ab), I see YARPGen producing a very large array (on line 37 in this case):

short arr_16 [24] [24] [24] [24] [24] [24] [24] ;

which is more than 8GB and therefore clearly can't work on 32-bit targets (see e.g. https://godbolt.org/z/Pc9773zxq).

More generally, I think it would be useful to have tuning parameters to limit:

Vsevolod-Livinskij commented 1 year ago

Thanks for reporting the issue!

You can limit the maximal number of the array's dimensions in this line. To change the maximal number of elements in the dimension itself, you can change this limit. You can try to lower the total size of the generated program using this limit. But it is probably a good idea to have a global switch that will limit the total memory consumption