Project

General

Profile

Bug #693241

Cairo assert when attempting to use select box with right click in 2.6 GTK3 29c84a15cb

Added by Griffon Spade 3 months ago. Updated 2 months ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
gui-gtk-3
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Microsoft Visual C++ Runtime Library
Assertion failed!

Program: ...
File: cairo-win32-surface.cairo-win32-surface.c
Line: 1485

Expression: !"reached".


Related issues

Blocks Freeciv - Task #664196: Release 2.6.0-beta1Closed

History

#1 Updated by Jacob Nevins 3 months ago

There should hopefully be a freeciv-gtk3.RPT file containing a detailed stack backtrace. Can you fish that out and attach it?

For me it appears in the same directory the Freeciv executables are in.

#2 Updated by Griffon Spade 3 months ago

Yeah. I have it now. When I checked the file, I saw a report from the 15th at the top, apparently appended to the bottom.


Error occurred on Saturday, August 26, 2017 at 12:14:23.

freeciv-gtk3.exe caused a Breakpoint at location 76FB67C4 in module msvcrt.dll.

Registers:
eax=00000004 ebx=00000000 ecx=00000558 edx=00000557 esi=0000021c edi=00000054
eip=76fb67c4 esp=0028d2d8 ebp=0028d618 iopl=0 nv up ei pl zr na po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00200246

