PCBnew crashes on toggling drawing mode - Sketch Tracks

Bug #1774715 reported by Miljan Pakovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Invalid
Critical
Unassigned

Bug Description

While running PCBnew as standalone application with relatively high complexity board opened / CIAA-ACC (HPC) Project, for instance/ Toggling Sketch Tracks drawing mode on/off causes PCBnew to crash.

Application: pcbnew
Version: (5.0.0-rc2-58-gfc71fc647), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.60.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.54.1
    Compiler: GCC 7.1.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Miljan Pakovic (offrider) wrote :

BTW, just to mention, this is happening only in Accelerated Toolset mode.

Revision history for this message
Seth Hillbrand (sethh) wrote :

Hi Miljan-

I've been trying without success to recreate this issue on Linux and Mac.

I see you are running Windows. Maybe one of our Windows devs will have better luck seeing this issue.

In the meantime, can you post your graphics card and Open GL information for us?

Thanks!

Changed in kicad:
importance: Undecided → Critical
milestone: none → 5.0.0-rc3
tags: added: pcb windows
tags: added: gal pcbnew
removed: pcb
Revision history for this message
Miljan Pakovic (offrider) wrote :
Download full text (4.5 KiB)

Hi Seth,

Here are additional information you've requested.

Renderer: Intel(R) HD Graphics 4000
Adapter Memory: 2112 MB
OpenGL Version: 4.0.0 - Driver Build 10.18.10.4358

I have also run pcbnew under the gdb (if of any good since it's release build).

(gdb) info thread
  Id Target Id Frame
* 1 Thread 11784.0x9b4 0x00007ffb282f2cbd in ig7icd64!RegisterProcTableCallback () from C:\WINDOWS\SYSTEM32\ig7icd64.dll
  2 Thread 11784.0x2604 0x00007ffb6bedd8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  3 Thread 11784.0x1898 0x00007ffb6bedd8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  4 Thread 11784.0x174 0x00007ffb6bedd8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  5 Thread 11784.0x14e0 0x00007ffb6bedd8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  6 Thread 11784.0x2190 0x00007ffb6bedd8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  7 Thread 11784.0x2c14 0x00007ffb6bedaae4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
  8 Thread 11784.0x7c4 0x00007ffb6bedaae4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
  9 Thread 11784.0x207c 0x00007ffb6bedaae4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
  10 Thread 11784.0x22b0 0x00007ffb6beda0b4 in ntdll!ZwRemoveIoCompletion () from C:\WINDOWS\SYSTEM32\ntdll.dll
  11 Thread 11784.0x12e8 0x00007ffb6bedd8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  12 Thread 11784.0x28ac 0x00007ffb6bedd8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll

(gdb) bt
#0 0x00007ffb282f2cbd in ig7icd64!RegisterProcTableCallback () from C:\WINDOWS\SYSTEM32\ig7icd64.dll
#1 0x00007ffb283458bb in ig7icd64!RegisterProcTableCallback () from C:\WINDOWS\SYSTEM32\ig7icd64.dll
#2 0x000000006df1a44c in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#3 0x000000006df20e52 in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#4 0x000000006df20fae in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#5 0x000000006df0c214 in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#6 0x000000006df06746 in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#7 0x000000006df077c6 in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#8 0x000000006dcf0c29 in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#9 0x000000006dcf559e in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#10 0x000000006de81da7 in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#11 0x000000006de85880 in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#12 0x000000006de8592a in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#13 0x000000006def1eaa in ?? () from C:\Program Files\KiCad\bin\_pcbnew.kiface
#14 0x0000000067ac2ec4 in ?? () from C:\Program Files\KiCad\bin\wxbase30u_gcc_custom.dll
#15 0x0000000067c29502 in ?? () from C:\Program Files\KiCad\bin\wxbase30u_gcc_custom.dll
#16 0x0000000067c2990d in ?? () from C:\Program Files\KiCad\bin\wxbase30u_gcc_custom.dll
#17 0x000000006...

Read more...

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I could not get this to crash on either 32 bit or 64 bit builds on windows 10. I'm using the nvidia graphics drivers so this may be graphics driver issue. Maybe one of our other devs has a windows system with intel 4000 graphics and can check to see if they can get KiCad to crash.

Application: pcbnew
Version: (5.0.0-rc2-66-g0a91f0bc9), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.59.0 OpenSSL/1.0.2o (WinSSL) zlib/1.2.11 brotli/1.0.4 libidn2/2.0.5 nghttp2/1.31.1
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.66.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.59.0
    Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=OFF
    KICAD_SCRIPTING_MODULES=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Jeff Young (jeyjey) wrote :

@Miljan, yeah that stack trace is missing most of the useful bits. ;)

