Skip to content
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

crash when open AddressSanitizer #32

Closed
manajay opened this issue May 15, 2019 · 8 comments
Closed

crash when open AddressSanitizer #32

manajay opened this issue May 15, 2019 · 8 comments

Comments

@manajay
Copy link

manajay commented May 15, 2019

image

Signed integer overflow: 2112820162 * 31 cannot be represented in type 'int'

@yaoyue
Copy link
Collaborator

yaoyue commented May 19, 2019

感谢您的反馈,我们尽快优化

@yaoyue
Copy link
Collaborator

yaoyue commented Jun 15, 2019

您这边有具体的 crash 信息么?这边为了保证后端_ 和 SDK 的 hash 校验一致,需要用 Int。

@manajay
Copy link
Author

manajay commented Jun 22, 2019

image
image
开启 AddressSanitizer 会崩溃
SDK 版本 : 1.11.1

@wangzhzh
Copy link
Contributor

@yaoyue

@yaoyue
Copy link
Collaborator

yaoyue commented Aug 2, 2019

@manajay 您这边有方式可以复现么?我们尝试开启 AddressSanitizer 没有类似问题。您这边 Xcode 和 设备 版本分别是多少呢?

@cntrump
Copy link

cntrump commented Aug 13, 2019

看这个算法,emoji或者汉字(长文章),很容易溢出

@wangzhzh
Copy link
Contributor

hashCode 本身就可以是负数,为了保证与后端的 hashCode(Java)算法一致。

@cntrump
Copy link

cntrump commented Aug 14, 2019

hashCode 本身就可以是负数,为了保证与后端的 hashCode(Java)算法一致。

我是指,从hash算法逻辑上看,hash会一直累加,如果计算的 NSString 内容很长,就有溢出的可能。
图里的提示也显示是整形溢出。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants