OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Applications => Topic started by: Neil Waldhauer on July 10, 2023, 06:32:35 pm

Title: Registry editor
Post by: Neil Waldhauer on July 10, 2023, 06:32:35 pm
I'm using \OS2\SYSTEM\REGEDIT2.EXE. If I open the HINI_USER_PROFILE, then all is well. But if I open the OS2.INI file on another drive, then the REGEDIT2 closes with a new entry created in POPUPLOG.OS2.

Code: [Select]
07-10-2023  09:17:53  SYS3171  PID 0046  TID 0001  Slot 001b
H:\OS2\SYSTEM\REGEDIT2.EXE
c0000005
1ffc1b8c
P1=00000002  P2=001bfffc  P3=XXXXXXXX  P4=XXXXXXXX 
EAX=1a390000  EBX=1a533434  ECX=001c0018  EDX=00000014
ESI=1a661a44  EDI=1a390650 
DS=0053  DSACC=d0f3  DSLIM=bfffffff 
ES=0053  ESACC=d0f3  ESLIM=bfffffff 
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:1ffc1b8c  CSACC=d0df  CSLIM=bfffffff
SS:ESP=0053:001c0000  SSACC=d0f3  SSLIM=bfffffff
EBP=001c0044  FLG=00010202

DOSCALL1.DLL 0002:00001b8c

I can recreate this by accessing the same INI file using REXX function SysIni, although the exception location is different.
Title: Re: Registry editor
Post by: Dave Yeo on July 10, 2023, 10:46:19 pm
Broken INI file? Does it work when booted to that drive? Can you boot to that drive and try cleaning the ini files?
Title: Re: Registry editor
Post by: ivan on July 10, 2023, 11:47:04 pm
I think you are using the wrong tool to read the ini file.

Saying it is HINI user profile it sounds as if that has been written by Peter Moyland's program to make ini files human readable.  if that is the case all you need is a text editor to read it.readable.   
Title: Re: Registry editor
Post by: Doug Bissett on July 11, 2023, 01:07:56 am
Quote
I think you are using the wrong tool to read the ini file.
.

No. REGEDIT2.EXE is a proper registry file editor (doesn't mean that it doesn't have a bug), and it has nothing to do with Peter Moylan's work.

Quote
I'm using \OS2\SYSTEM\REGEDIT2.EXE. If I open the HINI_USER_PROFILE, then all is well. But if I open the OS2.INI file on another drive, then the REGEDIT2 closes with a new entry created in POPUPLOG.OS2.

I am not getting a POPUPLOG.OS2, but the INI file has been modified by other things.

The first thing, that I would try, is a different INI editor. I have used some of them (from HOBBRS), in the past, but don't have one installed now.
Title: Re: Registry editor
Post by: Lars on July 11, 2023, 10:27:14 pm
I used regedit2 to access my OS2.INI on drive E: from my system on drive D: and had no problems.
1) check if your OS2.INI you are trying to access is corrupt
2) check for file attributes. For some reason my OS2.INI and OS2SYS.INI on drive E: only have the "A" attribute set while the ones on the D: drive have the "RSA" attributes set. But maybe the file attributes are changed when these files are opened during system start
Title: Re: Registry editor
Post by: Neil Waldhauer on July 12, 2023, 03:25:46 pm
I get the crash consistently on my computers here. The crash is the same with regedit or SysIni called from REXX. The workplace shell is unable to function after the crash.

I tried some tools from Hobbes, but mostly they behave the same. I tried quite a few boots, but all are well developed OS/2 installations with plenty of entries in OS2.INI. These systems all are working well, so I doubt there is significant corruption of any OS2.INI file.

I aslo tried rwINI from Hobbes. This is an alternative to SysIni. That works fine. SysIni works fine when booted from CD.

Perhaps SysIni (and the Prf... functions) cannot have two full-sized INI files in memory, but a tiny OS2.INI on a bootCD is OK.

Another interesting quirk is that if I boot from C:, then I cannot open C:\OS2\OS2.INI, but I can access the same file as 'USER'. The rwINI package documents this limitation. The system uses the OS2.INI file, so that will always be open while I work.
Title: Re: Registry editor
Post by: Lars on July 13, 2023, 08:25:34 am
I had opened both, OS2.INI and OS2SYS.INI (of the non-boot partition) via the profile loading function of regedit2 at the same time and that was not a problem. I even opened more profile files (in the end, it was about 5 different files) and that also was not a problem.