Since we're having trouble reproducing it, if you have a chance to run it under a debug build that would be great....

Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

Hi Jeff,

It looks like the crash occurs in the Intel graphics card driver. Do you have the latest version?

Tom

Revision history for this message
Miljan Pakovic (offrider) wrote :

Hi guys,

It might be up to the driver, we'll see. I am building the debug version currently. I hope compilation should end in an hour.
I'll come back with the results.

Thanks to all!

Revision history for this message
Miljan Pakovic (offrider) wrote :
Download full text (6.3 KiB)

Hi,

Here is the backtrace log from debug application crash:

(gdb) info thread
  Id Target Id Frame
* 1 Thread 11056.0x2b44 0x00007ffdebdb2663 in ig7icd64!RegisterProcTableCallback () from C:\WINDOWS\SYSTEM32\ig7icd64.dll
  2 Thread 11056.0x8b0 0x00007ffe25fed8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  3 Thread 11056.0x314 0x00007ffe25fed8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  4 Thread 11056.0x1e20 0x00007ffe25fed8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  5 Thread 11056.0xc20 0x00007ffe25fed8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  6 Thread 11056.0x2704 0x00007ffe25fed8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  7 Thread 11056.0x1530 0x00007ffe25feaae4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
  8 Thread 11056.0xb38 0x00007ffe25feaae4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
  9 Thread 11056.0x2f48 0x00007ffe25feaae4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll
  10 Thread 11056.0x1570 0x00007ffe25fea0b4 in ntdll!ZwRemoveIoCompletion () from C:\WINDOWS\SYSTEM32\ntdll.dll
  11 Thread 11056.0x199c 0x00007ffe25fed8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll
  12 Thread 11056.0x1870 0x00007ffe25fed8e4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:\WINDOWS\SYSTEM32\ntdll.dll

  (gdb) bt
#0 0x00007ffdebdb2663 in ig7icd64!RegisterProcTableCallback () from C:\WINDOWS\SYSTEM32\ig7icd64.dll
#1 0x00007ffdebe0541b in ig7icd64!RegisterProcTableCallback () from C:\WINDOWS\SYSTEM32\ig7icd64.dll
#2 0x00000000073c30d9 in KIGFX::CACHED_CONTAINER_GPU::defragmentResize (this=0x6044bad0, aNewSize=16777216)
    at D:/msys64/home/AriLap/kicad/common/gal/opengl/cached_container_gpu.cpp:136
#3 0x00000000073c87f2 in KIGFX::CACHED_CONTAINER::reallocate (this=0x6044bad0, aSize=15)
    at D:/msys64/home/AriLap/kicad/common/gal/opengl/cached_container.cpp:233
#4 0x00000000073c8495 in KIGFX::CACHED_CONTAINER::Allocate (this=0x6044bad0, aSize=3)
    at D:/msys64/home/AriLap/kicad/common/gal/opengl/cached_container.cpp:119
#5 0x00000000073b9e8c in KIGFX::VERTEX_MANAGER::Reserve (this=0x60458f30, aSize=3)
    at D:/msys64/home/AriLap/kicad/common/gal/opengl/vertex_manager.cpp:71
