OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Applications => Topic started by: OS4User on June 13, 2021, 10:26:39 am

Title: patched PmMerge
Post by: OS4User on June 13, 2021, 10:26:39 am
Any one brave to test ?  :)

http://gus.biysk.ru/os4/pmmerge/

Fixed:
  - a memory leak in a heap
  - missed serialization
  - access to freed memory
  - and many other small issues

Known bugs:
  -  none (so far)
Title: Re: patched PmMerge
Post by: Mike Kölling on June 13, 2021, 12:42:11 pm
Any one brave to test ?  :)

Just installed on my T430. No problems after restart so far. However I have no clue what pmmerge.dll is for.
Mike
Title: Re: patched PmMerge
Post by: David Graser on June 13, 2021, 02:27:26 pm
Installed to my ArcaOs 5.06 with all the latest patches and drivers and using the OS4 kernel.  Works great.

OS4User, I was wondering if you have heard or used NEWCALLS for OS/2 by Carsten Arnold and your opinion of this idea.  I have used it in the past with no adverse effects that I could see.  I am running the patch with your modified pmmerge.dll without any seen adverse effects so far.

http://ca-arnold.de/download/newcalls104.zip

patch for pmmerge.dll

The file PMMERGE.DLL opens the INI files with the flag
OPEN_FLAGS_WRITE_THROUGH which has the consequence that these files
are written uncached to the HD, so that the WPS is blocked partially
quite a long while. IBM made for exaggerated safety reasons,
in my opinion that is not necessary.

This Tool goes back on an idea from Peter Fitzsimmons.

At this the module entry DOSCALLS will replaced in pmmerge.dll by NEWCALLS.
The NEWCALLS.DLL contains so-called Forwarder on all functions in DOSCALLS
except DOS32OPEN, this function its by own _DOS32OPEN replaced.
If opening files, _DOS32OPEN removes the flag
OPEN_FLAGS_WRITE_THROUGH and calls then DOS32OPEN in DOSCALLS.

I wrote now a Installer and shortened the file NEWCALLS.DLL somewhat
(no, there now nothing is missing;-)).

Supplementary product like DLLRNAME are more necessary.


Installation:
Start the Install.exe without parameter.
The Installer checks the file PMMERGE.DLL and looks for the entry DOSCALLS.

Then it copies file NEWCALLS.DLL into the directory X:\OS2\DLL, whereby X is
the boot drive.

Since the file PMMERGE.DLL normally in use and thus to write is locked,
the installer unlock the DLL. Now the entry is replaced DOSCALLS by NEW CALLS.

So that the modification becomes effective, a Reboot is necessary.
It is not enough to start the WPS again.


If against expect it to disturbances comes, you can deinstall NEWCALLS also
again. Start InstNC.exe with the parameter /DeInst. The module entry NEWCALLS
is replaced again through DOSCALLS and the file NEWCALL.DLL is deleted.
A restart of the system becomes also here necessarily.

This program is freeware.

Title: Re: patched PmMerge
Post by: Rich Walsh on June 13, 2021, 03:08:25 pm
I was wondering if you have heard or used NEWCALLS for OS/2 by Carsten Arnold and your opinion of this idea.  I have used it in the past with no adverse effects that I could see.

And no benefits either. This was written 20 years ago when the author was probably running a P233 with 64mb and an IDE drive. What are you running today? Likely, something that's 20+ times faster. If say, WinOS/2, used to take 7 seconds to open and nowadays it opens instantly, what are the chances that a write to 'os2.ini' still has any meaningful impact on performance?
Title: Re: patched PmMerge
Post by: David Graser on June 13, 2021, 03:17:20 pm
Thanks Rich for the feedback.

Rich, what is your opinion on this patch?  The last time I checked, ArcaOS was still using build 14.006.

http://hobbes.nmsu.edu/download/pub/os2/system/patches/PMFIX.zip

THIS INFORMATION IS WITHOUT ANY WARRANTY. USE AT YOUR OWN RISK.
I AM NOT RESPONSIBLE FOR ANY DAMAGE CAUSED BY USING THIS PACKAGE.


This package contains 2 Fixes to PMMERGE.DLL Build 14.006.
This build was released by IBM as pj31908 and is also part of many ECS 2.0 
and ECS 2.1 releases.

