xeals / signal-back

Decrypt Signal encrypted backups outside the app
Apache License 2.0
704 stars 67 forks source link

errno=1455 (fatal error: out of memory) #38

Open GuardianMajor opened 6 years ago

GuardianMajor commented 6 years ago

Detailed description

While I previously successfully decrypted a first generation Signal backup file, when I tried with one that was created just days ago, it fails with this error.

Full relevant output

runtime: VirtualAlloc of 2955739136 bytes failed with errno=1455
fatal error: out of memory

runtime stack:
runtime.throw(0x5e3947, 0xd)
        /usr/lib/go-1.10/src/runtime/panic.go:616 +0x88
runtime.sysMap(0xc1098b0000, 0xb02d0000, 0x6f1e01, 0x70a138)
        /usr/lib/go-1.10/src/runtime/mem_windows.go:122 +0x13b
runtime.(*mheap).sysAlloc(0x6f16e0, 0xb02d0000, 0x0)
        /usr/lib/go-1.10/src/runtime/malloc.go:470 +0xdb
runtime.(*mheap).grow(0x6f16e0, 0x58168, 0x0)
        /usr/lib/go-1.10/src/runtime/mheap.go:907 +0x67
runtime.(*mheap).allocSpanLocked(0x6f16e0, 0x58168, 0x70a148, 0x31cfe40)
        /usr/lib/go-1.10/src/runtime/mheap.go:820 +0x308
runtime.(*mheap).alloc_m(0x6f16e0, 0x58168, 0xffffffffffff0101, 0x31cfe70)
        /usr/lib/go-1.10/src/runtime/mheap.go:686 +0x126
runtime.(*mheap).alloc.func1()
        /usr/lib/go-1.10/src/runtime/mheap.go:753 +0x54
runtime.(*mheap).alloc(0x6f16e0, 0x58168, 0x3010101, 0x41390a)
        /usr/lib/go-1.10/src/runtime/mheap.go:752 +0x91
runtime.largeAlloc(0xb02ce008, 0x440101, 0x1b06a8)
        /usr/lib/go-1.10/src/runtime/malloc.go:826 +0x9b
runtime.mallocgc.func1()
        /usr/lib/go-1.10/src/runtime/malloc.go:721 +0x4d
runtime.systemstack(0x0)
        /usr/lib/go-1.10/src/runtime/asm_amd64.s:409 +0x7e
runtime.mstart()
        /usr/lib/go-1.10/src/runtime/proc.go:1175

goroutine 1 [running]:
runtime.systemstack_switch()
        /usr/lib/go-1.10/src/runtime/asm_amd64.s:363 fp=0xc042033050 sp=0xc042033048 pc=0x44f300
runtime.mallocgc(0xb02ce008, 0x59eaa0, 0x1, 0x0)
        /usr/lib/go-1.10/src/runtime/malloc.go:720 +0x8e1 fp=0xc0420330f0 sp=0xc042033050 pc=0x40fda1
runtime.makeslice(0x59eaa0, 0xb02ce008, 0xb02ce008, 0x4, 0x4, 0x4)
        /usr/lib/go-1.10/src/runtime/slice.go:61 +0x7e fp=0xc042033120 sp=0xc0420330f0 pc=0x43b62e
github.com/xeals/signal-back/types.(*BackupFile).Frame(0xc0420ecfc0, 0xc0b173a410, 0x0, 0x0)
        /home/xeal/.local/share/go/src/github.com/xeals/signal-back/types/backup.go:94 +0xf7 fp=0xc0420331d0 sp=0xc042033120 pc=0x56bcc7
github.com/xeals/signal-back/cmd.XML(0xc0420ecfc0, 0x606e40, 0xc042072008, 0x3, 0x1)
        /home/xeal/.local/share/go/src/github.com/xeals/signal-back/cmd/format.go:145 +0x119 fp=0xc042033998 sp=0xc0420331d0 pc=0x57b979
github.com/xeals/signal-back/cmd.glob..func4(0xc042088420, 0x0, 0x0)
        /home/xeal/.local/share/go/src/github.com/xeals/signal-back/cmd/format.go:67 +0x416 fp=0xc042033a38 sp=0xc042033998 pc=0x57d486
github.com/xeals/signal-back/vendor/github.com/urfave/cli.HandleAction(0x5a6140, 0x5ef668, 0xc042088420, 0xc042082100, 0x0)
        /home/xeal/.local/share/go/src/github.com/xeals/signal-back/vendor/github.com/urfave/cli/app.go:490 +0xcf fp=0xc042033a60 sp=0xc042033a38 pc=0x504b5f
