Go Back   Home > Forums > General Interest > Everything Else
Home Forums Rules Articles Store Gallery Blogs Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools......

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 3rd October 2005, 02:54 PM   #1
rif is offline rif  United States
diyAudio Member
 
Join Date: Jan 2003
Location: Southern NJ
Default Spice on Linux -- help needed

I've just tried for the first time to execute spice on a command line and can't seem to get it to work even for trivial netlists (including known good examples).

Any idea where to start to troubleshoot?

I use the command:
spice test1.net -r test1.out
or
spice3 test1.net -r test1.out

It begins and states the circuit title (from the title in the netlist), but then always gives a "Segmentation Fault".

I searched the manuals I could find online, but to no avail.
  Reply With Quote
Old 3rd October 2005, 03:27 PM   #2
tlf9999 is offline tlf9999  United States
Account Disabled
 
Join Date: May 2005
Location: none
no linux expert but "segmentation error" is not a spice error message rather a linux/unix error message. likely the program isn't correctly compiled / linked.
  Reply With Quote
Old 3rd October 2005, 03:37 PM   #3
diyAudio Member
 
wes-ninja250's Avatar
 
Join Date: Feb 2005
Location: Kingston, ON
Segmentation fault literally means that the program tried to access memory outside of the regions (segments) that have been allocated to the program by the operating system. Roughly equivalent to a general protection fault under Windows.

In 98% of cases, this is caused by dereferencing NULL (address 0) -- probably because something wasn't set/loaded/configured properly.

If you have some programming experience, you can read the core dump with gdb, or follow the program's "work" with strace. These may provide clues.

It's a little more difficult under Linux to guess at these types of problems, due to things like the 58 versions of LibC, blah blah blah that that platform has.

My immediate recommendation -- if you installed from a package, try building from sources instead.

Wes
__________________
Do daemons dream of electric sleep()?
  Reply With Quote
Old 3rd October 2005, 03:57 PM   #4
rif is offline rif  United States
diyAudio Member
 
Join Date: Jan 2003
Location: Southern NJ
I'll give that a try tonight. I did install from a package -- I'm running gentoo. But that means it actually compiles the source and doesn't just install pre-existing binaries.

Hopefully it's just a config file issue somewhere.

If not, I'll give ngspice a try -- I'm not doing anything too fancy
  Reply With Quote
Old 3rd October 2005, 04:45 PM   #5
diyAudio Member
 
wes-ninja250's Avatar
 
Join Date: Feb 2005
Location: Kingston, ON
If you're one of those Gentoo guys with a 48-line CPPFLAGS (and have no clue what any of the settings do ) -- do yourself a favour and turn everything off that is not essential for building the program.

Wes
__________________
Do daemons dream of electric sleep()?
  Reply With Quote
Old 3rd October 2005, 06:01 PM   #6
rif is offline rif  United States
diyAudio Member
 
Join Date: Jan 2003
Location: Southern NJ
I am one of those gentoo guys, but recently scaled down the flags

I think I only use 2 or 3 (besides the standard m64, pipe, and O2). I'll try removing those extra ones and re-emerging.

Thanks!

BTW -- just for reference, simetrix is available on linux (intro version only). My goal is to use simetrix as a schem. capture/netlist generator and spice as the number cruncher
  Reply With Quote
Old 3rd October 2005, 06:33 PM   #7
diyAudio Member
 
wes-ninja250's Avatar
 
Join Date: Feb 2005
Location: Kingston, ON
Neat -- I didn't know Symmetrix was available on a real OS. I've been using it under Windows occasionally for a few years now.

What kind of workstation are you using? If it's an Intel-compatible box, I'd strongly recommend disabling -m64 and popping in -m32 for this type of problem. No need to insist that the SPICE authors wrote 64-bit clean code. (For example, your problem could be triggered if the code inadvertenly stored a pointer in an int, where an int is 32bits long always, but a pointer can be 64 bits in a 64-bit AMD environment.)

For that matter, if you're running SPARC, I'd make the same recommendation, and use SPARC v7 instructions for now. Also, if you're running SPARC, Alpha, POWER, etc, you may be in for some endian issues as well, depending on how well tested that codebase is. And, of course, alignment errors (but those will trigger SIGBUS, not SIGSEGV).

-pipe is irrelevant; -O2 shouldn't cause any trouble, although specifying -O0 may help, depending upon the underlying cause (esp. if you have certain versions of gcc 3.x).

Wes
__________________
Do daemons dream of electric sleep()?
  Reply With Quote
Old 3rd October 2005, 08:50 PM   #8
rif is offline rif  United States
diyAudio Member
 
Join Date: Jan 2003
Location: Southern NJ
It's just a home built amd64, 1gig ram, nvidia 5500 video -- really nothing extraodinary given that they have those dual core/sli/pci-x stuff out there now.

The m64 flag shouldn't cause any issues -- the gentoo docs say to use it to allow both 64 and 32 bit code. But I wouldn't bet much on that .

The problem is that gentoo doesn't allow (at least as I know) package dependent C-flags.

Come to think of it, I think I did use a ~amd64 (means testing version) which is almost always OK to use
  Reply With Quote
Old 3rd October 2005, 10:14 PM   #9
rif is offline rif  United States
diyAudio Member
 
Join Date: Jan 2003
Location: Southern NJ
If someone doesn't mid, can you provide a simple, even trivial, deck that is known to work. I'm trying to eliminate sources of this error.

Here's what I'm using:

TEST
V1 1 0 SIN(0.5 0.5 1000)
R1 1 2 1000
R2 2 0 1000
.TRAN 0.01m 2m
.END
  Reply With Quote
Old 5th October 2005, 04:25 AM   #10
mikeks is offline mikeks  United Kingdom
Account Disabled
 
Join Date: Jun 2004
Location: Animal farm
Try Simetrix
  Reply With Quote

Reply


Hide this!Advertise here!

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SPICE program recommendation needed hifimaker Parts 4 20th March 2007 11:24 AM
Spice model LM3886 needed. charlleqi Chip Amps 5 27th December 2006 04:49 AM
3f4 spice models needed Geek Tubes / Valves 1 23rd September 2005 07:39 AM
Spice model for BC327 needed angshudas Parts 3 11th November 2003 10:09 AM
SPICE models for power amp output transistors needed... ergo Solid State 9 22nd March 2001 07:31 PM


New To Site? Need Help?

All times are GMT. The time now is 11:43 AM.

Page generated in 0.21826 seconds (44.89% PHP - 55.11% MySQL) with 11 queries

Copyright ©1999-2012 diyAudio