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

[Bug] Panic when I export Messages #701

Open
zenlei opened this issue Aug 19, 2024 · 3 comments
Open

[Bug] Panic when I export Messages #701

zenlei opened this issue Aug 19, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@zenlei
Copy link

zenlei commented Aug 19, 2024

Describe the bug

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x118612e]

goroutine 15 [running]:
github.com/gabriel-vasile/mimetype.(*MIME).Extension(...)
github.com/gabriel-vasile/[email protected]/mime.go:32
github.com/iyear/tdl/core/tmedia.GetDocumentName(0xc000349cc0)
github.com/iyear/tdl/[email protected]/tmedia/document.go:37 +0x6e
github.com/iyear/tdl/core/tmedia.GetDocumentInfo(0x64?)
github.com/iyear/tdl/[email protected]/tmedia/document.go:22 +0x88
github.com/iyear/tdl/core/tmedia.extractMedia({0x1b06158?, 0xc000401840?})
github.com/iyear/tdl/[email protected]/tmedia/media.go:19 +0x4d
github.com/iyear/tdl/core/tmedia.GetMedia({0x1b1b348?, 0xc00026bb80?})
github.com/iyear/tdl/[email protected]/tmedia/media.go:37 +0x65
github.com/iyear/tdl/app/chat.Export({0x1b01b68, 0xc0002d5410}, 0xc00027e000, {0x1b00160?, 0xc0001f8120}, {0x0, {0x7ffedb7a8e2f, 0x5}, 0x0, {0xc0001c8770, ...}, ...})
github.com/iyear/tdl/app/chat/export.go:178 +0x1196
github.com/iyear/tdl/cmd.NewChatExport.func1.1({0x1b01ba0?, 0xc00007f540?}, 0xc000041a40?, {0x1b00160, 0xc0001f8120})
github.com/iyear/tdl/cmd/chat.go:86 +0x9a
github.com/iyear/tdl/cmd.tRun.func1({0x1b01ba0?, 0xc00007f540?})
github.com/iyear/tdl/cmd/root.go:163 +0x31
github.com/iyear/tdl/cmd.tRun.RunWithAuth.func2({0x1b01ba0, 0xc00007f540})
github.com/iyear/tdl/[email protected]/tclient/tclient.go:120 +0x63
github.com/gotd/td/telegram.(*Client).Run.func3({0x1b01ba0, 0xc00007f540})
github.com/gotd/[email protected]/telegram/connect.go:150 +0xb7
github.com/gotd/td/telegram.(*Client).Run.(*CancellableGroup).Go.func6()
github.com/gotd/[email protected]/tdsync/cancel_group.go:48 +0x26
golang.org/x/sync/errgroup.(*Group).Go.func1()
golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x96

To Reproduce

wget https://github.com/iyear/tdl/releases/download/v0.17.3/tdl_Linux_64bit.tar.gz
tar xvf tdl_Linux_64bit.tar.gz
./tdl chat export -c SQMP3 --ntp pool.ntp.org

Expected behavior

First, I ran it without specifying NTP and encountered an error. The second time, I thought it might be a timing issue, so I specified NTP, but it still gave me the same error.

Version

Version: 0.17.3
Commit: 6c382b8
Date: 2024-07-07T10:59:56Z
go1.21.11 linux/amd64

Which OS are you running tdl on?

Linux

Additional context

No response

@zenlei zenlei added the bug Something isn't working label Aug 19, 2024
@zenlei
Copy link
Author

zenlei commented Aug 19, 2024

OS infomation:
cat /etc/issue
Debian GNU/Linux 12 \n \l
uname -a
Linux e67d627cb7 5.15.126-1-pve #1 SMP PVE 5.15.126-1 (2023-10-03T17:24Z) x86_64 GNU/Linux

@zenlei
Copy link
Author

zenlei commented Aug 20, 2024

Hi,
Maybe I found the cause of the problem. When I tdl chat export, if I use -T id -i 0,1000 to specify the ID range, there will be no problem if I split the export ID and export it several times. So the cause of the problem is timeout or overflow?

@iyear
Copy link
Owner

iyear commented Sep 17, 2024

Sorry, I can't reproduce it with v0.17.4

Command: ./tdl chat export -c SQMP3 --ntp pool.ntp.org

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