I think your assumption is correct that rwINI will not use the ordinary Prf... API functions but will read and parse the profile file contents directly. That will likely avoid some problems with shared mem etc.

Maybe, this problem is related to shared memory (if the Prf... API functions are used), in particular if your OS2.INI and OS2SYS.INI files are very big.

Side note: I can open OS2.INI from my boot partition by using the profile loading function of regedit2.
Title: Re: Registry editor
Post by: Neil Waldhauer on July 13, 2023, 03:20:44 pm
I wonder if my ini files are a "normal" size.

Directory of  H:\os2\os2*.ini

7-13-23   6:18       2,123,544      0  OS2.INI
7-12-23   9:03         305,745      0  OS2SYS.INI
Title: Re: Registry editor
Post by: Lars on July 13, 2023, 03:47:18 pm
I wonder if my ini files are a "normal" size.

Directory of  H:\os2\os2*.ini

7-13-23   6:18       2,123,544      0  OS2.INI
7-12-23   9:03         305,745      0  OS2SYS.INI

That's about the size that they have on my system. But I should mention that I still use eCS (with driver updates) and I have no clue what AN changed in addition. I doubt that it helps but you could also try to change the VIRTUALADDRESSLIMIT value (I still think your issue is shared memory related so that might have a bearing on the problem).

What is size/date/bldlevel string of your DOSCALL1.DLL ?

What is really odd is this combination:
Code: [Select]
P1=00000002  P2=001bfffc  P3=XXXXXXXX  P4=XXXXXXXX
SS:ESP=0053:001c0000  SSACC=d0f3  SSLIM=bfffffff
EBP=001c0044  FLG=00010202

That means the program failed when it tried to write (P1=2) 4 Bytes to address 1bfffc (P2) which is just 4 bytes below ESP (EBP pointing well above ESP which is what can be expected). That would mean, you have hit the bottom of the stack / hit guard page of the stack without the OS commiting a new memory page for the stack. Either regedit2 stack is too small (I doubt that) or some recursion happened that ate all of the stack. I think that would point to a problem with the INI file. Even if it does not give you a problem during operation, might want to try an ini file cleaner.
Title: Re: Registry editor
Post by: Dave Yeo on July 13, 2023, 04:38:11 pm
I wonder if my ini files are a "normal" size.

Directory of  H:\os2\os2*.ini

7-13-23   6:18       2,123,544      0  OS2.INI
7-12-23   9:03         305,745      0  OS2SYS.INI

On the big side, here on a fairly old install,
Quote
OS2.INI     ░│ 1364651│13/07/23│ 7:30a
OS2SYS.INI  ░│  136259│13/07/23│ 7:28a
Title: Re: Registry editor
Post by: Dariusz Piatkowski on July 14, 2023, 03:58:53 pm
I wonder if my ini files are a "normal" size.

Directory of  H:\os2\os2*.ini

7-13-23   6:18       2,123,544      0  OS2.INI
7-12-23   9:03         305,745      0  OS2SYS.INI

Code: [Select]
6-30-23  3:03p     3,534,209      0 ----  OS2.INI
6-30-23  3:03p       600,592      0 ----  OS2SYS.INI

The OS2SYS.INI in particular continues to be a problem for me...sizewise its BIG and pretty much near the edge of managable. I say this b/c I am routinely seeing shutdown errors writing to that INI (after reboot it is corrupted and normally truncated to literally half that size).

Needless to say, multiple cleanup efforts have failed to shrink it down below that 550-600K size.
Title: Re: Registry editor
Post by: ivan on July 14, 2023, 06:03:25 pm
Looks as if you need to have a look inside it and remove the extraneous junk.

I have attached iniedit120 which will allow that (you have to select os2sys.ini from the menu).
Title: Re: Registry editor
Post by: roberto on July 15, 2023, 12:10:36 pm
I have :
15/07/23 11:53      3.149.374      0 a--r  OS2.INI
15/07/23 11:53      1.145.424      0 a--r  OS2SYS.INI
No problems,  I edit with C:\SYS\APPS\FM2\FM2TOOLS\INI.EXE INI Viewer
I only have in desktop one folther and trash can, in all my os2 arcaos systems for many years:
Directory of C:\desktop

 8/07/23 15:37          <DIR>    817 a---  .
 8/07/23 15:37          <DIR> 18.990 a---  Escritorio
