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

Segfault from is_tool upon restarting craft #32786

Closed
pjf opened this issue Jul 31, 2019 · 2 comments · Fixed by #36762
Closed

Segfault from is_tool upon restarting craft #32786

pjf opened this issue Jul 31, 2019 · 2 comments · Fixed by #36762
Labels
Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Crash / Freeze> Fatal bug that results in hangs or crashes. (S2 - Confirmed) Bug that's been confirmed to exist
Milestone

Comments

@pjf
Copy link
Contributor

pjf commented Jul 31, 2019

Describe the bug

Started making soup. Ran out of firewood, so had to go chop some more. Came back, restarted craft, and got a segfault.

This is a different segfault to #32694, as the stacktrace shows a different code path:

Stacktrace - click to expand
The program has crashed.
See the log file for a stack trace.
CRASH LOG FILE: /home/pjf/.cataclysm-dda/config/crash.log
VERSION: 0.D-6038-g05403e755f
TYPE: Signal
MESSAGE: SIGSEGV: Segmentation fault
STACK TRACE:

	./cataclysm-tiles(_Z21debug_write_backtraceRSo+0x23) [0xa7bab6]
	./cataclysm-tiles() [0xa69576]
	./cataclysm-tiles() [0xa691e4]
	/lib/x86_64-linux-gnu/libc.so.6(+0x354b0) [0x7f19ccafe4b0]
	./cataclysm-tiles(_ZNK4item7is_toolEv+0x3) [0xbf3625]
	./cataclysm-tiles() [0x11dc14c]
	./cataclysm-tiles(_ZNSt17_Function_handlerIF13VisitResponseP4itemESt8functionIFS0_PKS1_EEE9_M_invokeERKSt9_Any_dataOS2_+0x18) [0x11e2e14]
	./cataclysm-tiles(_ZNSt17_Function_handlerIF13VisitResponseP4itemS2_EZN9visitableIS1_E11visit_itemsERKSt8functionIFS0_S2_EEEUlS2_S2_E_E9_M_invokeERKSt9_Any_dataOS2_SG_+0x18) [0x11e2dce]
	./cataclysm-tiles() [0x11d9c76]
	./cataclysm-tiles(_ZN9visitableI4itemE11visit_itemsERKSt8functionIF13VisitResponsePS0_EE+0x28) [0x11de4f6]
	./cataclysm-tiles(_ZNK9visitableI4itemE11visit_itemsERKSt8functionIF13VisitResponsePKS0_EE+0x7e) [0x11de5c8]
	./cataclysm-tiles(_ZNK9visitableI9inventoryE10charges_ofERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiRKSt8functionIFbRK4itemEE+0xd1) [0x11db207]
	./cataclysm-tiles() [0x10b3dec]
	./cataclysm-tiles(_ZN16requirement_data21continue_requirementsERKSt6vectorI9item_compSaIS1_EERKNSt7__cxx114listI4itemSaIS8_EEE+0x205) [0x10b32a3]
	./cataclysm-tiles(_ZNK4item17get_continue_reqsEv+0x31) [0xa4c9ab]
	./cataclysm-tiles(_ZN6player18can_continue_craftER4item+0x45) [0xa4ba99]
	./cataclysm-tiles(_ZN17activity_handlers13craft_do_turnEP15player_activityP6player+0x46) [0x8e8415]
	./cataclysm-tiles(_ZNK13activity_type12call_do_turnEP15player_activityP6player+0x58) [0x9280c4]
	./cataclysm-tiles(_ZN15player_activity7do_turnER6player+0xac) [0x1058fe2]
	./cataclysm-tiles(_ZN4game16process_activityEv+0x72) [0xb1e07a]

	Attempting to repeat stack trace using debug symbols...
	debug_write_backtrace(std::ostream&)
	??:?
	log_crash(char const*, char const*)
	crash.cpp:?
	signal_handler(int)
	crash.cpp:?
	??
	??:0
	item::is_tool() const
	??:?
	std::_Function_handler(item const&, std::__cxx11::basic_string, std::allocator > const&, int, std::function const&)::{lambda(item const*)#1}>::_M_invoke(std::_Any_data const&, item const*&&)
	visitable.cpp:?
	std::_Function_handler >::_M_invoke(std::_Any_data const&, item*&&)
	??:?
	std::_Function_handler::visit_items(std::function const&)::{lambda(item*, item*)#1}>::_M_invoke(std::_Any_data const&, item*&&, std::_Any_data const&)
	??:?
	visit_internal(std::function const&, item*, item*)
	visitable.cpp:?
	visitable::visit_items(std::function const&)
	??:?
	visitable::visit_items(std::function const&) const
	??:?
	visitable::charges_of(std::__cxx11::basic_string, std::allocator > const&, int, std::function const&) const
	??:?
	bool __gnu_cxx::__ops::_Iter_pred > const&, std::__cxx11::list > const&)::$_6>::operator()<__gnu_cxx::__normal_iterator >*, std::vector >, std::allocator > > > > >(__gnu_cxx::__normal_iterator >*, std::vector >, std::allocator > > > >)
	requirements.cpp:?
	requirement_data::continue_requirements(std::vector > const&, std::__cxx11::list > const&)
	??:?
	item::get_continue_reqs() const
	??:?
	player::can_continue_craft(item&)
	??:?
	activity_handlers::craft_do_turn(player_activity*, player*)
	??:?
	activity_type::call_do_turn(player_activity*, player*) const
	??:?
	player_activity::do_turn(player&)
	??:?
	game::process_activity()
	??:?

Steps To Reproduce

Have not yet been able to reproduce.

Expected behavior

Crafts finish without segfault.

Versions and configuration

    Dark Days Ahead [dda],
    Filthy Clothing [filthy_morale],
    Alternative Map Key [alt_map_key],
    [DP_MOD] Indicators: REMIX [DP_REMIX_INDICATORS],
    Modular Turrets [modular_turrets],
    Salvaged Robots [Salvaged_Robots],
    Sleep Deprivation [sleepdeprivation],
    Bionic Slots [cbm_slots],
    sees-player icon, -attitude [sees_player_less_attitude]
@ZhilkinSerg ZhilkinSerg added (S2 - Confirmed) Bug that's been confirmed to exist <Crash / Freeze> Fatal bug that results in hangs or crashes. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling labels Jul 31, 2019
@kevingranade kevingranade added this to the 0.E milestone Nov 3, 2019
@ghost
Copy link

ghost commented Dec 18, 2019

Cannot reproduce on latest master, I craft woods soup until its interrupted by the fire going out due to lack of wood, I go and get some more, resume the craft when the fire is relit, its fine.

@I-am-Erk
Copy link
Member

I also can't reproduce. This might have been a different thing causing the segfault, I'll go ahead and close it unless someone has seen it happen again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Crash / Freeze> Fatal bug that results in hangs or crashes. (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants