Menu

#89 Coupled Multiconductor Line dumps core if number elements > 8

v1.0 (example)
open
nobody
None
2
2026-07-31
2026-07-28
No

I've written a maxwell field simulator that outputs ngspice coupled multiconductor models for arbitrary transmission line metal/dielectric cross sections. If I generate models with 8 conductors ngspice simulates it correctly. Models with 9 or more conductors dump core. I am working on a commercial project for our Agilent Mass Spectrometers that uses 15 conductors, so I'm motivated to help fix this if possible. My guess is that there is a hard coded 8-element limit on the internal data structures. I've attached a working mc8.cki file and a failing mc9.cki file. I run them with "ngspice -b mc8.cki -r mc8.raw -o mc8.txt".

Kind regards,
Rick Walker
rick.walker@agilent.com

2 Attachments

Discussion

  • Richard Walker

    Richard Walker - 2026-07-29

    Afer enabling debugging and looking at the stack trace, the issue is:

    #define MAX_CP_TX_LINES 8
    
    in src/include/ngspice/swec.h.
    
    I changed it from 8 to 20 and rebuilt ngspice.
    
    I wonder if there is a way to make this more obvious?  Maybe the manual could say "multiconductor lines are compiled for a maximum of 8 conductors by default.  You may have to rebuild after changing MAX_CP_TX_LINES if you need a larger number of conductors".
    
     
  • Richard Walker

    Richard Walker - 2026-07-29

    I could trap the out of bounds condition and print an error message telling the user the current compiled limit and telling them which #define to change to up the limit, rather than triggering a core dump. Would this be an acceptable patch? I am using this code quite a bit lately and am planning to publish my multiconductor model generator, so I'd like to make this easier to use.

     
  • Holger Vogt

    Holger Vogt - 2026-07-30

    Yes, of course that's the best solution. Please post the patch.

     
  • Richard Walker

    Richard Walker - 2026-07-31

    Here's a patch. It prints out how many lines were requested with the CPL model, how many lines are compiled in and a suggestion for which file and #define to modify to increase the limit. I also added my name to AUTHORS file assuming you eventually accept the patch :-).

     

Log in to post a comment.