Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #856546

in get_unittype_bonus() [effects.c::831]: assertion 'pplayer != ((void *)0) && punittype != ((void *)0)' failed. (3.0.92-dev (15fea6a008), gui-qt client, civ2civ3)

Added by Chippo Elder over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Client
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

While playing the qt client from master with civ2civ3, I get the above assertion failure message in the console as well as the 'Please report' line.

History

#1 Updated by Jacob Nevins over 2 years ago

For assertion failures, a useful technique is to get a backtrace. This can often lead us to the problem even if you can't give a reproduction case.

Unlike the savegame/chatline stuff was, this is already fairly well documented on our bug reporting page:
http://www.freeciv.org/wiki/Bug_Reporting#Backtrace

#2 Updated by Chippo Elder over 2 years ago

I've seen SOOO many of these assertion failures across multiple clients, that I thought that everyone would know what I'm talking about. So when I raised this ticket, it was done very poorly.

These assertion failures do NOT cause a core dump. If they had, I probably would have sent in a BT, without being asked. They print messages into the console in the 1000s. Here's a chunk c'n'pasted straight from my console, showing this assertion failure, along with another.

1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_unittype_bonus() [effects.c::831]: assertion 'pplayer != ((void *)0) && punittype != ((void *)0)' failed.
1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_unittype_bonus() [effects.c::831]: assertion 'pplayer != ((void *)0) && punittype != ((void *)0)' failed.
1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_unittype_bonus() [effects.c::831]: assertion 'pplayer != ((void *)0) && punittype != ((void *)0)' failed.
1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_unittype_bonus() [effects.c::831]: assertion 'pplayer != ((void *)0) && punittype != ((void *)0)' failed.
1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_unittype_bonus() [effects.c::831]: assertion 'pplayer != ((void *)0) && punittype != ((void *)0)' failed.
1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_building_bonus() [effects.c::804]: assertion '((void *)0) != pcity && ((void *)0) != building' failed.
1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_building_bonus() [effects.c::804]: assertion '((void *)0) != pcity && ((void *)0) != building' failed.
1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_building_bonus() [effects.c::804]: assertion '((void *)0) != pcity && ((void *)0) != building' failed.
1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_building_bonus() [effects.c::804]: assertion '((void *)0) != pcity && ((void *)0) != building' failed.
1: Please report this message at https://www.hostedredmine.com/projects/freeciv
1: in get_building_bonus() [effects.c::804]: assertion '((void *)0) != pcity && ((void *)0) != building' failed.

Bit I WILL get a reproduction case. Watch this space...

#3 Updated by Chippo Elder over 2 years ago