DESCRIPTION
FIX1: SYS3171 (Stack Overflow) on PMSHELL.EXE and others.

When clicking on an inactive program to get focus on it, the program crashes.
This behaviour is mainly seen when running VPC as host.
When starting several programs by fastly clicking on their icons PMSHELL may die.
A reboot is necessary to get the system back to life.

The cause for this behaviour is within function CallOemPointer.
It is used to send drawing commands to the graphics system.
Under certain conditions, this function calls WIN32SENDMSG.
If the function was called as a result of message processing, a loop may be established.
This causes the stack to be filled within the loop, ending with SYS3171.

The file named PM_SYS3171 patches CallOemPointer to not call SENDMSG anymore.
This behaviour is similar to PMMERGE Builds 14.095 and earlier.
Side effect may be lost mouse clicks when system is busy but I use this Patch
for over a Year now with no noticeable drawbacks.


FIX2: USING PM_SystemFonts->DefaultFont CHANGES ALL FORM SIZES

When setting PM_SystemFonts->DefaultFont to anything smaller than SystemProportional
many other forms (such as the settings pages of the WPS) have too small text items.
Also the height of titlebars on all windows is changed. 

The file named PM_DEFFONT patches the initial processing of pmmerge to using fixed
fontsize (using the values from SystemProportional).
So don't use this patch if you are pleased using the DefaultFont setting already.
Side effect: The IBM Help Viewer looks strange, don't know why.
Use NewView instead.



HOW TO APPLY THIS FIX

1. Make shure, you are using PMMERGE.DLL 14.106 using bldlevel utility.

2. Make a bakup of your original PMMERGE.DLL

3. Make shure that you are able to boot from disc or maintainance partition.
   Be shure! You cannot start the system with a corrupted PMMERGE!

4. Get lxlt133 from the web and unpack it into a temporary directory.
   On ECS 2.1 lxlite is already installed.

5. Copy PMMERGE.DLL to the temporary directory.

6. Expand PMMERGE.DLL using lxlite.exe, file size should be 1754169 bytes.

7. Copy the *.PAT files to the temporary directory.

8. Run PATCH.EXE PM_SYS3171.PAT /A to apply fix1

9. Run PATCH.EXE PM_DEFFONT.PAT /A to apply fix2
Title: Re: patched PmMerge
Post by: Andreas Schnellbacher on June 13, 2021, 03:44:39 pm
I have both of Holger's patches applied since years. I never noticed a problem without and with fix 1, but since the Mozilla times it was hard to say what really caused the countless crashes.

I recommend fix 2, because then dialog sizes adjust perfectly to a set font for PM_SystemFonts -> DefaultFont. (This value is usually unset, which defaults. to 10.System Proportional. I've mine set to 9. WarpSans.

The only problem is that IBM's view.exe has problems with that and e.g. the buttons are resized, but their font don't fit in the reduced size. That app doesn't seem to comply with PM rules. (Holger already has mentioned this problem in the readme.)

In eCS times Alex wrote that Asian fonts have problems with this patch. That's probably the main reason why it didn't make it into a later eCS.
Title: Re: patched PmMerge
Post by: OS4User on June 13, 2021, 05:40:25 pm
OS4User, I was wondering if you have heard or used NEWCALLS for OS/2 by Carsten Arnold and your opinion of this idea.

I have not seen it before and  just checked it.   And  so far agree with Rich - it does not have big sense now,  however can be easily added to  discussed pmmerge.
Title: Re: patched PmMerge
Post by: OS4User on June 13, 2021, 05:43:13 pm
No problems after restart so far. However I have no clue what pmmerge.dll is for.
Mike

tnx for testing.  pmmerge.dll  is a main dll which contains  code of Presentation Manager. 
Title: Re: patched PmMerge
Post by: David McKenna on June 13, 2021, 06:04:21 pm
 Been running this test PMMERGE.DLL for a couple hours now and it seems OK. One thing I notice is a 3 note beep from the system speaker right when the desktop appears at boot. This doesn't happen when using the ArcaOS PMMERGE. Not sure if this is a signal from the test version, or some other system component complaining...
Title: Re: patched PmMerge
Post by: OS4User on June 13, 2021, 06:26:12 pm
One thing I notice is a 3 note beep from the system speaker right when the desktop appears at boot.

this is a signal from the test version  :)
Title: Re: patched PmMerge
Post by: Eugene Tucker on June 13, 2021, 07:24:56 pm
OS4User it is running without problem on my machine as well. I wil keep shaking it down and let you know.
Title: Re: patched PmMerge
Post by: Martin Iturbide on June 14, 2021, 01:47:05 am
... However I have no clue what pmmerge.dll is for.
Hi Mike

At EDM/2 we try to document each OS/2 file. Here it is more information about PMMERGE.DLL (http://www.edm2.com/index.php/PMMERGE.DLL).

Regards
Title: Re: patched PmMerge
Post by: David Graser on June 14, 2021, 02:55:14 am
I play around with a lot of graphics.  At some point I always have a hang.  PMView would lock the system or FM/2 would lock the system occasionally when I had several instances of PMView opened along with iconedit.  So far, I am not seeing this with the patched PMMerge.dll
Title: Re: patched PmMerge
Post by: Dariusz Piatkowski on June 14, 2021, 03:00:37 am
Hello OS4USER,

Any one brave to test ?  :)

http://gus.biysk.ru/os4/pmmerge/
...

Alright...got a problem to report.

So during the boot the normal BLUE screen right before transition to WPS happens is missing, the displays actually go black as if the video signal is cut off, then by the time both displays come back I go straight into the WPS Desktop. Normally this only happens after the BLUE screen pops up, a little clock-icon after and than WPS is up.

Weird, but OK so far.

The problem is that attempting to run Lucide right after (repeated this twice) gives me a non-responsive WPS. Only CAD-Helper gets me out of the problem, the Re-boot option that is.

I haven't tried any other apps yet since I figured I would report this first and test any other specifics you might be interested in?

FYI, this is a 4.52 SMP setup (6-core AMD CPU), 202 kernel, latest ACPI, SNAP drivers, dual-screen (1920x1200 x 2).

Thanks!
Title: Re: patched PmMerge
Post by: Mike Kölling on June 14, 2021, 11:55:41 am
No problems after restart so far. However I have no clue what pmmerge.dll is for.
Mike

tnx for testing.  pmmerge.dll  is a main dll which contains  code of Presentation Manager.

Thanks for the information about pmmerge.dll.
Martin, - also thanks to you for information about the dll.

Put it also in my TP X250 today (with AOS) - runs there as well as on my T430.

Mike
Title: Re: patched PmMerge
Post by: Bernhard Pöttinger on June 15, 2021, 03:48:05 pm
I have installed it on my W520 and my X1 Carbon notebook. Both with ArcaOS 5.0.6. No problems so far.

best regards
Bernhard
Title: Re: patched PmMerge
Post by: Mikhail on June 15, 2021, 11:57:49 pm
Works well on AOS 5.06 kernel-2.02 & OS/4
I didn't find any problems!
Thank OS4USER. bip-bip-bip
Title: Re: patched PmMerge
Post by: OS4User on June 17, 2021, 11:28:48 am
So during the boot the normal BLUE screen right before transition to WPS happens is missing, the displays actually go black as if the video signal is cut off, then by the time both displays come back I go straight into the WPS Desktop. Normally this only happens after the BLUE screen pops up, a little clock-icon after and than WPS is up.

Weird, but OK so far.

I also recognized  some improvement during the boot.

The problem is that attempting to run Lucide right after (repeated this twice) gives me a non-responsive WPS. Only CAD-Helper gets me out of the problem, the Re-boot option that is.

It is not necessarily  a bug in pmmerge.  It is hard to say.

I haven't tried any other apps yet since I figured I would report this first and test any other specifics you might be interested in?

Nothing special, just observe  what has improved  and what has degraded.
Title: Re: patched PmMerge
Post by: Mike Kölling on June 17, 2021, 02:04:19 pm
I just realized that my Thunderbird doesn't crashes anymore. Usually I start Firefox and Thunderbird in the morning. After some time (an hour or so) Thunderbird freezes and must be killed using C-A-D or TOP. Since the new pmmerge.dll Thunderbird stopped freezing, which is quite nice.
I don't know if the new pmmerge.dll solved the issue or if I am just being biased  ;).

