its
its copied to clipboard
Building KLH10 on MacOS Ventura fails
Logging an issue to keep track of the work here. The build fails really quickly at the start
make clean all EMULATOR=klh10
rm -f -rf out start build/*/stamp
git submodule sync --recursive `dirname tools/pdp6/.gitignore`
Synchronizing submodule url for 'tools/pdp6'
git submodule update --recursive --init `dirname tools/pdp6/.gitignore`
build/stamp.sh build/timestamps.txt
mkdir -p out/klh10/stamp
touch out/klh10/stamp/touch
mkdir -p out/klh10/system
x=`echo 192.168.1.100 | tr . ,`; \
sed -e "s/%IP%/$x/" \
-e 's/%NETMASK%/255,255,255,248/' < build/klh10/config.203 > out/klh10/system/config.203
mkdir -p out/klh10
tools/itstar/itstar -cf out/klh10/minsys.tape -C bin/ks10 _ sys
tools/itstar/itstar -rf out/klh10/minsys.tape -C bin/minsys sys
mkdir -p out/klh10
tools/itstar/itstar -cf out/klh10/minsrc.tape -C src midas system sysen1/ddt.1548 syseng/datime.75 syseng/lsrtns.69 syseng/msgs.47 syseng/ntsddt.n79h kshack/nsalv.261 syseng/format.305 syseng/rfn.13 kshack/ksfedr.146 syseng/dump.448 sysnet/netwrk.266
tools/itstar/itstar -rf out/klh10/minsrc.tape -C out/klh10 system
mkdir -p out/klh10
tools/tapeutils/tapewrite -n 2560 out/klh10/salv.tape bin/ks10/boot/ram.262 bin/ks10/boot/salv.rp06
mkdir -p out/klh10
tools/tapeutils/tapewrite -n 2560 out/klh10/dskdmp.tape bin/ks10/boot/ram.262 bin/ks10/boot/dskdmp.rp06
ln -s build/klh10/start
mkdir -p out/klh10/stamp
sed -e 's/%IP%/192.168.1.100/' \
-e 's/%GW%/192.168.0.45/' < build/mchn/DB/dskdmp.txt > out/klh10/dskdmp.ini
mkdir -p out/klh10/stamp
touch out/klh10/stamp/pdp10
mkdir -p out/klh10/syshst
sed -e 's/%IP%/192.168.1.100/' \
-e 's/%HOSTNAME%/DB-ITS.EXAMPLE.COM/' < build/h3text.2018 > out/klh10/syshst/h3text.2018
cat conf/hosts >> out/klh10/syshst/h3text.2018
mkdir -p out/klh10
rm -f -f src/*/*~
tools/itstar/itstar -cf out/klh10/sources.tape -C src syseng sysen1 sysen2 sysen3 sysnet kshack dragon channa _teco_ emacs emacs1 rms klh syshst sra mrc ksc eak gren bawden _mail_ l lisp libdoc comlap lspsrc nilcom rwk chprog rg inquir acount gz sys decsys ecc alan sail kcc kcc_sy c games archy dcp spcwar rwg libmax rat z emaxim rz maxtul aljabr cffk das ell ellen jim jm jpg macrak maxdoc maxsrc mrg munfas paulw reh rlb rlb% share tensor transl wgd zz graphs lmlib pratt quux scheme gsb ejs mudsys draw wl taa tj6 budd sharem ucode rvb kldcp math as imsrc gls demo macsym lmcons dmcg hibou agb gt40 rug maeda ms kle aap common fonts lcf 11logo kmp info aplogo bkph bbn pdp11 chsncp sca music1 moon teach ken lmio1 llogo a2deh chsgtv clib sys3 lmio turnip mits_s rab stan_k bs cstacy kp dcp2 -pics- victor imlac rjl mb bh lars drnil radia gjd maint bolio cent shrdlu vis cbf digest prs jsf decus bsg muds54 hello rrs 2500 minsky danny survey librm3 librm4 klotz atlogo clusys cprog r eb cpm mini nova sits nlogo bee gld mprog2 cfs libmud librm1 librm2 mprog mprog1 mudbug mudsav _batch combat mits_b minits spacy
tools/itstar/itstar -rf out/klh10/sources.tape -C doc info _info_ sysdoc sysnet syshst kshack _teco_ emacs emacs1 c kcc chprog sail draw wl pc tj6 share _glpr_ _xgpr_ inquir mudman system xfont maxout ucode moon acount alan channa fonts games graphs humor kldcp libdoc lisp _mail_ midas quux scheme manual wp chess ms macdoc aplogo _temp_ pdp11 chsncp cbf rug bawden llogo eak clib teach pcnet combat pdl minits mits_s chaos hal -pics- imlac maint cent ksc klh digest prs decus bsg madman hur lmdoc rrs danny netwrk klotz hello clu r mini nova sits jay rjl nlogo mprog2 mudbug cfs hudini
tools/itstar/itstar -rf out/klh10/sources.tape -C bin sys sys1 sys2 emacs _teco_ lisp liblsp alan inquir sail comlap c decsys graphs draw datdrw fonts fonts1 fonts2 games macsym maint _www_ gt40 llogo bawden sysbin -pics- lmman shrdlu imlac pdp10 madman survey rrs clu clucmp rws mini mudsav mudsys libmud librm1 librm2 librm3 librm4 mbprog mprog1 mprog mprog2 mudbug mudtmp _batch
tools/itstar/itstar -rf out/klh10/sources.tape -C out/klh10 syshst
PATH="/Users/mikek/its/tools/klh10/BIN:$PATH" expect -f build/klh10/build.tcl 192.168.1.100 192.168.0.45
ENTERING MAIN BUILD SCRIPT
Wed Jan 24 15:31:10 PST 2024
BUILDING DB ITS
ENTERING BUILD SCRIPT: MARK
Wed Jan 24 15:31:10 PST 2024
spawn ./kn10-ks-its ../mchn/DB/nsalv.ini
KLH10 2.0l (MyITS) built Jan 24 2024 15:24:47
Copyright © 2002 Kenneth L. Harrenstien -- All Rights Reserved.
This program comes "AS IS" with ABSOLUTELY NO WARRANTY.
Compiled for apple-darwin22.6.0 on x86_64 with word model USEINT
Emulated config:
CPU: KS10 SYS: ITS Pager: ITS APRID: 4097
Memory: 512 pages of 1024 words (SHARED)
Time interval: INTRP Base: OSGET Quantums: OSVIRT
Interval default: 60Hz
Internal clock: OSINT
Other: CIRC JPC DEBUG PCCACHE CTYINT IMPINT EVHINT
Devices: RH11 RPXX(DP) TM03 DZ11 CH11 LHDH(DPIMP)
[MEM: Allocating 512 pages [os_mmcreate: shmget failed for 4194304 bytes - Cannot allocate memory]
private memory, clearing...done]
KLH10# ; Define basic KS10 device config - two RH11s each on its own Unibus
KLH10#
KLH10# devdef rh0 ub1 rh11 addr=776700 br=6 vec=254
KLH10# devdef rh1 ub3 rh11 addr=772440 br=6 vec=224
KLH10#
KLH10# ; Provide one disk, one tape in config ITS expects
KLH10#
KLH10# devdef dsk0 rh0.0 rp type=rp06 format=dbd9 path=../../out/klh10/rp0.dsk iodly=0
[dp_init: shmget failed - 12]
RPXX subproc init failed!
Final init of device "dsk0" failed!
KLH10# devdef mta0 rh1.0 tm02 fmtr=tm03 type=tu45
KLH10# devdef mta1 rh1.1 tm02 fmtr=tm03 type=tu45
KLH10# devmo mta0 ../../out/klh10/minsys.tape
Mount succeeded.
KLH10# devmo mta1 ../../out/klh10/salv.tape
Mount succeeded.
KLH10#
KLH10# ; ITS wants a 60Hz clock, allow it. Need this until defaults OK.
KLH10# set clk_ithzfix=60
clk_ithzfix: 60. => 60.
KLH10#
KLH10# ; Define IMP for PI on ITS.JOSS.COM
KLH10# devdef imp ub3 lhdh addr=767600 br=6 vec=250 ipaddr=199.34.53.51 gwaddr=199.34.53.50
IMP assuming "pcap" interface method since "gwaddr" parameter given
[dp_init: shmget failed - 12]
IMP subproc init failed!
Final init of device "imp" failed!
KLH10#
KLH10# ; Dummy definitions. Only one DZ is still (apparently) needed.
KLH10# devdef dz0 ub3 dz11 addr=760010 br=5 vec=340
KLH10# ;devdef dz1 ub3 dz11 addr=760020 br=5 vec=350
KLH10# ;devdef chaos ub3 ch11 addr=764140 br=5 vec=270
KLH10#
KLH10# ; Define new HOST device hackery
KLH10# ;devdef idler ub3 host addr=777000
KLH10#
KLH10# load @.nsalv-260-u
Using word format "u36"...
Added 2914 syms to DDT, total 2974
Loaded "@.nsalv-260-u":
Format: ITS-SBLK
Data: 9830, Symwds: 2914, Low: 0, High: 0777266, Startaddress: 0774000
KLH10# [EOF on ../mchn/DB/nsalv.ini]
KLH10# go
Starting KN10 at loc 0774000...
MARK$G'
Format pack on unit #0send: spawn id exp7 not open
while executing
"send -- $c"
(procedure "type" line 4)
invoked from within
"type $r"
(procedure "respond" line 3)
invoked from within
"respond "Are you sure you want to format pack on drive" "y""
(procedure "mark_pack" line 5)
invoked from within
"mark_pack "0" "0" "foobar""
(procedure "mark_bootstrap_packs" line 2)
invoked from within
"mark_bootstrap_packs"
(file "/Users/mikek/its/build/mark.tcl" line 5)
invoked from within
"source $build/mark.tcl"
(file "../build.tcl" line 167)
invoked from within
"source ../build.tcl"
(file "build/klh10/build.tcl" line 71)
make: *** [out/klh10/rp0.dsk] Error 1
When I go and step through the mark.tcl script manually by running ./kn10-ks-its ../mchn/DB/nsalv.ini
from the build/klh10
directory.
I get this error on the first question. Which seems to be the same fault during make it is just not bubbled up.
Format pack on unit #0zsh: segmentation fault sudo ./kn10-ks-its ../mchn/DB/nsalv.ini
@eswenson1, are you running KLH10 on a Mac? If so, anything to add here with regards to your success or lack thereof?
I'm not currently. Let me try to build and run.
Update: I did just try to do a make clean EMULATOR=klh10 && make EMULATOR=klh10 download
and while KLH10 built, the download
target resulted in this:
...
ln -s build/klh10/start
mkdir -p out/klh10/stamp
sed -e 's/%IP%/192.168.1.100/' \
-e 's/%GW%/192.168.0.45/' < build/mchn/DB/dskdmp.txt > out/klh10/dskdmp.ini
mkdir -p out/klh10/stamp
touch out/klh10/stamp/pdp10
wget http://hactrn.kostersitz.com/images/klh10.tgz
--2024-02-16 08:22:32-- http://hactrn.kostersitz.com/images/klh10.tgz
Resolving hactrn.kostersitz.com (hactrn.kostersitz.com)... 31.22.4.235
Connecting to hactrn.kostersitz.com (hactrn.kostersitz.com)|31.22.4.235|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 141598464 (135M) [application/x-tar]
Saving to: ‘klh10.tgz’
klh10.tgz 100%[==========================================================>] 135.04M 4.33MB/s in 34s
2024-02-16 08:23:07 (3.99 MB/s) - ‘klh10.tgz’ saved [141598464/141598464]
tar xzf klh10.tgz
klh10/output.tape: truncated gzip input
tar: Error exit delayed from previous errors.
make: *** [download] Error 1
I tried repeatedly downloading klh10.tgz from hactrn.kostersitz.com, and each time, while the download appears to work perfectly fine, the .tgz has errors extracting. Perhaps it was not properly uploaded the last time?
I'll try a full build, which, of course, is needed to test out this ticket. I was just curious to try the download
thing since I haven't ever before.
I'm failing in the same way as previously described:
ENTERING MAIN BUILD SCRIPT
Fri Feb 16 08:29:08 PST 2024
BUILDING DB ITS
ENTERING BUILD SCRIPT: MARK
Fri Feb 16 08:29:08 PST 2024
spawn ./kn10-ks-its ../mchn/DB/nsalv.ini
KLH10 2.0l (MyITS) built Feb 16 2024 08:22:27
Copyright © 2002 Kenneth L. Harrenstien -- All Rights Reserved.
This program comes "AS IS" with ABSOLUTELY NO WARRANTY.
Compiled for apple-darwin23.2.0 on arm with word model USEINT
Emulated config:
CPU: KS10 SYS: ITS Pager: ITS APRID: 4097
Memory: 512 pages of 1024 words (SHARED)
Time interval: INTRP Base: OSGET Quantums: OSVIRT
Interval default: 60Hz
Internal clock: OSINT
Other: CIRC JPC DEBUG PCCACHE CTYINT IMPINT EVHINT
Devices: RH11 RPXX(DP) TM03 DZ11 CH11 LHDH(DPIMP)
[MEM: Allocating 512 pages shared memory, clearing...done]
KLH10# ; Define basic KS10 device config - two RH11s each on its own Unibus
KLH10#
KLH10# devdef rh0 ub1 rh11 addr=776700 br=6 vec=254
KLH10# devdef rh1 ub3 rh11 addr=772440 br=6 vec=224
KLH10#
KLH10# ; Provide one disk, one tape in config ITS expects
KLH10#
KLH10# devdef dsk0 rh0.0 rp type=rp06 format=dbd9 path=../../out/klh10/rp0.dsk iodly=0
[dp_init: shmget failed - 12]
RPXX subproc init failed!
Final init of device "dsk0" failed!
KLH10# devdef mta0 rh1.0 tm02 fmtr=tm03 type=tu45
KLH10# devdef mta1 rh1.1 tm02 fmtr=tm03 type=tu45
KLH10# devmo mta0 ../../out/klh10/minsys.tape
Mount succeeded.
KLH10# devmo mta1 ../../out/klh10/salv.tape
Mount succeeded.
KLH10#
KLH10# ; ITS wants a 60Hz clock, allow it. Need this until defaults OK.
KLH10# set clk_ithzfix=60
clk_ithzfix: 60. => 60.
KLH10#
KLH10# ; Define IMP for PI on ITS.JOSS.COM
KLH10# devdef imp ub3 lhdh addr=767600 br=6 vec=250 ipaddr=199.34.53.51 gwaddr=199.34.53.50
IMP assuming "pcap" interface method since "gwaddr" parameter given
[dp_init: shmget failed - 12]
IMP subproc init failed!
Final init of device "imp" failed!
KLH10#
KLH10# ; Dummy definitions. Only one DZ is still (apparently) needed.
KLH10# devdef dz0 ub3 dz11 addr=760010 br=5 vec=340
KLH10# ;devdef dz1 ub3 dz11 addr=760020 br=5 vec=350
KLH10# ;devdef chaos ub3 ch11 addr=764140 br=5 vec=270
KLH10#
KLH10# ; Define new HOST device hackery
KLH10# ;devdef idler ub3 host addr=777000
KLH10#
KLH10# load @.nsalv-260-u
Using word format "u36"...
Added 2914 syms to DDT, total 2974
Loaded "@.nsalv-260-u":
Format: ITS-SBLK
Data: 9830, Symwds: 2914, Low: 0, High: 0777266, Startaddress: 0774000
KLH10# [EOF on ../mchn/DB/nsalv.ini]
KLH10# go
Starting KN10 at loc 0774000...
MARK$G'
Format pack on unit #0send: spawn id exp7 not open
while executing
"send -- $c"
(procedure "type" line 4)
invoked from within
"type $r"
(procedure "respond" line 3)
invoked from within
"respond "Are you sure you want to format pack on drive" "y""
(procedure "mark_pack" line 5)
invoked from within
"mark_pack "0" "0" "foobar""
(procedure "mark_bootstrap_packs" line 2)
invoked from within
"mark_bootstrap_packs"
(file "/Users/eswenson/ITS/ws/its/build/mark.tcl" line 5)
invoked from within
"source $build/mark.tcl"
(file "../build.tcl" line 167)
invoked from within
"source ../build.tcl"
(file "build/klh10/build.tcl" line 71)
make: *** [out/klh10/rp0.dsk] Error 1
➜ its git:(master) ✗
I manually tried to start KLH10 (in the right directory with the right command-line parameters), and got this:
KLH10# load @.ddt-u
Using word format "u36"...
Added 1610 syms to DDT, total 1670
Loaded "@.ddt-u":
Format: ITS-SBLK
Data: 1947, Symwds: 1617, Low: 0772702, High: 0777266, Startaddress: 0774000
Assembled by ALAN on 1989-05-31 05:00:25 from file "AI:SYSTEM;DDT 68"
KLH10# load dskdmp.216bin
Using word format "u36"...
Added 1272 syms to DDT, total 2942
Loaded "dskdmp.216bin":
Format: ITS-SBLK
Data: 954, Symwds: 1279, Low: 04000, High: 07774, Startaddress: 04000
Assembled by KLH on 1992-07-20 04:70:12 from file "NX:SYSTEM;DSKDMP 216"
KLH10# [EOF on ../../out/klh10/dskdmp.ini]
KLH10# go
Starting KN10 at loc 04000...
It hung at this point. So either there is something wrong with the files loaded into KLH10 (e.g. dskdmp.216bin or @.ddt-u), which I doubt, or the built KLH10 doesn't work any more when built on mac. I'll see if I can find an old klh10 I've built and run to see if it does better.
When I start my full build manually with this ./kn10-ks-its ../mchn/DB/nsalv.ini
it starts up fine but then crashes when I type the 0 at the format pack #
prompt. It looks like yours started at loc 04000 whereas mine starts at 0774000
Is it normal to get this error on startup of kn10-ks-its? I don't recall seeing it before.
KLH10 2.0l (MyITS) built Feb 16 2024 08:22:27
Copyright � 2002 Kenneth L. Harrenstien -- All Rights Reserved.
This program comes "AS IS" with ABSOLUTELY NO WARRANTY.
Compiled for apple-darwin23.2.0 on arm with word model USEINT
Emulated config:
CPU: KS10 SYS: ITS Pager: ITS APRID: 4097
Memory: 512 pages of 1024 words (SHARED)
Time interval: INTRP Base: OSGET Quantums: OSVIRT
Interval default: 60Hz
Internal clock: OSINT
Other: CIRC JPC DEBUG PCCACHE CTYINT IMPINT EVHINT
Devices: RH11 RPXX(DP) TM03 DZ11 CH11 LHDH(DPIMP)
[MEM: Allocating 512 pages [os_mmcreate: shmget failed for 4194304 bytes - Cannot allocate memory]
private memory, clearing...done]
KLH10# quit
I wonder if this is the cause?
I'm getting the same issue as you are:
➜ klh10 git:(master) ✗ ./kn10-ks-its ../mchn/DB/nsalv.ini
KLH10 2.0l (MyITS) built Feb 16 2024 08:22:27
Copyright � 2002 Kenneth L. Harrenstien -- All Rights Reserved.
This program comes "AS IS" with ABSOLUTELY NO WARRANTY.
Compiled for apple-darwin23.2.0 on arm with word model USEINT
Emulated config:
CPU: KS10 SYS: ITS Pager: ITS APRID: 4097
Memory: 512 pages of 1024 words (SHARED)
Time interval: INTRP Base: OSGET Quantums: OSVIRT
Interval default: 60Hz
Internal clock: OSINT
Other: CIRC JPC DEBUG PCCACHE CTYINT IMPINT EVHINT
Devices: RH11 RPXX(DP) TM03 DZ11 CH11 LHDH(DPIMP)
[MEM: Allocating 512 pages [os_mmcreate: shmget failed for 4194304 bytes - Cannot allocate memory]
private memory, clearing...done]
KLH10# ; Define basic KS10 device config - two RH11s each on its own Unibus
KLH10#
KLH10# devdef rh0 ub1 rh11 addr=776700 br=6 vec=254
KLH10# devdef rh1 ub3 rh11 addr=772440 br=6 vec=224
KLH10#
KLH10# ; Provide one disk, one tape in config ITS expects
KLH10#
KLH10# devdef dsk0 rh0.0 rp type=rp06 format=dbd9 path=../../out/klh10/rp0.dsk iodly=0
[dp_init: shmget failed - 12]
RPXX subproc init failed!
Final init of device "dsk0" failed!
KLH10# devdef mta0 rh1.0 tm02 fmtr=tm03 type=tu45
KLH10# devdef mta1 rh1.1 tm02 fmtr=tm03 type=tu45
KLH10# devmo mta0 ../../out/klh10/minsys.tape
Mount succeeded.
KLH10# devmo mta1 ../../out/klh10/salv.tape
Mount succeeded.
KLH10#
KLH10# ; ITS wants a 60Hz clock, allow it. Need this until defaults OK.
KLH10# set clk_ithzfix=60
clk_ithzfix: 60. => 60.
KLH10#
KLH10# ; Define IMP for PI on ITS.JOSS.COM
KLH10# devdef imp ub3 lhdh addr=767600 br=6 vec=250 ipaddr=199.34.53.51 gwaddr=199.34.53.50
IMP assuming "pcap" interface method since "gwaddr" parameter given
[dp_init: shmget failed - 12]
IMP subproc init failed!
Final init of device "imp" failed!
KLH10#
KLH10# ; Dummy definitions. Only one DZ is still (apparently) needed.
KLH10# devdef dz0 ub3 dz11 addr=760010 br=5 vec=340
KLH10# ;devdef dz1 ub3 dz11 addr=760020 br=5 vec=350
KLH10# ;devdef chaos ub3 ch11 addr=764140 br=5 vec=270
KLH10#
KLH10# ; Define new HOST device hackery
KLH10# ;devdef idler ub3 host addr=777000
KLH10#
KLH10# load @.nsalv-260-u
Using word format "u36"...
Added 2914 syms to DDT, total 2974
Loaded "@.nsalv-260-u":
Format: ITS-SBLK
Data: 9830, Symwds: 2914, Low: 0, High: 0777266, Startaddress: 0774000
KLH10# [EOF on ../mchn/DB/nsalv.ini]
KLH10# go
Starting KN10 at loc 0774000...
FOO$J? MARK$G'
Format pack on unit #0[1] 61311 segmentation fault ./kn10-ks-its ../mchn/DB/nsalv.ini
%
➜ klh10 git:(master) ✗
I suspect the inability to allocate memory (first error message on kn10-ks-its startup) is the cause.
I guess that would be a problem.
I am wondering if this has to do with the new memory protection features in MacOS. For example I had to codesign gdb to actually use it to get it to run and start debugging
I dunno. I had to codesign gdb way before this problem started happening.
Found this in the klh10 install.txt
KERNEL CONFIGURATION
====================
Installation on most UNIX platforms is straightforward except
for two special requirements of the KLH10 emulator, which sometimes
require kernel reconfiguration.
[A] Shared memory; MANDATORY if running any device sub-processes.
The so-called SYSV "shm" system calls must be available, and
ideally should allow shared segments of up to 32MB for a KL10,
4MB for a KS10. The configuration examples below assume a KL10
since it doesn't hurt even if a KS10 is all you will ever run.
If this support is lacking, you will get a warning similar to
the following:
[os_mmcreate: shmget failed for 33554432 bytes - Invalid argument]
which is not necessarily fatal, but less efficient.
maybe this is a red herring?
The code for this lives in ./tools/klh10/src/osdsup.c
line 1633 in mine.
From where it calls it in '/Users/mikek/its-klh/tools/klh10/src/klh10.c'
the process tries shared memory first and then moves on the private memory if that fails.
the message seems like a red herring as it is deemed a warning that no shared memory is available.
Maybe I'll update the message text to say WARNING :)
For some reason, I cannot run my old version of kn10-ks-its under gdb. So I'm unable to debug. I get this:
gdb ./kn10-ks-its
GNU gdb (GDB) 14.1
Copyright (C) 2023 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-apple-darwin22.6.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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 ./kn10-ks-its...
(gdb) run nsalv.ini
Starting program: /Users/eswenson/its/ws/its/build/klh10/kn10-ks-its nsalv.ini
[New Thread 0x2203 of process 90662]
.
mark^[g
I'm hung after the [New Thread...] message from gdb. I never see any messages from kn10-ks-its. The "mark^[g" was a silly/vain attempt to see if it had started without messages and NSALV was waiting for input (it wasn't).
I wonder if shared memory settings need to get updated. This is what I have:
sysctl -a | grep sysv.shm
kern.sysv.shmmax: 4194304
kern.sysv.shmmin: 1
kern.sysv.shmmni: 32
kern.sysv.shmseg: 8
kern.sysv.shmall: 1024
I increased kern.sysv.shmmax to double that amount and I still get a failure. But the value emitted in the error message is still 4194304. I wonder if I have to reboot the system after changing the value? I thought you could simply do sudo sysctl -w kern.sysv.shmmax=xxxxx
to change the value until the next reboot? When I run sysctl kern.sysv.shmmax
to confirm my setting, I get back:
kern.sysv.shmmax: 8388608
So my change appears to take effect. Not sure why kn10-ks-is asking for 4194304. Can you tell from the code what it wants?
It does look like kn10-ks-its is only wanting 4M, so the 4194304 value is what it is asking for. My "shmmax" value is double that, so the shmget call should succeed. Not sure why it isn't. Googling.....
I found that once it crashes in the terminal window I have to start a new terminal session for the emulator to get to the prompt again. Something in that terminal session gets borked after the crash
Can you use gdb to determine what the error code from the shmget failure is? That might provide a clue.
For me, creating a new shell doesn't fix my inability to run kn10-ks-its under gdb. I never get to see any output from kn10-ks-its after gdb reports that a new thread is created.
I may have to rebuild my kn10-ks-its (good idea anyway). I was able to attach to my kn10-ks-its process from gdb after it was started and see this:
➜ ~ gdb -p 92014
GNU gdb (GDB) 14.1
Copyright (C) 2023 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-apple-darwin22.6.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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".
Attaching to process 92014
[New Thread 0x2803 of process 92014]
warning: Error calling thread_get_state for GP registers for thread 0x2803
warning: Mach error at "../../gdb/i386-darwin-nat.c:132" in function "fetch_registers": (os/kern) invalid argument (0x4)
Reading symbols from /Users/eswenson/its/ws/its/build/klh10/kn10-ks-its...
warning: unhandled dyld version (17)
0x0000000109697bcd in ?? ()
(gdb)
I'll rebuild and retry.
the memsiz is calculated in klh10.c memsiz = (size_t)PAG_SIZE * PAG_MAXPHYSPGS * sizeof(w10_t);
this is what I get in gdb
Attaching to process 33823
[New Thread 0x1703 of process 33823]
warning: Error calling thread_get_state for GP registers for thread 0x1703
warning: Mach error at "../../gdb/i386-darwin-nat.c:132" in function "fetch_registers": (os/kern) invalid argument (0x4)
Reading symbols from /Users/mikek/its-klh/build/klh10/kn10-ks-its...
warning: unhandled dyld version (17)
0x00007ff80e490e52 in ?? ()
(gdb) cont
Continuing.
[Inferior 1 (process 33823) exited normally]
(gdb)
Need to do a CONTINUE in GDB after attaching so it takes the input on the emulator side.
Yeah, I did. I got:
(gdb) cont
Continuing.
[Inferior 1 (process 7648) exited normally]
(gdb)
and in the gdb session:
MARK$G'
Format pack on unit #0[1] 7648 segmentation fault ./kn10-ks-its ../mchn/DB/nsalv.ini
So no help.
At least we are both seeing the same.
I do not think it has to do with the amount of memory the emulator tries to allocate I changed it to just try 50% of the allocation. No change in behavior.
What is the error code you’re getting from shmget?
The thing is I am not getting any error from shmget.
Are you getting a null pointer back? What is the value of errno?