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

torrent.(*Count).Int64 crash on arm(linux) #383

Closed
xspeed1989 opened this issue Mar 15, 2020 · 9 comments
Closed

torrent.(*Count).Int64 crash on arm(linux) #383

xspeed1989 opened this issue Mar 15, 2020 · 9 comments

Comments

@xspeed1989
Copy link

[Switching to Thread 6677.6679]
0x00011fdc in runtime/internal/atomic.goLoad64 (addr=0x16fc1a4, ~r1=<optimized out>) at E:/Software/Go/src/runtime/internal/atomic/atomic_arm.go:131
131                     *(*int)(nil) = 0 // crash on unaligned uint64
(gdb) bt
#0  0x00011fdc in runtime/internal/atomic.goLoad64 (addr=0x16fc1a4, ~r1=<optimized out>) at E:/Software/Go/src/runtime/internal/atomic/atomic_arm.go:131
#1  0x0073f4a0 in github.com/anacrolix/torrent.(*Count).Int64 (me=0x16fc1a4, ~r0=0) at C:/Users/xspee/go/pkg/mod/github.com/anacrolix/torrent@v1.14.0/conn_stats.go:61
#2  0x007786bc in github.com/jpillora/cloud-torrent/engine.(*Torrent).updateLoaded (torrent=0x16fc120, t=0x1526400) at C:/Users/xspee/Desktop/simple-torrent/engine/torrent.go:90
#3  0x007780c8 in github.com/jpillora/cloud-torrent/engine.(*Torrent).Update (torrent=0x16fc120, t=0x1526400) at C:/Users/xspee/Desktop/simple-torrent/engine/torrent.go:54
#4  0x0077529c in github.com/jpillora/cloud-torrent/engine.(*Engine).upsertTorrent (e=0x14b2a50, tt=0x1526400, ~r1=0x0) at C:/Users/xspee/Desktop/simple-torrent/engine/engine.go:296
#5  0x00774308 in github.com/jpillora/cloud-torrent/engine.(*Engine).TaskRoutine (e=0x14b2a50) at C:/Users/xspee/Desktop/simple-torrent/engine/engine.go:221
#6  0x00836104 in github.com/jpillora/cloud-torrent/server.(*Server).backgroundRoutines.func1 (s=0x148f8c0) at C:/Users/xspee/Desktop/simple-torrent/server/server_bg.go:36
#7  0x0007452c in runtime.goexit () at E:/Software/Go/src/runtime/asm_arm.s:868
(gdb) frame 1
#1  0x0073f4a0 in github.com/anacrolix/torrent.(*Count).Int64 (me=0x16fc1a4, ~r0=0) at C:/Users/xspee/go/pkg/mod/github.com/anacrolix/torrent@v1.14.0/conn_stats.go:61
61              return atomic.LoadInt64(&me.n)
@anacrolix
Copy link
Owner

It's not clear where the usage of Count is occuring in @jpillora /cloud-torrent here. Can you link to the source for it for the backtrace above?

@xspeed1989
Copy link
Author

xspeed1989 commented Mar 16, 2020

@anacrolix
there is source
this project if forked from jpillora/cloud-torrent

@anacrolix
Copy link
Owner

anacrolix commented Mar 16, 2020

@xspeed1989 the issue is most likely that your Torrent.Stats is not aligned. Try moving that field to the top of its parent struct. If that works, I'll add a comment to TorrentStats mentioning that it must be aligned on some platforms.

@xspeed1989
Copy link
Author

xspeed1989 commented Mar 16, 2020

@anacrolix OK, I will try it

@xspeed1989
Copy link
Author

@anacrolix It's works fine!

@xspeed1989
Copy link
Author

it's not your fault,2333333

@anacrolix
Copy link
Owner

See also #262.

anacrolix added a commit that referenced this issue Mar 16, 2020
@jpillora
Copy link
Contributor

Apologies the cloud-torrent import of anacrolix/torrent is out of date. This might be the reason...

@anacrolix
Copy link
Owner

@jpillora sorry to drag this up, I think the issue was in a fork of your original repo.

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

3 participants