21/04/20 13:07          <DIR>    619 a---  Trash Can
saludos
Title: Re: Registry editor
Post by: Andi B. on July 15, 2023, 02:05:05 pm
My inis are currently quite big -
Code: [Select]
15.07.23  13.13       3.500.039      0   R_SA_  OS2.INI
15.07.23  13.13         457.587      0   R_SA_  OS2SYS.INI

Just started checkini / cleanini but that didn't help much.
Title: Re: Registry editor
Post by: ivan on July 15, 2023, 05:05:50 pm
I think the main problem is that most of the ini cleaners only look at OS2.INI not OS2SYS.INI.  Almost all of them do a good job of cleaning up OS2.INI but iniedit120 is the only one I have found that allows looking at OS2SYS.INI.

XFIX from XWORKPLACE is also very good at cleaning OS2.INI but doesn't do OS2SYS.INI which is a pity.
Title: Re: Registry editor
Post by: Rich Walsh on July 15, 2023, 07:11:47 pm
XFIX from XWORKPLACE is also very good at cleaning OS2.INI but doesn't do OS2SYS.INI which is a pity.

XFix works exclusively on OS2SYS.INI.

 Here's what a well-maintained system looks like (after mowing the grass, trimming the bushes, and pulling a bunch of weeds):

Code: [Select]
7-15-23 12:54p       753,122      0 as-r  OS2.INI
7-15-23 12:50p       109,048      0 as-r  OS2SYS.INI
Title: Re: Registry editor
Post by: ivan on July 15, 2023, 08:29:40 pm
Sorry Rich, I have had it set to read OS2.INI almost since it first became available that I considered it to be the default setting.
Title: Re: Registry editor
Post by: Andi B. on July 16, 2023, 10:56:07 am
Unimaint / Inimait are also editors for the ini files and can cleanup things.
Title: Re: Registry editor
Post by: Lars on July 17, 2023, 11:59:00 am
My inis are currently quite big -
Code: [Select]
15.07.23  13.13       3.500.039      0   R_SA_  OS2.INI
15.07.23  13.13         457.587      0   R_SA_  OS2SYS.INI

Just started checkini / cleanini but that didn't help much.

What potentially could help is to write a tool that reads these INIS, application per application and key per key and writes the application/key pairs back to a new INI file that needs to be swapped in/replaces the original on the next system restart.

I suspect that the Prf API is not really good at compressing the INI file, if keys are removed, truncated and/or subsequently enlarged. The only thing that will then (hopefully) help is to actually create a new INI file.

I do not know if checkini/cleanini work this way.
Title: Re: Registry editor
Post by: Tom on July 17, 2023, 01:32:45 pm
I suspect that the Prf API is not really good at compressing the INI file, if keys are removed, truncated and/or subsequently enlarged. The only thing that will then (hopefully) help is to actually create a new INI file.

I do not know if checkini/cleanini work this way.

Using checkini from Henk Kelder (part of the WPTools package) seems to work that way: if you tell it to remove things, it produces smaller ini files (and saves a backup copy of the original ini files, if desired). Don't know about cleanini (never used it).
Title: Re: Registry editor
Post by: Rich Walsh on July 17, 2023, 06:28:47 pm
I suspect that the Prf API is not really good at compressing the INI file, if keys are removed, truncated and/or subsequently enlarged. The only thing that will then (hopefully) help is to actually create a new INI file.

INI files have no dead entries, slack space, etc. so rewriting the files will have no effect.

The only solution for an oversized os2.ini is manual maintenance. There is no way for an automated tool to know that a given entry belongs to some app that you deleted 2 years ago. Only you know that, so only you can make the informed decision to delete it.

Open an INI editor and scan the list of "Applications" (the top-level key) for entries that are clearly obsolete, then delete them. Next, look for stuff you seldom use. Often the only key associated with the application is "WNDPOS" or "WindowPos" which (as the name says) describes the position and size of the app's main window. If so, delete the application (not just the key) - when you next open the app, its window will open at its default size and location. Do NOT touch any "Application" whose name starts with "PM_" or "PMWP_", or for that matter, anything you don't recognize (often the names of the keys or their data will help identify the origin of an entry).

One tool that may help a bit is my 'Iconomize' util which displays an app's assigned icon and its default icon side-by-side. If the two match (or you don't care about the custom icon), delete it. This can save 4-11k per entry.

BTW... don't even think of editing 'os2sys.ini' manually.