C-PCB icon indicating copy to clipboard operation
C-PCB copied to clipboard

Thread 1 "view" received signal SIGSEGV, Segmentation fault.

Open celem opened this issue 6 years ago • 7 comments

Compiles without error BUT view gives a SIGSEGV Segmentation fault. The "PCB Viewer" window opens (blank) and then there is the SIGSEGV.

Below is a gdb backtrace of the problem. Any ideas?

ecomer@asrock C-PCB]$ cat /proc/version
Linux version 4.14.34-1-MANJARO (builduser@development) (gcc version 7.3.1 20180312 (GCC)) #1 SMP PREEMPT Thu Apr 12 17:26:43 UTC 2018
[ecomer@asrock C-PCB]$ ./dsn2pcb test1.dsn | ./pcb --v 1 --z 8 --q 10 --r 2 >x
Number of terminals: 204
Number of Nets: 55
Number of Vias: 51
Number of terminals: 204
Number of Nets: 55
Number of Vias: 51
[ecomer@asrock C-PCB]$ gdb ./view
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./view...done.
(gdb) r x
Starting program: /home/ecomer/src/C-PCB/view x
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffea1c9700 (LWP 910)]
[New Thread 0x7fffe918a700 (LWP 911)]
[New Thread 0x7fffe8989700 (LWP 912)]
[New Thread 0x7fffdbfff700 (LWP 913)]
[New Thread 0x7fffdb7fe700 (LWP 914)]

Thread 1 "view" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x000055555555755d in main (argc=2, argv=0x7fffffffdff8) at view.cpp:452
(gdb) 

celem avatar Apr 18 '18 18:04 celem

Hi Celem,

Well line view.cpp:452 is glGenVertexArrays(1, &vertex_array);

Which doesn't give us a huge help. Certainly nothing obviously wrong there. What I will do shortly, probably tomorrow now, is fire up my Ubuntu VM 16.04 and do some tests. I do tend to run it on the Mac most of the time, so let me give the Ubuntu version a trashing.

Does it die if you pipe the output direct to view without going to a file first ?

./dsn2pcb test1.dsn | ./pcb --v 1 --z 8 --q 10 --r 2 | ./view

Chris

vygr avatar Apr 18 '18 21:04 vygr

I just gave the Mac version a spin with:

./dsn2pcb test1.dsn | ./pcb --v 1 --z 8 --q 10 --r 2 | ./view

And all's fine there. I'll set my Ubuntu VM up tomorrow and check that.

Chris

vygr avatar Apr 18 '18 21:04 vygr

Yes, it dies if I pipe it. I used an intermediate file to help identify where it failed (view) and then limited execution further to just the failing portion.

Ed

FYI - the arch package glfw-x11-git 3.2.1.r561.g23dfeee4-1 provides: /usr/include/GLFW/glfw3.h /usr/include/GLFW/glfw3native.h /usr/lib/cmake/glfw3/glfw3Config.cmake /usr/lib/cmake/glfw3/glfw3ConfigVersion.cmake /usr/lib/cmake/glfw3/glfw3Targets-noconfig.cmake /usr/lib/cmake/glfw3/glfw3Targets.cmake /usr/lib/libglfw.so /usr/lib/libglfw.so.3 /usr/lib/libglfw.so.3.3 /usr/lib/pkgconfig/glfw3.pc /usr/share/licenses/glfw-x11-git/LICENSE

The arch glew 2.1.0-1 package provides" /usr/bin/glewinfo /usr/bin/visualinfo /usr/include/GL/glew.h /usr/include/GL/glxew.h /usr/include/GL/wglew.h /usr/lib/libGLEW.so /usr/lib/libGLEW.so.2.1 /usr/lib/libGLEW.so.2.1.0 /usr/lib/pkgconfig/glew.pc /usr/share/licenses/glew/LICENSE

There is an older glew package - glew1.10 1.10.0-1

celem avatar Apr 19 '18 01:04 celem

Built and got the SEGFAULT on Ubuntu under Virtualbox VM.

I added the patches as detailed in #3 and things then worked.

extra lib of 'glew'

glewExperimental = GL_TRUE; glewInit();

As shown in #3 .

I wasn't targeting Linux for this project, but I'm planning on moving over to SDL rather than glfw3 as I'm not happy with glfw3. That should hopefully get things fixed on Linux as my other ChrysaLisp project uses SDL and that works fine across Mac/Linux.

Chris

vygr avatar Apr 21 '18 10:04 vygr

vygr - thanks. I finally got C-PCB working on Manjaro/Arch Linux once I placed the patch in the correct place. I couldn't get a good compile on Linux Mint 18.3. It works very well on Manjaro. Question - It autoroutes the DSN files and displays them BUT is there a was to export the routed board to a SES file? Maybe it's there and I'm just missing it??

celem avatar Apr 22 '18 02:04 celem

Sorry not yet. It's still a Work in Progress, needs more love yet :)

Chris

vygr avatar Apr 22 '18 14:04 vygr

vygr, My interest stems from the pcb-rnd EDA project. Pcb-rnd was forked from the gEDA/PCB project. gEDA/PCB is fairly dormant and pcb-rnd was spawned to add features. Lately pcb-rnd has moved at a much accelerated pace. While it retains the basic autorourer that it inherited from gEDA/PCB it can also work with Freerouting via DSN export/SES Import, which is also supported by KiCad. KiCad is a monolithic approach to EDA design while pcb-rnd is more along the Unix/Linux toolbox lines. Your C-PCB project looks like a natural to join the pcb-rnd toolchest. Please take a look at the pcb-rnd project. The IRC channel #pcb-rnd is very active. The project lead is igor2 (Tibor Palinkas) and there are 7 other primary contributors and several non-prime (i.e., testers) contributors, like me.

celem avatar Apr 22 '18 16:04 celem