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

skipmap在32位系统下运行crash #204

Open
zhiyongzhang663 opened this issue Feb 6, 2024 · 2 comments
Open

skipmap在32位系统下运行crash #204

zhiyongzhang663 opened this issue Feb 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@zhiyongzhang663
Copy link

Operating System

Arm71 Linux

Go Version

go1.17

Package Version

20230728082804

Affected Packages

collection/skipmap

Expected Behavior

在32位系统上运行正常。

Actual Behavior

在32位系统上运行时候,会报错:panic: unaligned 64-bit atomic operation。原因是使用了atomic.Load64(),在32位下操作64位数据不是原子的。

Reproduction Steps

  1. 使用skipmap的LoadOrStoreLazy。
  2. 编译32位Arm下运行的程序。
  3. 在Arm71上运行编译好的程序。

Other Information

我认为这是个普遍存在于32位系统的问题,不一定非要arm71系统。应该是32位系统就能复现。

@zhiyongzhang663 zhiyongzhang663 added the bug Something isn't working label Feb 6, 2024
@zhangyunhao116 zhangyunhao116 self-assigned this Feb 6, 2024
@zhangyunhao116
Copy link
Member

请问是哪个类型的 skipmap 报错了呢,可以提供一下完整的 stack 么

@zhiyongzhang663
Copy link
Author

zhiyongzhang663 commented Feb 6, 2024

@zhangyunhao116 你会帮忙解决这个问题么?原理是很简单的,就是atomic的对int64的原子操作,在32位系统下无法保持原子行而panic。
下面是我们遇到的crash,实际上,任何关于int64的原子操作,在32位系统下都会报错。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants