-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Inconsistent strconv.Atoi
behavior for 32bit release, lead to error or data corruption.
#20161
Comments
I'm having the same issue using gitea-1.17-linux-arm-6 on a Raspberry Pi 4 Model B (32-bit ARMv7) |
Also here same problem when executing:
it seems that CHARACTER_MAXIMUM_LENGTH with value 4294967295 creates the problem... Now server is unusable because I can not return to previous version because I did not backup the database.... |
func Atoi(s string) (int, error) { on 32bit systems int is most likely to be int32 rather than int64. The problem is that xorm |
…0372) Backport #20371 Xorm 1.3.2-0.20220714055524 contains a fix for interpreting db column sizes. Prior to this fix xorm would assume that the size of a column was within the range of an `int`. This is correct on 64bit machines where `int` is typical equivalent to `int64` however, on 32bit machines `int` tends to be `int32`. Unfortunately the size of a LONGTEXT field is actually `max_uint32`, thus using `strconv.Atoi` on these fields will fail and thus #20161 occurs on 32 bit arm. Xorm 1.3.2-0.20220714055524 changes this field to use int64 instead. Fix #20161
Xorm 1.3.2-0.20220714055524 contains a fix for interpreting db column sizes. Prior to this fix xorm would assume that the size of a column was within the range of an `int`. This is correct on 64bit machines where `int` is typical equivalent to `int64` however, on 32bit machines `int` tends to be `int32`. Unfortunately the size of a LONGTEXT field is actually `max_uint32`, thus using `strconv.Atoi` on these fields will fail and thus #20161 occurs on 32 bit arm. Xorm 1.3.2-0.20220714055524 changes this field to use int64 instead. Fix #20161
This comment was marked as outdated.
This comment was marked as outdated.
If you have met this bug, please download latest from https://dl.gitea.io/gitea/ |
) Xorm 1.3.2-0.20220714055524 contains a fix for interpreting db column sizes. Prior to this fix xorm would assume that the size of a column was within the range of an `int`. This is correct on 64bit machines where `int` is typical equivalent to `int64` however, on 32bit machines `int` tends to be `int32`. Unfortunately the size of a LONGTEXT field is actually `max_uint32`, thus using `strconv.Atoi` on these fields will fail and thus go-gitea#20161 occurs on 32 bit arm. Xorm 1.3.2-0.20220714055524 changes this field to use int64 instead. Fix go-gitea#20161
strconv.Atoi
has different behavior:For example, in XORM:
A user has reported that Gitea 1.17 failed with error:
The text was updated successfully, but these errors were encountered: