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

use emplace and emplace_back #279

Merged
merged 2 commits into from
Dec 22, 2024
Merged

use emplace and emplace_back #279

merged 2 commits into from
Dec 22, 2024

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Dec 18, 2024

No description provided.

@rakshasa
Copy link
Owner

This causes segfault at start when running rtorrent-docker CI tests.

@rakshasa
Copy link
Owner

(lldb) target create "/prefix/bin/rtorrent"
Current executable set to '/prefix/bin/rtorrent' (x86_64).
(lldb) settings set -- target.run-args  "-o" "system.daemon.set=true,import=/run/self/rc"
(lldb) settings set target.disable-aslr false
(lldb) run
Process 88 stopped
* thread #1, name = 'rtorrent', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x0)
    frame #0: 0x00007fcd0ac59cf1 libstdc++.so.6`std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) + 33
libstdc++.so.6`std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_M_assign:
->  0x7fcd0ac59cf1 <+33>: movq   (%rdi), %r13
    0x7fcd0ac59cf4 <+36>: leaq   0x10(%rdi), %r14
    0x7fcd0ac59cf8 <+40>: movq   0x8(%rsi), %r12
    0x7fcd0ac59cfc <+44>: movq   %rdi, %rbx
Process 88 launched: '/prefix/bin/rtorrent' (x86_64)
(lldb) bt
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
* thread #1, name = 'rtorrent', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x0)
  * frame #0: 0x00007fcd0ac59cf1 libstdc++.so.6`std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) + 33
    frame #1: 0x00007fcd0ac5a1ea libstdc++.so.6`std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) + 10
    frame #2: 0x0000562970da69cd rtorrent`torrent::choke_group::set_name(this=0x0000000000000000, name=error: summary string parsing error) at choke_group.h:64:66
    frame #3: 0x00007fcd0ae94d3d libtorrent.so.22`torrent::ResourceManager::push_group(this=0x00007fcd0a22fb10, name=error: summary string parsing error) at resource_manager.cc:132:28
    frame #4: 0x00007fcd0ae4c972 libtorrent.so.22`torrent::Manager::Manager(this=0x00007fcd0a246200) at manager.cc:65:22
    frame #5: 0x00007fcd0af0a517 libtorrent.so.22`torrent::initialize() at torrent.cc:67:17
    frame #6: 0x0000562970d2806d rtorrent`main(argc=3, argv=0x00007ffcdad8baf8) at main.cc:230:5
    frame #7: 0x00007fcd0b18770a ld-musl-x86_64.so.1`libc_start_main_stage2(main=(rtorrent`main at main.cc:186), argc=3, argv=0x00007ffcdad8baf8) at __libc_start_main.c:95:2
    frame #8: 0x0000562970d263c1 rtorrent`_start + 22

Found with modernize-use-emplace

Signed-off-by: Rosen Penev <[email protected]>
@neheb
Copy link
Contributor Author

neheb commented Dec 20, 2024

Fixed I think. Problem was a bad manual conversion.

@rakshasa rakshasa merged commit fdc16b1 into rakshasa:master Dec 22, 2024
2 checks passed
stickz added a commit to stickz/rtorrent that referenced this pull request Dec 22, 2024
stickz added a commit to stickz/rtorrent that referenced this pull request Dec 22, 2024
stickz added a commit to stickz/rtorrent that referenced this pull request Dec 22, 2024
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

Successfully merging this pull request may close these issues.

2 participants