Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Two issues found with -fsanitize=undefined



On Sep 19, 11:35pm, Peter Stephenson wrote:
} Subject: Re: Two issues found with -fsanitize=undefined
}
} On Sat, 19 Sep 2015 22:18:14 +0200
} Markus Trippelsdorf <markus@xxxxxxxxxxxxxxx> wrote:
} > ./D02glob.ztst: starting.
} > exec.c:2240:6: runtime error: index 8 out of bounds for type 'int [8]'
} > exec.c:2048:10: runtime error: index 8 out of bounds for type 'int [8]'
} > exec.c:2122:7: runtime error: index 8 out of bounds for type 'int [8]'
}  
} It may be the compiler isn't actually looking at the memory allocated,
} only the definition of the structure.  Certainly valgrind has never
} complained here and this is something it should pick up.

Yep, this is clearly a case of the compiled-in bounds-checking making
the assumption that the size of the allocated space is the same as
the size of the declared structure.  We're making deliberate use of
C's lack of strict pointer bounds.

We can shut it up with a "#pragma clang ..." but it's going to get
annoying to do that for every possible compiler.



Messages sorted by: Reverse Date, Date, Thread, Author