AddrPC Params
76FB67C4 68E5E490 68E5E47A 000005CD msvcrt.dll!_assert
68E2A4B3 00000017 0000FFFF FF000000 libcairo-2.dll!categorize_solid_dest_operator
68E2A516 0BCB39C0 00000017 0028EA00 libcairo-2.dll!_cairo_win32_surface_fill_rectangles
68E0839E 0BCB39C0 00000017 0028EA00 libcairo-2.dll!_cairo_surface_fill_rectangles
68E0B0A3 0BCB39C0 00000017 0028E9A0 libcairo-2.dll!_fill_rectangles
68E0B327 0028E9A0 00000017 0BCB39C0 libcairo-2.dll!_clip_and_composite_trapezoids
68E0BDB1 0BCB39C0 00000017 0028E9A0 libcairo-2.dll!_cairo_surface_fallback_stroke
68E08AFD 0BCB39C0 00000017 0028E9A0 libcairo-2.dll!_cairo_surface_stroke
68E0D6D5 0BCB39C0 FFFFFFF6 FFFFFFD4 libcairo-2.dll!_cairo_surface_offset_stroke
68E0E5DA 0B500248 00000017 0028EE80 libcairo-2.dll!_cairo_surface_subsurface_stroke
68E08AAA 0B500248 00000017 0028EE80 libcairo-2.dll!_cairo_surface_stroke
68DD9AF6 0BC245E8 0BC2489C C0820000 libcairo-2.dll!_cairo_gstate_stroke
68DD01A2 0BC245C8 406D0000 00000000 libcairo-2.dll!cairo_stroke_preserve
68DD016A 0BC245C8 00000000 40664000 libcairo-2.dll!cairo_stroke
0040D60E 0028F058 0028F05C 00000000 freeciv-gtk3.exe!draw_selection_rectangle [C:/freeciv/msys1/gnuwin32-2017-07-30/home/cazfi/freeciv/S2_6/win32/installer/build-gtk3/client/gui-gtk-3.0/../../../../../client/gui-gtk-3.0/mapview.c 718]
0051D8DF 000000B2 000000E8 00000240 freeciv-gtk3.exe!map_distance_vector [C:/freeciv/msys1/gnuwin32-2017-07-30/home/cazfi/freeciv/S2_6/win32/installer/build-gtk3/common/../../../../common/map.c
1060]
00457373 43320000 43680000 685F8C02 freeciv-gtk3.exe!update_selection_rectangle [C:/freeciv/msys1/gnuwin32-2017-07-30/home/cazfi/freeciv/S2_6/win32/installer/build-gtk3/client/../../../../client/mapctrl_common.c 269]
0040BF82 059380E8 0028F298 045102B8 freeciv-gtk3.exe!move_mapcanvas [C:/freeciv/msys1/gnuwin32-2017-07-30/home/cazfi/freeciv/S2_6/win32/installer/build-gtk3/client/gui-gtk-3.0/../../../../../client/gui-gtk-3.0/mapctrl.c
423]
63A467C6 059380E8 0028F298 045102B8 libgobject-2.0-0.dll!_g_closure_invoke_va
63A5CA64 045102B8 0000002D 00000000 libgobject-2.0-0.dll!g_signal_emit_valist
63A5D43B 045102B8 0000002D 00000000 libgobject-2.0-0.dll!g_signal_emit
666C87E9 045102B8 05886B60 00000004 libgtk-3-0.dll!gtk_widget_event_internal
666C7F01 045102B8 05886B60 0028F468 libgtk-3-0.dll!gtk_widget_event
6655F2DE 045102B8 05886B60 00000000 libgtk-3-0.dll!propagate_event_up
6655F5D7 045102B8 05886B60 00000000 libgtk-3-0.dll!propagate_event
6655F69A 045102B8 05886B60 00000000 libgtk-3-0.dll!gtk_propagate_event
6655E3B9 05886B60 00000000 05886B60 libgtk-3-0.dll!gtk_main_do_event
014FB5EE 05886B60 03072630 0028F5C8 libgdk-3-0.dll!_gdk_event_emit
014FA127 03066020 030726F0 FFFFFFFF libgdk-3-0.dll!_gdk_display_flush_events
0151664C 03068160 030680B0 0028F628 libgdk-3-0.dll!gdk_window_flush_events
63A48A93 044765D0 00000000 03068160 libgobject-2.0-0.dll!g_cclosure_marshal_VOID__VOIDv
63A467C6 044765D0 00000000 03068160 libgobject-2.0-0.dll!_g_closure_invoke_va
63A5CA64 03068160 00000089 00000000 libgobject-2.0-0.dll!g_signal_emit_valist
63A5D513 03068160 01542D32 0028F928 libgobject-2.0-0.dll!g_signal_emit_by_name
015015A3 03068160 6863F729 0028F958 libgdk-3-0.dll!gdk_frame_clock_flush_idle
014F1835 0860BF50 0593D3E8 0028F988 libgdk-3-0.dll!gdk_threads_dispatch
685FB2ED 03136218 014F17FC 0860BF50 libglib-2.0-0.dll!g_timeout_dispatch
685F9630 030EE028 00000000 00000003 libglib-2.0-0.dll!g_main_dispatch
685FA214 030EE028 00000001 0855BB98 libglib-2.0-0.dll!g_main_context_dispatch
685FA3EF 030EE028 00000001 00000001 libglib-2.0-0.dll!g_main_context_iterate
685FA7DE 084E9A98 084E9A98 00402460 libglib-2.0-0.dll!g_main_loop_run
6655DA49 000003E8 00402460 00000000 libgtk-3-0.dll!gtk_main
004058BD 0028FB8C 76F5ADE8 017F0000 freeciv-gtk3.exe!ui_main [C:/freeciv/msys1/gnuwin32-2017-07-30/home/cazfi/freeciv/S2_6/win32/installer/build-gtk3/client/gui-gtk-3.0/../../../../../client/gui-gtk-3.0/gui_main.c @ 1840]
76F5ADF9 017F0000 00000008 76F5ADF9 msvcrt.dll!towlower
76F5ADE8 00000074 00000001 0028FBA4 msvcrt.dll!towlower
76F5C470 00000074 00000001 04468268 msvcrt.dll!calloc

