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

Grabbing a two-seater draisine which derailed causes duplication of its parts #53555

Closed
NetSysFire opened this issue Dec 18, 2021 · 4 comments · Fixed by #60911
Closed

Grabbing a two-seater draisine which derailed causes duplication of its parts #53555

NetSysFire opened this issue Dec 18, 2021 · 4 comments · Fixed by #60911
Labels
<Bug> This needs to be fixed <Crash / Freeze> Fatal bug that results in hangs or crashes. Vehicles Vehicles, parts, mechanics & interactions

Comments

@NetSysFire
Copy link
Member

Describe the bug

See title.

Steps to reproduce

  1. Find or spawn a two-seater draisine in the subway.
  2. Get it to derail or make it spawn beside the rails.
  3. Grab it to shove it back onto the rails.
  4. Weird stuff happens.

image

Expected behavior

The weird stuff does not happen.

Screenshots

No response

Versions and configuration

  • experimental

Additional context

No response

@NetSysFire NetSysFire added <Bug> This needs to be fixed Vehicles Vehicles, parts, mechanics & interactions labels Dec 18, 2021
@NetSysFire
Copy link
Member Author

And trying to smash these duplicated parts also causes a crash I just found out.

/usr/include/c++/11.1.0/bits/stl_vector.h:1063: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = vehicle_part; _Alloc = std::allocator<vehicle_part>; std::vector<_Tp, _Alloc>::const_reference = const vehicle_part&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__n < this->size()' failed.
The program has crashed.
See the log file for a stack trace.
CRASH LOG FILE: /home/username/.config/cataclysm-dda/crash.log
VERSION: 0.F
TYPE: Signal
MESSAGE: SIGABRT: Abnormal termination
STACK TRACE:

    cataclysm-tiles(debug_write_backtrace(std::ostream&)+0x46) [0x5648f458b630]
    cataclysm-tiles(+0x9f76d8) [0x5648f45696d8]
    cataclysm-tiles(+0x9f7961) [0x5648f4569961]
    /usr/lib/libc.so.6(+0x3cda0) [0x7f1c3642ada0]
    /usr/lib/libc.so.6(gsignal+0x142) [0x7f1c3642ad22]
    /usr/lib/libc.so.6(abort+0x116) [0x7f1c36414862]
    cataclysm-tiles(std::type_info::name() const+0) [0x5648f42a3d76]
    cataclysm-tiles(std::vector<vehicle_part, std::allocator<vehicle_part> >::operator[](unsigned long) const+0x45) [0x5648f4fe2a57]
    cataclysm-tiles(vehicle::part_with_feature(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const+0x23) [0x5648f4fc8c4f]
    cataclysm-tiles(vpart_position::part_with_feature(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const+0x1d) [0x5648f4fc8e2f]
    cataclysm-tiles(optional_vpart_position::part_with_feature(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const+0x46) [0x5648f4fc8ea2]
    cataclysm-tiles(cata_tiles::draw_vpart(tripoint const&, lit_level, int&, bool const (&) [5])+0x314) [0x5648f441d3c8]
    cataclysm-tiles(cata_tiles::draw(point const&, tripoint const&, int, int, std::multimap<point, formatted_text, std::less<point>, std::allocator<std::pair<point const, formatted_text> > >&, std::pair<SDL_BlendMode, std::multimap<point, SDL_Color, std::less<point>, std::allocator<std::pair<point const, SDL_Color> > > >&)+0x1beb) [0x5648f4420e1f]
    cataclysm-tiles(cata_cursesport::curses_drawwindow(catacurses::window const&)+0x13d) [0x5648f4ecaf40]
    cataclysm-tiles(game::draw()+0x13b) [0x5648f46c14ad]
    cataclysm-tiles(ui_adaptor::redraw_invalidated()+0x174) [0x5648f4f7daf0]
    cataclysm-tiles(do_turn()+0x1fc0) [0x5648f45eb094]
    cataclysm-tiles(main+0x1825) [0x5648f4172903]
    /usr/lib/libc.so.6(__libc_start_main+0xd5) [0x7f1c36415b25]
    cataclysm-tiles(_start+0x2e) [0x5648f429cf3e]

    Attempting to repeat stack trace using debug symbols…
    debug_write_backtrace(std::ostream&)
    ??:?
    init_crash_handlers()
    ??:?
    init_crash_handlers()
    ??:?
    __restore_rt
    sigaction.c:?
    __GI_raise
    :?
    __GI_abort
    :?
    std::type_info::name() const
    ??:?
    std::vector<vehicle_part, std::allocator<vehicle_part> >::operator[](unsigned long) const
    ??:?
    vehicle::part_with_feature(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const
    ??:?
    vpart_position::part_with_feature(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const
    ??:?
    optional_vpart_position::part_with_feature(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const
    ??:?
    cata_tiles::draw_vpart(tripoint const&, lit_level, int&, bool const (&) [5])
    ??:?
    cata_tiles::draw(point const&, tripoint const&, int, int, std::multimap<point, formatted_text, std::less<point>, std::allocator<std::pair<point const, formatted_text> > >&, std::pair<SDL_BlendMode, std::multimap<point, SDL_Color, std::less<point>, std::allocator<std::pair<point const, SDL_Color> > > >&)
    ??:?
    cata_cursesport::curses_drawwindow(catacurses::window const&)
    ??:?
    game::draw()
    ??:?
    ui_adaptor::redraw_invalidated()
    ??:?
    do_turn()
    ??:?
    main
    ??:?
    __libc_start_main
    ??:?
    _start
    ??:?

@NetSysFire NetSysFire added the <Crash / Freeze> Fatal bug that results in hangs or crashes. label Dec 18, 2021
@ZhilkinSerg
Copy link
Contributor

Seems to be related to #53330

@BrettDong
Copy link
Member

It seems to me that the phantom vehicle parts are not actually duplicated in the game world, but a display glitch. Probably some visibility cache is not invalidated properly.

@NetSysFire
Copy link
Member Author

I got a trace of the crash if that helps. I can confirm @BrettDong's suspicion and the phantom vehicle is not visible upon a reload of the save.

gdb.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed <Crash / Freeze> Fatal bug that results in hangs or crashes. Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants