KJ7LNW / xnec2c

Xnec2c is a high-performance multi-threaded electromagnetic simulation package to model antenna near- and far-field radiation patterns for Linux and UNIX operating systems.
https://www.xnec2c.org/
GNU General Public License v3.0
78 stars 17 forks source link

xnec2c exit with segfault #10

Closed scaramacai closed 2 years ago

scaramacai commented 2 years ago

I'm attaching a zip (examples.zip) with files giving or not a segmentation fault. examples.zip Moxon_900.nec works Moxon_seg_fault.nec gives a segmentation fault Moxon_XQ_and_0.nec gives a segmentation fault Moxon_XQ_and_1.nec works Moxon_without_RP_and_XQ.nec gives a segmentation fault

scaramacai commented 2 years ago

I modified input.c in the XQ part, by moving the check:

    if( itmp1 == 0 )
      break; /* No rad pat, stop reading commands */

after the fpat initialization, and now both Moxon_seg_fault.nec and Moxon_XQ_and_0.nec work, while Moxon_without_RP_and_XQ.nec still seg faults. Therefore I guess that fpat must be initialized anyway.

I'm attaching the (gzipped) modified file.

input.c.modified.gz

KJ7LNW commented 2 years ago

Thanks for the report, fixed in 31b903e .