Load the attached savegame (3.0.92-dev (22cfc27434)) in the qt client (to my surprise this didn't work in the gtk client). Go to the Cities tab. Right-click on Budapest and change the Governor to 'Prefer production'. Your console will now be covered in these (and other) assertion failures.

#4 Updated by Jacob Nevins over 2 years ago

These assertion failures do NOT cause a core dump.

Not by default, but if you see the bottom of my link you'll see there's a -F option to make them do so.

Load the attached savegame [...]

Reproduced (with the Gtk3.22 client, as it happens), but I haven't looked into it further.

#5 Updated by Chippo Elder over 2 years ago

Jacob Nevins wrote:

but if you see the bottom of my link you'll see there's a -F option to make them do so.

Oops. If you guys have nic-name for me yet, I bet that it's got RTFM in it.

In that link it encourages a 'bt full'. The history buffer in my terminal is set to 3000 lines and that's not enough for bt full. But here's a normal 'bt':

(gdb) bt
#0 raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x000055a55e229aaa in fc_assert_fail
(file=file@entry=0x55a55e281196 "effects.c", function=function@entry=0x55a55e287440 <__FUNCTION__.28254> "get_building_bonus", line=line@entry=804, assertion=assertion@entry=0x55a55e287328 "((void )0) != pcity && ((void *)0) != building", message=0x55a55e2a89b2 "nologmsg:%s") at log.c:568
#2 0x000055a55e17034b in get_building_bonus (pcity=pcity@entry=0x0, building=building@entry=0x55a55e37a470 <improvement_types+2000>, effect_type=effect_type@entry=EFT_IMPR_BUILD_COST_PCT)
at effects.c:804
#3 0x000055a55e1785a5 in impr_build_shield_cost (pcity=pcity@entry=0x0, pimprove=pimprove@entry=0x55a55e37a470 <improvement_types+2000>) at improvement.c:252
#4 0x000055a55dfd6d33 in name_and_sort_items
(targets=targets@entry=0x7ffe5bd36440, num_targets=num_targets@entry=6, items=items@entry=0x7ffe5bd38060, show_cost=show_cost@entry=true, pcity=pcity@entry=0x0) at climisc.c:653
#5 0x000055a55e059aca in city_widget::gen_production_labels(city_widget::menu_labels, QMap<QString, int>&, bool, bool, bool (
)(city const*, universal const*), bool)
(this=<optimized out>, what=<optimized out>, list=..., append_units=<optimized out>, append_wonders=<optimized out>, test_func=<optimized out>, global=false) at cityrep.cpp:1050
#6 0x000055a55e05a201 in city_widget::fill_production_menus(city_widget::menu_labels, QMap<QString, int>&, bool ()(city const, universal const*), QMenu*)
(this=0x7f5e6c002af0, what=city_widget::CHANGE_PROD_NOW, custom_labels=..., test_func=0x55a55e169060 <can_city_build_now>, menu=<optimized out>) at cityrep.cpp:721
#7 0x000055a55e05ccc7 in city_widget::display_list_menu(QPoint const&) (this=0x7f5e6c002af0) at cityrep.cpp:510
#8 0x00007f5e884725c8 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9 0x00007f5e87cbaf99 in QWidget::customContextMenuRequested(QPoint const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007f5e87cd5cfe in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007f5e87d82782 in QFrame::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007f5e87f067d2 in QAbstractItemView::viewportEvent(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007f5e87f7498f in QTreeView::viewportEvent(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007f5e884467ab in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007f5e87c92a75 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007f5e87c9cc6b in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#17 0x00007f5e88446a9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#18 0x00007f5e87cf173a in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007f5e87cf3fdc in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007f5e87c92a86 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007f5e87c9be00 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f5e88446a9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00007f5e8882ed73 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#24 0x00007f5e888305fb in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#25 0x00007f5e8880a26b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#26 0x00007f5e8066228e in () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#27 0x00007f5e842ae84d in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007f5e842aead0 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007f5e842aeb73 in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007f5e8849e6a5 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00007f5e8844563b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#32 0x00007f5e8844d3a6 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#33 0x000055a55e07bcd1 in fc_client::fc_main(QApplication*) (this=0x55a55fbf3e60, qapp=0x55a55f8939e0) at fc_client.cpp:257
#34 0x000055a55dfd11c3 in qtg_ui_main(int, char**) (argc=<optimized out>, argv=<optimized out>) at gui_main.cpp:177
#35 0x000055a55dfd2f7e in client_main (argc=1, argv=0x7ffe5bd450b8) at client_main.c:685
#36 0x00007f5e875e21e3 in __libc_start_main (main=
0x55a55dfce7f0 <main(int, char**)>, argc=2, argv=0x7ffe5bd450b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe5bd450a8) at ../csu/libc-start.c:308
#37 0x000055a55dfd028e in _start () at gui_main.cpp:100

This is for version 3.0.92-dev (22cfc27434), gui-qt client.

#6 Updated by Marko Lindqvist over 2 years ago

The assert in the subject line is not the same as one in the backtrace. They are likely two separate bugs.

#7 Updated by Marko Lindqvist over 2 years ago

Attached patch should fix the issue seen in the backtrace. Since backtrace is here, reserving this ticket for it. For the issue in subject we may open a new ticket.

#8 Updated by Marko Lindqvist over 2 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF