-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime error: unsafe pointer arithmetic (Go 1.14 checkptr) #254
Comments
The bad conversion in question is here: Line 71 in 1cd887c
The problem is that But more generally, I don't understand why this code is using reflect.SliceHeader in the first place. The above line can be rewritten simply as:
|
@mdempsky Am I right in assuming that switching checkptr to |
@zikaeroh Yeah, if checkptr used throw(), then the process would immediately terminate at the bad conversion instead. |
I was going to submit a PR with the simple change given above, but it appears as though this repo doesn't pass its tests race mode anyway. Test output: https://gist.github.com/zikaeroh/f94c7ee185720e39b632c00f8994527f I can still submit the one-line change (as it at least will likely fix my own test failures as a user of probably a limited set of features), but tests here should also be run in race mode. |
The library had an unsafe pointer usage that breaks go1.14: yuin/gopher-lua#254 For istio#21567 I have verified this locally
* Update gopher-lua library The library had an unsafe pointer usage that breaks go1.14: yuin/gopher-lua#254 For #21567 I have verified this locally * Add licenses * fix license * fix license
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header, path_param and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header, path_param and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header, path_param and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header, path_param and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header, path_param and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header, path_param and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header, path_param and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Headers and url query return nil on missing key * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
* Updates gopher-lua dependency to fix [checkptr: unsafe pointer arithmetic](yuin/gopher-lua#254) * Adds context path_param projection as table * Adds request url_query projection as table * Adds request url_raw_query getter and setter * Adds request url_path getter and setter * Adds response status_code getter and setter * Implements header and url_query iteration * Passes indexed script params along with key-values * Uses proper log module * Makes 'print' builtin write into log * Uses lua's RaiseError for error handling * Returns less results instead of pushing lua.LNil * Updates documentation and tests See script_test.go for usage examples. Signed-off-by: Alexander Yastrebov <[email protected]>
Go 1.14 introduces new runtime pointer checking, enabled by default in race mode (golang/go#34964) which verify that the rules for using
unsafe
are followed.Running the tests on this library with either
-race
or-gcflags=all=-d=checkptr=2
shows that this library has unsafe pointer operations. For example:You'll want to investigate these bad operations, not only because 1.14 will make tests and users break in race mode, but because these operations represent real potential bugs.
Forgive me for dropping the template, but I didn't think it fit.
The text was updated successfully, but these errors were encountered: