steamguard-cli icon indicating copy to clipboard operation
steamguard-cli copied to clipboard

Setup hangs after "Authenticator finalized."

Open neckcen opened this issue 4 years ago • 4 comments

As the title says, setup hangs after displaying Authenticator finalized. and had to be interrupted. It worked though.

(redacted) output:

$ steamguard setup
INFO - reading manifest from .config/steamguard-cli/maFiles
Log in to the account that you want to link to steamguard-cli
Username: foo
Password: 
You should have received an email with a code.
Enter code: XXXXX
Authenticator has not yet been linked. Before continuing with finalization, please take the time to write down your revocation code: XXXXX
Press any key to continue...
Enter SMS code: XXXXX
INFO - finalize response status: 2
Authenticator finalized.
^C

neckcen avatar Aug 31 '21 16:08 neckcen

After this line is printed, it tries to save the manifest, so it must have hung while trying to do that.

dyc3 avatar Sep 01 '21 12:09 dyc3

I don't see a reason it would hang up, but I could not reproduce so I'll just close this. If someone else encounters this problem reliably or with more info they can reopen the issue.

neckcen avatar Oct 05 '21 20:10 neckcen

@RunningDroid encountered this issue and said:

strace said it was stuck on a futex.

I'm inclined to believe this is an upstream issue in std when writing to disk. The next steps are to find a minimal reproduction of this.

dyc3 avatar Dec 12 '21 03:12 dyc3

Yep, it hangs. But interrupting the process after a while the maFiles are correctly written and everything is fine.

simonsan avatar Jan 19 '22 19:01 simonsan

I was able to get a more complete strace output when this bug occurrs

getrandom("\x34\xf3\xfb\x89\x53\x15\xca\x79\x51\xef\x70\x6f\x01\x4a\xee\x30", 16, 0) = 16
clone(child_stack=0x7fcaafc12e30, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[509251], tls=0x7fcaafc13700, child_tidptr=0x7fcaafc139d0) = 509251
futex(0x558b99942300, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x558b99935a88, FUTEX_WAIT_BITSET_PRIVATE, 4294967295, NULL, FUTEX_BITSET_MATCH_ANY) = 0
write(2, "\33[0m", 4)                   = 4
write(2, "\33[34m", 5)                  = 5
write(2, "TRACE - making request: POST htt"..., 99) = 99
write(2, "\33[0m", 4)                   = 4
write(8, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x558b99942300, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x558b99935a88, FUTEX_WAIT_BITSET_PRIVATE, 4294967295, {tv_sec=72921, tv_nsec=913387334}, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x558b99942300, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(8, "\1\0\0\0\0\0\0\0", 8)         = 8
write(2, "\33[0m", 4)                   = 4
write(2, "\33[34m", 5)                  = 5
write(2, "TRACE - raw add authenticator re"..., 470) = 470
write(2, "\33[0m", 4)                   = 4
write(2, "\33[0m", 4)                   = 4
write(2, "\33[36m", 5)                  = 5
write(2, "DEBUG - adding account to manife"..., 44) = 44
write(2, "\33[0m", 4)                   = 4
write(2, "\33[0m", 4)                   = 4
write(2, "\33[33m", 5)                  = 5
write(2, "INFO - Saving manifest and accou"..., 39) = 39
write(2, "\33[0m", 4)                   = 4
write(2, "\33[0m", 4)                   = 4
write(2, "\33[36m", 5)                  = 5
write(2, "DEBUG - saving afarihm.maFile\n", 30) = 30
write(2, "\33[0m", 4)                   = 4
openat(AT_FDCWD, "test_maFiles/bug_repro/afarihm.maFile", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 11
write(11, "{\"account_name\":\"afarihm\",\"seria"..., 804) = 804
fdatasync(11)                           = 0
close(11)                               = 0
write(2, "\33[0m", 4)                   = 4
write(2, "\33[36m", 5)                  = 5
write(2, "DEBUG - saving manifest\n", 24) = 24
write(2, "\33[0m", 4)                   = 4
openat(AT_FDCWD, "test_maFiles/bug_repro/manifest.json", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 11
write(11, "{\"entries\":[{\"filename\":\"afarihm"..., 293) = 293
fdatasync(11)                           = 0
close(11)                               = 0
write(1, "Authenticator has not yet been l"..., 140) = 140
write(1, "Press any key to continue...\n", 29) = 29
epoll_wait(3, [{EPOLLIN, {u32=0, u64=0}}], 3, -1) = 1
read(0, "\n", 1204)                     = 1
write(2, "\33[0m", 4)                   = 4
write(2, "\33[36m", 5)                  = 5
write(2, "DEBUG - attempting link finaliza"..., 37) = 37
write(2, "\33[0m", 4)                   = 4
write(1, "Enter SMS code: ", 16)        = 16
epoll_wait(3, [{EPOLLIN, {u32=0, u64=0}}], 3, -1) = 1
read(0, "53985\n", 1204)                = 6
mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fcaaf5ba000
mprotect(0x7fcaaf5bb000, 2097152, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x7fcaaf7b9e30, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[509525], tls=0x7fcaaf7ba700, child_tidptr=0x7fcaaf7ba9d0) = 509525
futex(0x558b99942300, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x558b99935a88, FUTEX_WAIT_BITSET_PRIVATE, 4294967295, NULL, FUTEX_BITSET_MATCH_ANY) = 0
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x558b99942300, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x558b99935a88, FUTEX_WAIT_BITSET_PRIVATE, 4294967295, {tv_sec=72944, tv_nsec=504488709}, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x558b99942300, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
write(12, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7fcaaf7ba9d0, FUTEX_WAIT, 509525, NULL) = 0
write(2, "\33[0m", 4)                   = 4
write(2, "\33[34m", 5)                  = 5
write(2, "TRACE - making request: POST htt"..., 107) = 107
write(2, "\33[0m", 4)                   = 4
write(8, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x558b99942300, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x558b99935a88, FUTEX_WAIT_BITSET_PRIVATE, 4294967295, {tv_sec=72944, tv_nsec=714268935}, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x558b99942300, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(8, "\1\0\0\0\0\0\0\0", 8)         = 8
write(2, "\33[0m", 4)                   = 4
write(2, "\33[34m", 5)                  = 5
write(2, "TRACE - raw finalize authenticat"..., 131) = 131
write(2, "\33[0m", 4)                   = 4
write(2, "\33[0m", 4)                   = 4
write(2, "\33[33m", 5)                  = 5
write(2, "INFO - finalize response status:"..., 35) = 35
write(2, "\33[0m", 4)                   = 4
write(1, "Authenticator finalized.\n", 25) = 25
write(2, "\33[0m", 4)                   = 4
write(2, "\33[33m", 5)                  = 5
write(2, "INFO - Saving manifest and accou"..., 39) = 39
write(2, "\33[0m", 4)                   = 4
futex(0x558b99944c10, FUTEX_WAIT_BITSET_PRIVATE, 2, NULL, FUTEX_BITSET_MATCH_ANY

dyc3 avatar Dec 05 '22 16:12 dyc3

Yep, it hangs. But interrupting the process after a while the maFiles are correctly written and everything is fine.

At least for me the "maFile" did contain "fully_enrolled":false after Ctrl+C'ed the hang on "Saving manifest", yet per https://github.com/dyc3/steamguard-cli/blob/15bb6230f027c9619368965cb92e7c250862b9f5/steamguard/src/accountlinker.rs#L112 it should have swapped it to "fully_enrolled:true.

However, I concur that other token/secret information is present in "maFile" and is usable.

aleksandrs-ledovskis avatar Feb 05 '23 21:02 aleksandrs-ledovskis