#6 0x00000000073b6060 in KIGFX::OPENGL_GAL::drawStrokedSemiCircle ( this=0x60527410, aCenterPoint=..., aRadius=44450, aAngle=1.5707963267948966)
    at D:/msys64/home/AriLap/kicad/common/gal/opengl/opengl_gal.cpp:1493
#7 0x00000000073b18a4 in KIGFX::OPENGL_GAL::DrawSegment (this=0x60527410, aStartPoint=..., aEndPoint=..., aWidth=88900)
    at D:/msys64/home/AriLap/kicad/common/gal/opengl/opengl_gal.cpp:460
#8 0x0000000007227f9b in KIGFX::PCB_PAINTER::draw (this=0x603cdc70, aTrack= 0x5e829590, aLayer=7)
    at D:/msys64/home/AriLap/kicad/pcbnew/pcb_painter.cpp:408
#9 0x00000000072279a4 in KIGFX::PCB_PAINTER::Draw (this=0x603cdc70, aItem= 0x5e829590, aLayer=7)
    at D:/msys64/home/AriLap/kicad/pcbnew/pcb_painter.cpp:290
#10 0...

Read more...

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Miljan,

Many thanks for the detailed report. For the record: I have no issues toggling tracks outline mode using Intel HD4600 under Windows 7. I have tested it with c4puter project [1], let me know if this project is complex enough to trigger the crash in your case.

Have you tried updating the video driver? In any case, could you try the attached patch?

1. https://github.com/c4puter/motherboard

Revision history for this message
Miljan Pakovic (offrider) wrote :

Hi Orson,

I'm at work currently so I can not try your patch right away.
I'll certainly do it later afternoon when I get back home.

Regarding your question about video driver. Yes, I had updated drivers (and BIOS as well) yesterday almost right after Seth made his guess that driver might be an issue here.
Also I did some more investigation on this matter.
The thing is that I have dual video adapter on my laptop. Integrated Intel HD4000 plus Ati Radeon 7670m. At first I thought I could disable integrated adapter and leave the heavy lift to Ati, but soon I found it is impossible. Things work differently here. Operating system decide which adapter should be active based on the user power/performance profile settings.
So before I played with this settings the Pcbnew was running under the power saving profile settings.
Meaning that Intel HD4000 was in play. This setup was not enough to run Pcbnew with the demanding operations. So it has probable cause resource deficiency (memory or what ever else) and resulted with application crash.
Later on I have change the profile in Ati Catalyst center, setting up the Pcbnew to the high performance profile (probably resulting in activating Ati adapter for rendering). And the issue vanished.
Even though, I think that we have hit the corner case here with OpenGL canvas which need to be addressed.
It seems to me that your proposed patch is targeting in that direction.
I'll come back as soon as I get some results.

Thank you,
Miljan

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Miljan,

The patch I have attached is only based on a wild guess that the Intel driver may have problems using one of the buffers in a glCopyBufferSubData() call. I am afraid the real issue here is the lack of video memory, as you have also suspected. In such case the only proper solution is a serious optimization of the rendering engine, but even once it is done - the limit is still set by the video card capabilities.

Revision history for this message
Miljan Pakovic (offrider) wrote :

Hi Orson,

I've tried your patch.
Unfortunately, application crashed the same way as before.
Your exception trow didn't happen ("No valid GL buffer to be used as a copy destination").

I think that this issue for now should be closed as Won't Fix. All findings are indicating to some sort of a driver issue in this case.

For now I have chosen my graphic card preferences for Pcbnew to High Performance settings which allows me normal operation without crashing.

Thank again to everyone involved in making KiCAD a great EDA tool!

Cheers!
Miljan

Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

Looks like an out-of-memory issue in the graphics card, not a KiCad one.

Changed in kicad:
status: New → Incomplete
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.