github.com/xeals/signal-back/vendor/github.com/urfave/cli.Command.Run(0x5e20ed, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5e96cb, 0x1f, 0x5ee97c, ...)
        /home/xeal/.local/share/go/src/github.com/xeals/signal-back/vendor/github.com/urfave/cli/command.go:210 +0xa3d fp=0xc042033cd0 sp=0xc042033a60 pc=0x505ddd
github.com/xeals/signal-back/vendor/github.com/urfave/cli.(*App).Run(0xc0420841a0, 0xc04207a000, 0x5, 0x8, 0x0, 0x0)
        /home/xeal/.local/share/go/src/github.com/xeals/signal-back/vendor/github.com/urfave/cli/app.go:255 +0x6a7 fp=0xc042033ea8 sp=0xc042033cd0 pc=0x502ea7
main.main()
        /home/xeal/.local/share/go/src/github.com/xeals/signal-back/main.go:52 +0x31e fp=0xc042033f88 sp=0xc042033ea8 pc=0x57e2fe
runtime.main()
        /usr/lib/go-1.10/src/runtime/proc.go:198 +0x20e fp=0xc042033fe0 sp=0xc042033f88 pc=0x42c4be
runtime.goexit()
        /usr/lib/go-1.10/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc042033fe8 sp=0xc042033fe0 pc=0x451d81
GuardianMajor commented 6 years ago

I ran it against a newer backup from yesterday and this time it completes and gives no errors at all, but the file that is generated contains no messages.

<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<?xml-stylesheet type="text/xsl" href="sms.xsl" ?>
<smses count="0"></smses>

signal-back v0.1.6 proto commit: d6610f0

nezorflame commented 6 years ago

@GuardianMajor same empty XML result for me on macOS 10.14.1., both on latest release binary and on one compiled from master.

nezorflame commented 6 years ago

While this is not the original issue, I've managed to find and fix the empty XML problem: https://github.com/xeals/signal-back/pull/39

GuardianMajor commented 6 years ago

Excellent, hopefully it will be merged and made available for release, thank you.

nezorflame commented 5 years ago

Closed the old PR as requested by @xeals, opened a new one in https://github.com/xeals/signal-back/pull/43

GuardianMajor commented 5 years ago

@xeals Alex, I appreciate the latest release that fixes this issue but unfortunately I don't see the build for signal-back_windows_amd64.exe and I am not currently setup to compile my own from source, would it be possible to have that build as well. Thank you.

xeals commented 5 years ago

Really interesting that it didn't build the 64-bit Windows. I've manually compiled and uploaded it.

GuardianMajor commented 5 years ago

Yeah, I was surprised too, that's why I thought you'd want to know. Thank you by the way.

km22 commented 5 years ago

I am using version v0.1.7-alpha.2 and am also getting this out of memory error. My backup file is 3.5GB but my laptop has 16GB of RAM. I tried running after a fresh reboot but still got the error. I can see the memory usage increase to 13GB+ before I get the out of memory error and then the application terminates. The error I get is as follows:

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Ken>cd Desktop

C:\Users\Ken\Desktop>cd signal-back

C:\Users\Ken\Desktop\signal-back>signal-back_windows_amd64.exe format -f XML -o backup.xml -P password.txt signal-2019-10-01-22-18-37.backup runtime: VirtualAlloc of 8589934592 bytes failed with errno=1455 fatal error: out of memory

runtime stack: runtime.throw(0x61eb57, 0xd) /usr/lib/go/src/runtime/panic.go:608 +0x79 runtime.sysMap(0xc327800000, 0x200000000, 0x7cfd98) /usr/lib/go/src/runtime/mem_windows.go:122 +0x138 runtime.(mheap).sysAlloc(0x7b7060, 0x200000000, 0xeb86658, 0x38efd90) /usr/lib/go/src/runtime/malloc.go:619 +0x1d9 runtime.(mheap).grow(0x7b7060, 0x100000, 0x0) /usr/lib/go/src/runtime/mheap.go:920 +0x49 runtime.(mheap).allocSpanLocked(0x7b7060, 0x100000, 0x7cfda8, 0x203049700000000 ) /usr/lib/go/src/runtime/mheap.go:848 +0x361 runtime.(mheap).alloc_m(0x7b7060, 0x100000, 0xffffffffffff0101, 0x38efe70) /usr/lib/go/src/runtime/mheap.go:692 +0x127 runtime.(mheap).alloc.func1() /usr/lib/go/src/runtime/mheap.go:759 +0x53 runtime.(mheap).alloc(0x7b7060, 0x100000, 0x3010101, 0x415cc3) /usr/lib/go/src/runtime/mheap.go:758 +0x91 runtime.largeAlloc(0x1fffff000, 0x440101, 0x9306a0) /usr/lib/go/src/runtime/malloc.go:1019 +0x9e runtime.mallocgc.func1() /usr/lib/go/src/runtime/malloc.go:914 +0x4d runtime.systemstack(0x0) /usr/lib/go/src/runtime/asm_amd64.s:351 +0x6b runtime.mstart() /usr/lib/go/src/runtime/proc.go:1229

goroutine 1 [running]: runtime.systemstack_switch() /usr/lib/go/src/runtime/asm_amd64.s:311 fp=0xc000074158 sp=0xc000074150 pc=0x452780 runtime.mallocgc(0x1fffff000, 0x5d6b00, 0x580301, 0xc000074230) /usr/lib/go/src/runtime/malloc.go:913 +0x8d5 fp=0xc0000741f8 sp=0xc00007 4158 pc=0x40bd05 runtime.makeslice(0x5d6b00, 0x1fffff000, 0x1fffff000, 0x0, 0x0, 0x403733) /usr/lib/go/src/runtime/slice.go:70 +0x7e fp=0xc000074228 sp=0xc0000741f 8 pc=0x43d81e bytes.makeSlice(0x1fffff000, 0x0, 0x0, 0x0) /usr/lib/go/src/bytes/buffer.go:231 +0x74 fp=0xc000074268 sp=0xc00007422 8 pc=0x4d0084 bytes.(Buffer).grow(0xc0001243f0, 0x1000, 0x1000) /usr/lib/go/src/bytes/buffer.go:144 +0x161 fp=0xc0000742b8 sp=0xc0000742 68 pc=0x4cf9d1 bytes.(Buffer).Write(0xc0001243f0, 0xc125c2f000, 0x1000, 0x1000, 0x1000, 0x0, 0 x0) /usr/lib/go/src/bytes/buffer.go:174 +0xe3 fp=0xc0000742e8 sp=0xc0000742b 8 pc=0x4cfcc3 bufio.(Writer).Flush(0xc125c10600, 0xc0fb3386a1, 0x1000) /usr/lib/go/src/bufio/bufio.go:575 +0x7c fp=0xc000074348 sp=0xc0000742e8 pc=0x525b3c bufio.(Writer).WriteString(0xc125c10600, 0xc0fb3386a1, 0x62440b, 0x1, 0x0, 0x0)

    /usr/lib/go/src/bufio/bufio.go:678 +0x49 fp=0xc000074388 sp=0xc000074348