Greetings,
Mike
Title: Re: patched PmMerge
Post by: Dariusz Piatkowski on June 17, 2021, 02:29:16 pm
...
I haven't tried any other apps yet since I figured I would report this first and test any other specifics you might be interested in?

Nothing special, just observe  what has improved  and what has degraded.
Well, what my report was intended to convey is the fact that using the patched pmmerge.dll no longer provides a working system. So that in my book would be a major degradation.

My follow-up question was asking how else you think we could track down what's causing the problem?
Title: Re: patched PmMerge
Post by: OS4User on June 17, 2021, 03:05:34 pm
My follow-up question was asking how else you think we could track down what's causing the problem?

pls suggest  what  should I do to repeat you case on my comp ?
Title: Re: patched PmMerge
Post by: Dariusz Piatkowski on June 17, 2021, 04:59:04 pm
My follow-up question was asking how else you think we could track down what's causing the problem?

pls suggest  what  should I do to repeat you case on my comp ?

Honestly I wish I could provide a suggestion, but given that I'm running a dual-screen setup here with SNAP drivers, whatever PMMERGE DLL is managing, which I believe is the majority of the Presentation Manager calls that are most likely closely interacting with the display drivers, I suspect can only be debugged on my specific hardware.

So is there a possibility for us to do some kind of a TRACE on this?

I am at a loss, but you had asked for feedback, so I provided my results. I will have a little more time later today so let me re-deploy that DLL and see if any other applications cause the same issue.
Title: Re: patched PmMerge
Post by: OS4User on June 17, 2021, 06:17:18 pm
So is there a possibility for us to do some kind of a TRACE on this?

I have no idea how to do that.  In archive sub dir  you  can find previous ver  of pmmerge   -  you can try to find last good for your system.
Title: Re: patched PmMerge
Post by: Dariusz Piatkowski on June 18, 2021, 03:21:47 pm
So is there a possibility for us to do some kind of a TRACE on this?

I have no idea how to do that.  In archive sub dir  you  can find previous ver  of pmmerge   -  you can try to find last good for your system.
I understand and can appreciate that. Thank you!

FYI, I repeated my tests with other applications, found out that each time I opened a PM app the WPS become frozen. CAD Pop-up followed by a Re-boot got me out.
Title: Re: patched PmMerge
Post by: Lars on June 18, 2021, 07:06:03 pm
kernel W4, 14.201_a, eCS 2.2 beta, running with 1 core unter Virtualbox:

directly traps with a Ring 0 trap on boot. The trap triggers in DOSCALL1.DLL, but the actual Ring 0 trap happens in PMDD.SYS:

 Slot  Pid  Ppid Csid Ord  Sta Pri  pTSD     pPTDA    pTCB     Disp SG Name
*0019# 0015 0014 0015 0001 run 0300 f9f9f000 fefb59e0 feef840c 0ee8 00 DHCPSTRT
 
eax=7cd00047 ebx=0000efc0 ecx=00000007 edx=00000020 esi=0004a338 edi=26cb0000
eip=0000c541 esp=0008ef98 ebp=0004a30c iopl=2 -- -- -- nv up ei pl nz na pe nc
cs=ffef ss=0047 ds=0053 es=0053 fs=150b gs=0000  cr2=00000000  cr3=00200000
ffef:0000c541 66ea6477fc1f5b00 jmp       005b:1ffc7764


# ln ffef:c541
 
ffef:0000c53c DOSCALL1 UT32_TARGET + 5


# ln %1ffc7764
 
%1ffc7764 DOSCALL1 UT32_RETURN

The instruction directly before the "jmp" is an (indirect) call to DOSDEVIOCTL, in case that matters. But I would think it is a IOCTL call into PMDD.SYS.
 



# .maamc ffef:c541
 
 
*har     par      cpg        va    flg next prev link hash hob   hal
 0119 %feb98830 00000010 %1ffd0000 3d9 0118 011a 0000 0000 0132 0000  hco=00164
 hob   har hobnxt flgs own  hmte  sown,cnt lt st xf
 0132  0119 0000  0838 012a 012a  0000 00  00 00 00 shared    c:doscall1.dll
 hco=00164 pco=ffe0970f  hconext=00130 hptda=0531 f=1c  pid=0016 c:dhcpcd.exe
 hco=00130 pco=ffe0960b  hconext=000e3 hptda=0469 f=1c  pid=0015 c:dhcpstrt.exe
 hco=000e3 pco=ffe0948a  hconext=00107 hptda=0459 f=1c  pid=0014 c:dhcpstrt.com
...


#
                        TRAP SCREEN INFORMATION
OS/2 Kernel Revision 14.201_W4
Exception in module: PMDD   
 TRAP 000d       ERRCD=0000  ERACC=****  ERLIM=********
EAX=7cd00000  EBX=f9f902f2  ECX=00000020  EDX=0000005b
ESI=feef0000  EDI=26cb0010  EBP=00045bf8  FLG=00012292
CS:EIP=0d00:00000a8b  CSACC=009b  CSLIM=00000d10
SS:ESP=0030:00005b8c  SSACC=1097  SSLIM=00004ebf
DS=0cf8  DSACC=0093  DSLIM=000000d0  CR0=8001003b
ES=0000  ESACC=****  ESLIM=********  CR2=1fec9b80
FS=0000  FSACC=****  FSLIM=********
GS=0000  GSACC=****  GSLIM=********

I have a full trap dump, in case that helps.

Title: Re: patched PmMerge
Post by: OS4User on June 20, 2021, 11:59:14 am
kernel W4, 14.201_a, eCS 2.2 beta, running with 1 core unter Virtualbox:

Is  anything  in comport ?  Try  SMP/UNI kernel  or OS/4 kernel.
Title: Re: patched PmMerge
Post by: Igor on June 21, 2021, 01:12:18 pm
Everything works great on two different computers. One of them is a server in constant uptime.
Title: Re: patched PmMerge
Post by: Igor on June 24, 2021, 07:45:12 pm
I offer two tests. Both of me freeze any system. I wonder how it will be with you?
http://ru2.halfos.ru/1/teststart.zip (http://ru2.halfos.ru/1/teststart.zip)
http://ru2.halfos.ru/1/teststart2.zip (http://ru2.halfos.ru/1/teststart2.zip)

Tests go through 10 000 cycles and stop in a good case and freeze earlier in a bad one.
Title: Re: patched PmMerge
Post by: Lars on June 24, 2021, 08:22:25 pm
With the already mentioned config and with the ORIGINAL pmmerge, I do not get a hang on either testcase.
However, teststart2 eventually reports this:

SYS0008: There is not enough memory available to process this command.
All available memory is in use.

However, I cannot see memory depleting, therefore I think the root cause if something else. In any case, this seems to be a bug in the REXX interpreter.

What I can also see for testcase2 is that the initial window does not properly draw which might be a PM problem.
If this stuff crashes for you then there might be an SMP issue with PM (as I am only running on one core). I wouldn't be surprised.
Title: Re: patched PmMerge
Post by: Lars on June 24, 2021, 08:29:01 pm
Actually, it might indeed be a memory problem: a couple of secondary windows are created (and closed with exit) until I get a bunch of memory error messages, obviously one error message per attempt to open an additional window.

It's possible that PM (including the PM drivers) has some problem allocating memory. Potentially, because they have to allocate from some limited memory pool or region.
Title: Re: patched PmMerge
Post by: Igor on June 24, 2021, 09:04:58 pm
With the already mentioned config and with the ORIGINAL pmmerge, I do not get a hang on either testcase.
However, teststart2 eventually reports this:

SYS0008: There is not enough memory available to process this command.
All available memory is in use.

However, I cannot see memory depleting, therefore I think the root cause if something else. In any case, this seems to be a bug in the REXX interpreter.

What I can also see for testcase2 is that the initial window does not properly draw which might be a PM problem.
If this stuff crashes for you then there might be an SMP issue with PM (as I am only running on one core). I wouldn't be surprised.
Thank you for the error message! This is a very important point that I could not get on the SMP system. Perhaps another process is trying to still use the memory that is no longer left. And there is freezing.
Title: Re: patched PmMerge
Post by: Igor on June 24, 2021, 09:47:31 pm
Actually, it might indeed be a memory problem: a couple of secondary windows are created (and closed with exit) until I get a bunch of memory error messages, obviously one error message per attempt to open an additional window.

It's possible that PM (including the PM drivers) has some problem allocating memory. Potentially, because they have to allocate from some limited memory pool or region.
I have had success by decreasing the disk cache. This is a lack of kernel memory. In multiprocessor machines, the error message is not issued and the system is frozen.
Title: Re: patched PmMerge
Post by: andreas on June 25, 2021, 12:12:13 am
i'm not sure if it's related to pmmerge, but recently i have repeatedly the same strange problem while moving files from one folder to another. 
in my folder i have around 200 text files. i wanted to move some bundles (each around 10 files) to different folders by drag and drop.
This works fins 3 or 4 times. then - without having changed anything - my next round fails. i get that blocking sign.
when i now try "pickup" i can only chose "cancel drag".
next strange thing: i now tried to use FM/2 to do the job. But FM/2 just doesn't start.
Wanted to check it with pm-dll, but that one alsp refuses to start.
Both programs (and drag and drop) work after a reboot.
But i had that strange effect now 3 times in a row..

when this happens not only the files from that folder won't be able to get moved, but any object on the wps (folders, programs and data-files)

Never realized that before i installed the new pmmerge ...
Title: Re: patched PmMerge
Post by: OS4User on June 25, 2021, 06:54:01 am
Never realized that before i installed the new pmmerge ...

try the same with old pmmerge
Title: Re: patched PmMerge
Post by: Gregg Young on July 01, 2021, 11:57:37 pm
Hi

I tried your patched. It failed the teststart2 test with an out of resources message. The pmerge with the stack overflow patch mention by David ran this test to completion. The pmmerge 6111 also clips the dialogs in eFTEPM (see attached).
Title: Re: patched PmMerge
Post by: Andreas Schnellbacher on July 02, 2021, 12:38:43 am
The clipped text is caused by using 9.WarpSans as the font for dialogs. The ini key for this is PM_SystemFonts -> DefaultFont. The default value is 10.System Proportional. If you add the key and change it to another font, dialog texts don't fit in their controls. As I wrote before, Holger's patch fixes this for fonts like 9.WarpSans. As Alex wrote, it dosn't work well with DBCS fonts.

So no wonder that you see the same text clipping with the OS/4 version as with the IBM version.

Interesting that Holger's other patch makes it pass Igor's teststart2.
Title: Re: patched PmMerge
Post by: OS4User on July 02, 2021, 08:00:09 am
I tried your patched. It failed the teststart2 test with an out of resources message. The pmerge with the stack overflow patch mention by David ran this test to completion. The pmmerge 6111 also clips the dialogs in eFTEPM (see attached).

could you try the same on not patched IBM pmmerge ?
Title: Re: patched PmMerge
Post by: andreas on July 02, 2021, 04:40:17 pm
I tried your patched. It failed the teststart2 test with an out of resources message. The pmerge with the stack overflow patch mention by David ran this test to completion. The pmmerge 6111 also clips the dialogs in eFTEPM (see attached).

could you try the same on not patched IBM pmmerge ?

tried. have the same problem with the old pmmerge. so may problem is not related to the new version. sorry for my wrong assumption.
Title: Re: patched PmMerge
Post by: OS4User on July 02, 2021, 09:01:45 pm
I tried your patched. It failed the teststart2 test with an out of resources message. The pmerge with the stack overflow patch mention by David ran this test to completion. The pmmerge 6111 also clips the dialogs in eFTEPM (see attached).

could you try the same on not patched IBM pmmerge ?

tried. have the same problem with the old pmmerge. so may problem is not related to the new version. sorry for my wrong assumption.

It is ok :) .  Tnx for testing.
Title: Re: patched PmMerge
Post by: andreas on July 06, 2021, 09:16:30 pm
I tried your patched. It failed the teststart2 test with an out of resources message. The pmerge with the stack overflow patch mention by David ran this test to completion. The pmmerge 6111 also clips the dialogs in eFTEPM (see attached).

could you try the same on not patched IBM pmmerge ?

tried. have the same problem with the old pmmerge. so may problem is not related to the new version. sorry for my wrong assumption.

It is ok :) .  Tnx for testing.

not only testing, using your version now. thanks for programming!