necpp icon indicating copy to clipboard operation
necpp copied to clipboard

NEC constantly crashing on connect_segments

Open kaklik opened this issue 8 years ago • 2 comments

I am using PyNEC python wrapper and my python code usually crashes on "Segmentation fault (core dumped)" gdb shows following:

kaklik@UST-vyvoj:~/git/NEC-models/antennas/src$ gdb /usr/bin/python2.7 core GNU gdb (Ubuntu 7.11-0ubuntu1) 7.11 Copyright (C) 2016 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-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 /usr/bin/python2.7...(no debugging symbols found)...done.

warning: core file may not match specified executable file. [New LWP 7490] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `python helix_test.py'. Program terminated with signal SIGSEGV, Segmentation fault. #0 c_geometry::connect_segments (this=0x1f3b560, ignd=)

at ../necpp_src/src/c_geometry.cpp:1750

1750 xa= xa+ x2[ixx]; (gdb)

kaklik avatar May 15 '16 10:05 kaklik

Hi There,

Could you send a piece of code that reproduces this?. It may now be fixed from issue #36.

Kind regards Tim

tmolteno avatar Jun 03 '16 23:06 tmolteno

I have a quite complex piece of code for now. https://github.com/bolidozor/NEC-models/blob/optimize/antennas/src/SC-QHA.py#L221 But exactly the problem appears if I try to call nec.radiation_pattern(thetas=Range(0,0, count=90), phis=Range(0,0,count=90)) more times than only once in the program.

Exact version of PyNEC wrapper which I used is here: https://github.com/kaklik/python-necpp it has small modifications in context_clean wrapper. But these modifications are not related to the problem, but are necessary to run the problematic code.

kaklik avatar Jun 07 '16 14:06 kaklik