freeciv-gtk3.exe
ntdll.dll 6.1.7601.18798
kernel32.dll 6.1.7601.18798
KERNELBASE.dll 6.1.7601.18798
ADVAPI32.DLL 6.1.7601.18247
msvcrt.dll 7.0.7601.17744
sechost.dll 6.1.7600.16385
RPCRT4.dll 6.1.7601.18532
SspiCli.dll 6.1.7601.18812
CRYPTBASE.dll 6.1.7600.16385
libbz2-2.dll
libgcc_s_dw2-1.dll
libcairo-2.dll
libfontconfig-1.dll
libfreetype-6.dll
zlib1.dll 1.2.8.0
libxml2-2.dll
libiconv-2.dll 1.13.1.0
liblzma-5.dll 5.0.7.0
WS2_32.DLL 6.1.7601.17514
NSI.dll 6.1.7600.16385
libpixman-1-0.dll
libpng15-15.dll
GDI32.dll 6.1.7601.18778
USER32.dll 6.1.7601.17514
LPK.dll 6.1.7601.18768
USP10.dll 1.626.7601.18454
MSIMG32.DLL 6.1.7600.16385
libcurl.dll 7.40.0.0
WINMM.DLL 6.1.7601.17514
wldap32.dll 6.1.7601.17514
libidn-11.dll
LIBEAY32.dll 1.0.2.8
SSLEAY32.dll 1.0.2.8
libgdk-3-0.dll 3.8.2.0
libcairo-gobject-2.dll
libglib-2.0-0.dll 2.36.1.0
libintl-8.dll 0.18.2.0
pthreadGC2.dll 2.8.0.0
WSOCK32.DLL 6.1.7600.16385
OLE32.dll 6.1.7601.17514
SHELL32.DLL 6.1.7601.18762
SHLWAPI.dll 6.1.7601.17514
libgobject-2.0-0.dll 2.36.1.0
libffi-6.dll
libgdk_pixbuf-2.0-0.dll 2.28.1.0
libgio-2.0-0.dll 2.36.1.0
libgmodule-2.0-0.dll 2.36.1.0
DNSAPI.DLL 6.1.7601.17570
gdiplus.dll 6.1.7601.18455
libpango-1.0-0.dll 1.32.6.0
libpangocairo-1.0-0.dll 1.32.6.0
libpangowin32-1.0-0.dll 1.32.6.0
IMM32.DLL 6.1.7601.17514
MSCTF.dll 6.1.7601.18731
libgtk-3-0.dll 3.8.2.0
libatk-1.0-0.dll 2.8.0.0
COMCTL32.DLL 5.82.7601.18201
COMDLG32.DLL 6.1.7601.17514
WINSPOOL.DRV 6.1.7601.17514
libMagickWand-6.Q16-1.dll
libMagickCore-6.Q16-1.dll
freetype6.dll
libpng14-14.dll
libpthread-2.dll 2.8.0.0
SDL2.dll 2.0.4.0
OLEAUT32.dll 6.1.7601.18679
VERSION.dll 6.1.7600.16385
SDL2_mixer.dll 2.0.1.0
exchndl.dll 0.8.1.0
mgwhelp.dll 0.8.1.0
dbghelp.dll 6.1.7601.17514
PSAPI.DLL 6.1.7600.16385
comctl32.dll 6.10.7601.18807
SETUPAPI.dll 6.1.7601.17514
CFGMGR32.dll 6.1.7601.17621
DEVOBJ.dll 6.1.7601.17621
CLBCatQ.DLL 2001.12.8530.16385
propsys.dll 7.0.7601.17514
ntmarta.dll 6.1.7600.16385
XAudio2_7.dll 9.29.1962.0
MMDevApi.dll 6.1.7601.17514
AUDIOSES.DLL 6.1.7601.18741
avrt.dll 6.1.7600.16385
wdmaud.drv 6.1.7601.17514
ksuser.dll 6.1.7600.16385
msacm32.drv 6.1.7600.16385
MSACM32.dll 6.1.7600.16385
midimap.dll 6.1.7600.16385
uxtheme.dll 6.1.7600.16385
profapi.dll 6.1.7600.16385
winhttp.dll 6.1.7601.17514
webio.dll 6.1.7601.17725
credssp.dll 6.1.7601.18812
mscms.dll 6.1.7601.17514
USERENV.dll 6.1.7601.17514
icm32.dll 6.1.7600.16385
OpenText32.dll
OLEACC.dll 7.0.0.0
mswsock.dll 6.1.7601.18254
WLIDNSP.DLL 7.250.4225.0
mdnsNSP.dll 3.0.0.10
Iphlpapi.DLL 6.1.7601.17514
WINNSI.DLL 6.1.7600.16385
fwpuclnt.dll 6.1.7601.18283
rasadhlp.dll 6.1.7600.16385
wship6.dll 6.1.7600.16385
wshtcpip.dll 6.1.7600.16385
apphelp.dll 6.1.7601.18777

Windows 6.1.7601
DrMingw 0.8.1