pc=0x526259 encoding/xml.(printer).EscapeString(0xc004057950, 0xc0fa602000, 0x135aaac) /usr/lib/go/src/encoding/xml/xml.go:1979 +0x331 fp=0xc000074400 sp=0xc00 0074388 pc=0x592961 encoding/xml.(printer).writeStart(0xc004057950, 0xc000074600, 0x0, 0x0) /usr/lib/go/src/encoding/xml/marshal.go:713 +0x2ef fp=0xc0000744e8 sp=0x c000074400 pc=0x57f33f encoding/xml.(printer).marshalValue(0xc004057950, 0x60ed20, 0xc00424efc0, 0x199 , 0xc126b22000, 0x0, 0x199, 0xc125da2c00) /usr/lib/go/src/encoding/xml/marshal.go:515 +0x60e fp=0xc000074728 sp=0x c0000744e8 pc=0x57c37e encoding/xml.(printer).marshalValue(0xc004057950, 0x5d2280, 0xc126a73758, 0x197 , 0xc126b22000, 0x0, 0x197, 0x0) /usr/lib/go/src/encoding/xml/marshal.go:451 +0xc2d fp=0xc000074968 sp=0x c000074728 pc=0x57c99d encoding/xml.(printer).marshalStruct(0xc004057950, 0xc126b04d80, 0x618560, 0xc1 26a73738, 0x199, 0xc, 0x5cff80) /usr/lib/go/src/encoding/xml/marshal.go:937 +0x28c fp=0xc000074aa0 sp=0x c000074968 pc=0x5808cc encoding/xml.(printer).marshalValue(0xc004057950, 0x618560, 0xc126a73738, 0x199 , 0xc00009c058, 0x0, 0x199, 0x0) /usr/lib/go/src/encoding/xml/marshal.go:520 +0x678 fp=0xc000074ce0 sp=0x c000074aa0 pc=0x57c3e8 encoding/xml.(printer).marshalValue(0xc004057950, 0x5d2240, 0xc000096328, 0x197 , 0xc00009c058, 0x0, 0x197, 0x0) /usr/lib/go/src/encoding/xml/marshal.go:451 +0xc2d fp=0xc000074f20 sp=0x c000074ce0 pc=0x57c99d encoding/xml.(printer).marshalStruct(0xc004057950, 0xc126b04d00, 0x6010a0, 0xc0 00096300, 0x199, 0x5, 0x5d6200) /usr/lib/go/src/encoding/xml/marshal.go:937 +0x28c fp=0xc000075058 sp=0x c000074f20 pc=0x5808cc encoding/xml.(printer).marshalValue(0xc004057950, 0x5cbe40, 0xc000096300, 0x16, 0x0, 0x0, 0x90, 0x5ee6a0) /usr/lib/go/src/encoding/xml/marshal.go:520 +0x678 fp=0xc000075298 sp=0x c000075058 pc=0x57c3e8 encoding/xml.(Encoder).Encode(0xc004057950, 0x5cbe40, 0xc000096300, 0xc125c2f00 0, 0x1000) /usr/lib/go/src/encoding/xml/marshal.go:158 +0xc5 fp=0xc0000752f8 sp=0xc 000075298 pc=0x57a5f5 encoding/xml.MarshalIndent(0x5cbe40, 0xc000096300, 0x0, 0x0, 0x61c1eb, 0x2, 0x0, 0x1, 0x4c514ac70e444895, 0x209731e3a2183284, ...) /usr/lib/go/src/encoding/xml/marshal.go:125 +0x177 fp=0xc000075360 sp=0x c0000752f8 pc=0x57a357 github.com/xeals/signal-back/cmd.XML(0xc000124070, 0x6527e0, 0xc000082018, 0x3, 0x1) /home/xeal/go/src/github.com/xeals/signal-back/cmd/format.go:255 +0x9fe fp=0xc0000759c0 sp=0xc000075360 pc=0x5b0e2e github.com/xeals/signal-back/cmd.glob..func4(0xc00009c420, 0x0, 0x0) /home/xeal/go/src/github.com/xeals/signal-back/cmd/format.go:70 +0x403 f p=0xc000075a60 sp=0xc0000759c0 pc=0x5b2283 github.com/xeals/signal-back/vendor/github.com/urfave/cli.HandleAction(0x5de720, 0x62b5f8, 0xc00009c420, 0xc000096100, 0x0) /home/xeal/go/src/github.com/xeals/signal-back/vendor/github.com/urfave/ cli/app.go:490 +0xcf fp=0xc000075a88 sp=0xc000075a60 pc=0x50c1cf github.com/xeals/signal-back/vendor/github.com/urfave/cli.Command.Run(0x61d1db, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x624e86, 0x1f, 0x62a881, ...) /home/xeal/go/src/github.com/xeals/signal-back/vendor/github.com/urfave/ cli/command.go:210 +0x997 fp=0xc000075cf8 sp=0xc000075a88 pc=0x50d397 github.com/xeals/signal-back/vendor/github.com/urfave/cli.(*App).Run(0xc0000981a 0, 0xc00008e000, 0x9, 0x10, 0x0, 0x0) /home/xeal/go/src/github.com/xeals/signal-back/vendor/github.com/urfave/ cli/app.go:255 +0x68e fp=0xc000075ed0 sp=0xc000075cf8 pc=0x50a4fe main.main() /home/xeal/go/src/github.com/xeals/signal-back/main.go:52 +0x2d7 fp=0xc0 00075f98 sp=0xc000075ed0 pc=0x5b3fa7 runtime.main() /usr/lib/go/src/runtime/proc.go:201 +0x207 fp=0xc000075fe0 sp=0xc000075f 98 pc=0x42e237 runtime.goexit() /usr/lib/go/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc000075fe8 sp=0xc0000 75fe0 pc=0x454771

C:\Users\Ken\Desktop\signal-back>

ghost commented 3 years ago

Please post the proper solutions.