Skip to content

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

Closed

Description

@xspeed1989
[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)

Activity

  1. anacrolix commented on Mar 16, 2020

    @anacrolix
    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?

  2. xspeed1989 commented on Mar 16, 2020

    @xspeed1989
    Author

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

  3. anacrolix commented on Mar 16, 2020

    @anacrolix
    Owner

    @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.

  4. xspeed1989 commented on Mar 16, 2020

    @xspeed1989
    Author

    @anacrolix OK, I will try it

  5. xspeed1989 commented on Mar 16, 2020

    @xspeed1989
    Author

    @anacrolix It's works fine!

  6. xspeed1989 commented on Mar 16, 2020

    @xspeed1989
    Author

    it's not your fault,2333333

  7. anacrolix commented on Mar 16, 2020

    @anacrolix
    Owner

    See also #262.

  8. added a commit that references this issue on Mar 16, 2020
  9. jpillora commented on Mar 16, 2020

    @jpillora
    Contributor

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

  10. anacrolix commented on Mar 16, 2020

    @anacrolix
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址