#3 Updated by Jacob Nevins 3 months ago

  • Subject changed from Fatal Error when attempting to use select box with right click in 2.6 GTK3 29c84a15cb to Cairo assert when attempting to use select box with right click in 2.6 GTK3 29c84a15cb
  • Priority changed from Normal to High

I've reproduced this by running the msys1 29c84a15cb under Wine (haven't tried real Windows). (I infer from the Git commit ID that you must have been using an msys1 build.)

The relevant action is right-click drag on the map while not editing. For me any attempt to right-drag reproduces this every time. I can also reproduce it with the 2.5.9 msys1 gtk3 build.

This is quite a serious bug, as Gtk3 msys1 is supposed to be our default Windows client in 2.6, and right-clicking is quite a common action.

I don't get any trouble futzing around with this action on my Linux Gtk3, but since it's a Windows-specific assertion that might not be a surprise.

Is this the msys1 package? (From the Git commit ID I infer it probably is.)

The assertion seems to be an "unsupported primitive" sort of failure (NB I haven't taken care that that's the exact right version of the Cairo source code, it just has about the right shape).

I guess this is something about the rather elderly Cairo we ship in msys1 packages. And indeed I can't reproduce it on an msys2 build (2.6 gtk3 c8cad4d8dd).

The Gtk3 selection rectangle uses a dashed line. So I wondered if trade route drawing (which also uses a dashed line) works in the failing build... it does. Huh.

#4 Updated by Jacob Nevins 3 months ago

Oh, it's probably the use of CAIRO_OPERATOR_DIFFERENCE in draw_selection_rectangle(). This is the only use of that identifier in Freeciv, and in at least some versions of Cairo old enough to give that assertion failure, CAIRO_OPERATOR_DIFFERENCE will trigger it.

CAIRO_OPERATOR_XOR looks like it might be supported? (Again, with the caveat that I haven't tracked down the exact version of Cairo we're using.) However, trying that on Linux doesn't give obviously the right answer.

If we're going to bodge this for our ancient msys1 Cairo until we move to msys2, should we conditionalise it on something like the Gtk3 version or whether we're building in MSYS1 or something?

#5 Updated by Jacob Nevins 3 months ago

However, trying that on Linux doesn't give obviously the right answer.

By which I mean simply replacing one identifier with the other without thinking at all about the consequences. Maybe it can be made to do something useful.

#6 Updated by Marko Lindqvist 3 months ago

Jacob Nevins wrote:

If we're going to bodge this for our ancient msys1 Cairo until we move to msys2, should we conditionalise it on something like the Gtk3 version or whether we're building in MSYS1 or something?

cairo_version() for runtime check:
https://www.cairographics.org/manual-1.0.2/cairo-Version-Information.html

And here's a clue which version of cairo got the fix:
https://lists.cairographics.org/archives/cairo/2011-June/022065.html

#7 Updated by Marko Lindqvist 3 months ago

Untested patch attached.

Even if this one gets accepted, it would be a good idea to evaluate the possibility of updating cairo in msys1 environment.

#8 Updated by Marko Lindqvist 3 months ago

Marko Lindqvist wrote:

Untested patch

It avoids the crash, so confirms that the problem is CAIRO_OPERATOR_DIFFERENCE. Otherwise doesn't work too nicely (won't be enough to close this ticket), but good enough to clear "beta1 blocker" status?

#9 Updated by Marko Lindqvist 3 months ago

  • Target version changed from 2.6.0-beta1 to 2.5.10

Jacob Nevins wrote:

If we're going to bodge this for our ancient msys1 Cairo until we move to msys2, should we conditionalise it on something like the Gtk3 version or whether we're building in MSYS1 or something?

cairo_version() for runtime check:
https://www.cairographics.org/manual-1.0.2/cairo-Version-Information.html

And here's a clue which version of cairo got the fix:
https://lists.cairographics.org/archives/cairo/2011-June/022065.html

#10 Updated by Marko Lindqvist 3 months ago

#14 Updated by Christian Prochaska 2 months ago

  • Status changed from Resolved to Closed

#15 Updated by Jacob Nevins 2 months ago

I confirm that a S2_6 build containing both changes made under this ticket under Wine does not show this crash, and the selection rectangle is drawn correctly.

Also available in: Atom PDF