cmssw icon indicating copy to clipboard operation
cmssw copied to clipboard

[UBSAN] undefined behavior in vdt/exp.h and vdt/sincos.h

Open mrodozov opened this issue 4 years ago • 6 comments

Merging two old issues which are still present about undefined behavior in VDT https://github.com/dpiparo/vdt #11755 and #11754

https://github.com/dpiparo/vdt/blob/master/include/sincos.h#L139 example relvals: 36.0 step3 23434.99 step4 -> this one is unclear to me why it's complaining, maybe it needs initialization and it will stop

vdt/exp.h:144:38: runtime error: left shift of negative value -131 https://github.com/dpiparo/vdt/blob/master/include/exp.h#L144

example relvals: 136.751 11603.0 step2,step3

Reference - latest UBSAN IB https://cmssdt.cern.ch/SDT/html/cmssdt-ib/#/relVal/CMSSW_12_1/2021-08-20-2300?selectedArchs=slc7_amd64_gcc10&selectedFlavors=UBSAN_X&selectedStatus=failed

mrodozov avatar Aug 25 '21 06:08 mrodozov

A new Issue was created by @mrodozov Mircho Rodozov.

@Dr15Jones, @perrotta, @dpiparo, @makortel, @smuzaffar, @qliphy can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

cmsbuild avatar Aug 25 '21 06:08 cmsbuild

@dpiparo @VinInn I see you were tagged on the prev issue

mrodozov avatar Aug 25 '21 06:08 mrodozov

assign externals

mrodozov avatar Aug 25 '21 10:08 mrodozov

New categories assigned: externals

@smuzaffar,@mrodozov,@iarspider you have been requested to review this Pull request/Issue and eventually sign? Thanks

cmsbuild avatar Aug 25 '21 10:08 cmsbuild

we do not see vdt/exp.h:144:38: runtime error: left shift of negative value -131 error any more but the following are still present

     26 vdt/sincos.h:139:6: runtime error: signed integer overflow: -2147483648 - 2 cannot be represented in type 'int'
   8948 vdt/sincos.h:214:6: runtime error: signed integer overflow: -2147483648 - 2 cannot be represented in type 'int'

smuzaffar avatar Oct 16 '24 10:10 smuzaffar

cms-bot internal usage

cmsbuild avatar Oct 16 '24 10:10 cmsbuild

closing this as vdt was patched to avoid this runtime error.

smuzaffar avatar Nov 01 '24 16:11 smuzaffar