Re: [Simh] RE : Segmentation fault when running the MIcrovax emulator

2012-01-08 Thread J. David Bryan
On Sunday, January 8, 2012 at 15:28, brian wrote:

> I have gdb, but as I told Sergey, I know absolutely nothing about C
> programming, the only coding I've done under Linux is using Lazarus
> and FreePascal with the integrated debugger. 

That's OK; I know nothing about Linux or the VAX.  ;-)


> > (gdb) backtrace
> > #0  0x0044a2bb in eth_open (dev=Cannot access memory at address
> > #0x7fff00386927) at sim_ether.c:912
> > Cannot access memory at address 0x7fff00386e77
> > (gdb)

That's odd.  It looks as though the stack is corrupted.  gdb is attempting 
to print the values of the parameters to the eth_open function (starting 
with "dev") but cannot, and then is attempting to walk back in the stack 
but cannot.

Could you please try this: at the first gdb prompt after starting SIMH 
under gdb, set a breakpoint on the eth_open function:

  (gdb) break eth_open

...and then enter "run".  When the script does the attach, the breakpoint 
should be hit, and the values of the parameters (dev, name, dptr, and dbit) 
should be printed automatically.  It will be helpful to see if they print 
OK, or whether you get the "cannot access memory" error at that point as 
well.

If it does print the parameters OK, try stepping forward a line at a time 
with the gdb "next" command.  After each one, print the value of the dev 
parameter:

  (gdb) print dev

...which should print the same value as was printed when the breakpoint was 
hit.  This should help to pinpoint where the trouble is starting, although 
presumably you'll still get the segfault when you step into line 912.

  -- Dave

___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh


Re: [Simh] RE : Segmentation fault when running the MIcrovax emulator

2012-01-08 Thread brian

On 01/08/2012 05:00 AM, Sergey Oboguev wrote:

If you compile it, rather than using pre-built binary, can you compile in debug
mode, run under gdb and see the stack at fault point, and also the fault
location?


See my reply to David.


Similarly, can you verify if SHOW XQ ETH works or also faults?
_


Show XQ ETH works. This is the (edited) output from putting a SHOW XQ 
ETH in front of the attach command, with all the early stuff cut out.



do> set xq mac=08-00-2B-AA-BB-CC
do> show xq eth
ETH devices:
  0  eth0   (No description available)
  1  wlan0  (No description available)
  2  virbr0 (No description available)
do> attach xq eth0
Segmentation fault


BTW, both SIMH and libpcap were compiled from sources.



Brian.
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh


Re: [Simh] RE : Segmentation fault when running the MIcrovax emulator

2012-01-08 Thread brian

On 01/08/2012 03:04 PM, J. David Bryan wrote:

On Sunday, January 8, 2012 at 2:00, Sergey Oboguev wrote:


If you compile it, rather than using pre-built binary, can you compile
in debug mode, run under gdb and see the stack at fault point, and also
the fault location?


I agree that knowing where the fault occurs would be helpful now.

If I read the makefile supplied with SIMH correctly, a non-Win32
compilation already includes debug info (via the "-g" switch):

   CC = gcc -std=c99 -U__STRICT_ANSI__ -g $(OS_CCDEFS) -I .

Brian, if you have gdb on your system, you should be able to start SIMH
with gdb, issue the gdb "run" command, and then when the segfault occurs,
issue the gdb "backtrace" command to print the call stack.  This should
show us where the problem is occuring.



I have gdb, but as I told Sergey, I know absolutely nothing about C 
programming, the only coding I've done under Linux is using Lazarus 
and FreePascal with the integrated debugger. I've seen walkbacks 
(backtraces?) before, so here's the output. Hope it gives you what you 
need.


Brian.




sudo gdb /home/brian/vax/bin/vax
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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".
For bug reporting instructions, please see:
...
Reading symbols from /home/brian/vax/bin/vax...done.
(gdb) run
Starting program: /home/brian/vax/bin/vax
[Thread debugging using libthread_db enabled]

VAX simulator V3.8-1
NVR: buffering file in memory
VAX simulator V3.8-1 [64b data, 64b addresses, Ethernet support]
RQ: unit is read only

Program received signal SIGSEGV, Segmentation fault.
0x0044a2bb in eth_open (dev=Cannot access memory at address 
0x7fff00386927
) at sim_ether.c:912
912 sim_ether.c: No such file or directory.
in sim_ether.c
(gdb) backtrace
#0  0x0044a2bb in eth_open (dev=Cannot access memory at address 
0x7fff00386927
) at sim_ether.c:912
Cannot access memory at address 0x7fff00386e77
(gdb)


___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh


Re: [Simh] RE : Segmentation fault when running the MIcrovax emulator

2012-01-08 Thread J. David Bryan
On Sunday, January 8, 2012 at 2:00, Sergey Oboguev wrote:

> If you compile it, rather than using pre-built binary, can you compile
> in debug mode, run under gdb and see the stack at fault point, and also
> the fault location? 

I agree that knowing where the fault occurs would be helpful now.

If I read the makefile supplied with SIMH correctly, a non-Win32 
compilation already includes debug info (via the "-g" switch):

  CC = gcc -std=c99 -U__STRICT_ANSI__ -g $(OS_CCDEFS) -I .

Brian, if you have gdb on your system, you should be able to start SIMH 
with gdb, issue the gdb "run" command, and then when the segfault occurs, 
issue the gdb "backtrace" command to print the call stack.  This should 
show us where the problem is occuring.

  -- Dave

___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh


Re: [Simh] RE : Segmentation fault when running the MIcrovax emulator

2012-01-08 Thread brian


It was suggested to me that having the MAC address set to the address 
of my Ethernet card could be the problem, and that DEC MAC addresses 
always started with the same three bytes.


I tried this, but no change whatever in the symptoms.

Brian.

___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh


[Simh] RE : Segmentation fault when running the MIcrovax emulator

2012-01-08 Thread Sergey Oboguev
If you compile it, rather than using pre-built binary, can you compile in debug 
mode, run under gdb and see the stack at fault point, and also the fault 
location?
Similarly, can you verify if SHOW XQ ETH works or also faults?

From: brian 
To: "simh@trailing-edge.com >> SIMH" 
Sent: Sun, January 8, 2012 1:51:10 AM
Subject: Re: [Simh] RE :  Segmentation fault when running the MIcrovax emulator

I'm actually running Mint 9, but that's based on Ubuntu 10.04.

However, I've compiled the software without any errors, so presumably 
the linker could find the library OK.

It's when running SIMH that the segmentation fault occurs.


Brian.
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh


Re: [Simh] RE : Segmentation fault when running the MIcrovax emulator

2012-01-08 Thread brian

On 01/08/2012 04:33 AM, Mark Benson wrote:


On 8 Jan 2012, at 08:48, brian wrote:



Inadvertently sent privately - sorry for the duplicate, Francois.

On 01/07/2012 02:32 PM, Boucher, François wrote:

/Another possibility is that you might not have the libpcap installed
on Ubuntu?/


It's definitely installed.


Woooahh hold one if you are running on Ubuntu I have a feeling it installs 
libpcap in a non0-standard directory.

I had to symlink the main library to another location to compile simH on my 
Ubuntu 10.04 box.



I'm actually running Mint 9, but that's based on Ubuntu 10.04.

However, I've compiled the software without any errors, so presumably 
the linker could find the library OK.


It's when running SIMH that the segmentation fault occurs.


Brian.
___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh


Re: [Simh] RE : Segmentation fault when running the MIcrovax emulator

2012-01-08 Thread brian


Inadvertently sent privately - sorry for the duplicate, Francois.

On 01/07/2012 02:32 PM, Boucher, François wrote:

/Another possibility is that you might not have the libpcap installed
on Ubuntu?/


It's definitely installed.


/I am not sure how to help you out on this, but if the problem is not
related directly/
/to the compilation of simh, then it's calls to kernel services that
are blocked, thus/
/the segmentation fault./
It could also be the eth0 interface that does not exist or has another
name in Ubuntu.


No, the eth0 is correct - checked via ifconfig.


eth0  Link encap:Ethernet  HWaddr 00:1c:25:ea:22:09
  inet addr:192.168.1.100  Bcast:192.168.1.255 Mask:255.255.255.0
  inet6 addr: fe80::21c:25ff:feea:2209/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:18693 errors:0 dropped:0 overruns:0 frame:0
  TX packets:16769 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:13143429 (13.1 MB)  TX bytes:1390150 (1.3 MB)
  Interrupt:17




What you can try, is to remove the simh.ini file, then start the
simulator.
you'll get to the sim>
prompt. then type:
attach xq ?
This will list you the ethernet device names that are available to you
to attach with.


Thanks, but I'm absolutely certain the net connection is eth0. :)


Brian.

___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh


Re: [Simh] Segmentation fault

2012-01-08 Thread brian

On 01/07/2012 05:10 PM, Bob Supnik wrote:

Rename the vax.ini file to vax.cmd or something else. Then issue the
commands once the simulator has started:

sim> do -v vax.cmd

This will echo the commands as they are executed and at least provide
a pointer to which one blew up.



Running with the -v switch, as David suggested, shows that it's the 
attach which is blowing up. As per my reply to Francois, yes, I'm 
absolutely sure that the HW address is correct and that it's eth0, 
also that I did build and install libpcap.



Brian.

___
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh