Author Topic: Unzip Version 6.0 hangs when booting to a commandline  (Read 13821 times)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5029
  • Karma: +113/-1
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #15 on: July 30, 2024, 12:47:35 am »
Here's a build using the old EMX build flags, so no libcx or libbz2, to test.
Edit: add wildcard support
« Last Edit: July 30, 2024, 12:51:49 am by Dave Yeo »

Lars

  • Hero Member
  • *****
  • Posts: 1362
  • Karma: +70/-0
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #16 on: July 30, 2024, 11:10:13 am »
Thanks Dave,

but your test build hangs in the very same way. What I now found out: if it hangs and if I hit Ctrl-C, after about 20 seconds or so, the program will be terminated. This however only works once. If I try a second time, the system hangs solid.

What I can also observe is quite some disk activity if I hit Ctrl-C for the first time (until the program finally terminates). I'll have to check if POPUPLOG.OS2 is written ...

Andi B.

  • Hero Member
  • *****
  • Posts: 867
  • Karma: +13/-2
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #17 on: July 30, 2024, 12:30:59 pm »
Lars, do you have any chance to start it in OpenWatcom Debugger (wd.exe)?

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5029
  • Karma: +113/-1
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #18 on: July 30, 2024, 05:00:20 pm »
Well. at least that means it is a libcn problem. I could build a debug copy of unzip if you think it would help.
Perhaps better would be to try the logging version of libcn, @unixroot/usr/lib/log/libcn0.dll I believe. You have to swap it with the usual libcn and reboot, libpathstrict does not work with libc. See https://trac.netlabs.org/libc/wiki/LibcLogging.
@Andi, the OpenWatcom debugger won't work, need to use a native debugger.

Andi B.

  • Hero Member
  • *****
  • Posts: 867
  • Karma: +13/-2
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #19 on: July 30, 2024, 05:20:09 pm »
...
@Andi, the OpenWatcom debugger won't work, need to use a native debugger.
I thought I had it up and running long time ago. But maybe my memory is wrong.

What I did some time ago was booting up to command line with netbios drivers enabled and the watcom debug/netbios driver and remote debugged a cli program from another machine with wdw. I saw (wdw told me) that my cli program wanted to call a ..... (?) function which wasn't available when booted up only to cli without pmshell.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5029
  • Karma: +113/-1
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #20 on: July 30, 2024, 11:31:26 pm »
Perhaps it was a program compiled with OW. Wlink was patched by Knut years back to support, I think it's HLL debug data, now merged into OW.
GCC, you need -g for debug data and link with -Zomf, then idebug etc will work. At least sd86 will allow remote debugging over tcpip, not sure about the other IBM debuggers and whether they support remote debugging.

Lars

  • Hero Member
  • *****
  • Posts: 1362
  • Karma: +70/-0
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #21 on: July 31, 2024, 12:31:06 am »
Well. at least that means it is a libcn problem. I could build a debug copy of unzip if you think it would help.
Perhaps better would be to try the logging version of libcn, @unixroot/usr/lib/log/libcn0.dll I believe. You have to swap it with the usual libcn and reboot, libpathstrict does not work with libc. See https://trac.netlabs.org/libc/wiki/LibcLogging.
@Andi, the OpenWatcom debugger won't work, need to use a native debugger.

Hi Dave,

thanks for the hint. I now did as you suggested and I get the attached as a result. The system hung solid so the last log entry was the last thing that was logged. I am beginning to suspect it is because KLIBCCFG.DLL pulls in so many things, for example FFST (I had a look at KLIBCCFG.DLL with PM DLLTree).

And here comes the biggest problem: _kLIBCInitPath in KLIBCCFG.DLL will likely read its transformed paths from INI file %ETC%\klibccfg.ini where I suspect, it uses the profile API calls. I think, those will only work if PM is up and running.

In short: every program built with kLIBC depends on PM being loaded. I tested this by setting RUNWORKPLACE to cmd.exe (therefore only booting with PM but without the WPS) and then running unzip.exe from that commandline and that worked ok.

The solution would be to replace the profile API calls in KLIBCCFG.DLL against calls that directly work on the binary .INI files. I think XWorkplace also does that.
« Last Edit: July 31, 2024, 01:23:58 am by Lars »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5029
  • Karma: +113/-1
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #22 on: July 31, 2024, 03:17:30 am »
Makes sense that is why it is failing hard. Guess an issue should be raised at Bitwise's Github, not good having everything built against libc dependent on the PMShell.

Lars

  • Hero Member
  • *****
  • Posts: 1362
  • Karma: +70/-0
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #23 on: July 31, 2024, 08:13:35 am »
I cannot find the source code for klibccfg.dll. I'll contact Silvan.

Lars

  • Hero Member
  • *****
  • Posts: 1362
  • Karma: +70/-0
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #24 on: July 31, 2024, 08:31:18 am »
Answer Silvan: the KLIBCCFG sources are lost. End of game.

Lars

  • Hero Member
  • *****
  • Posts: 1362
  • Karma: +70/-0
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #25 on: July 31, 2024, 12:06:24 pm »
A solution to avoid a system hang is to remove the environment var statement:

set LIBC_HOOK_DLLS=....

from config.x. That at least will allow to hit Ctrl-C to stop the process instead of hanging the whole system.

Lars

  • Hero Member
  • *****
  • Posts: 1362
  • Karma: +70/-0
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #26 on: July 31, 2024, 08:00:14 pm »
I now have an idea on how to solve this problem. Will take some trial and error and some time. NO guarantee that it will work but it's worth giving a try.
« Last Edit: July 31, 2024, 08:14:52 pm by Lars »

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1346
  • Karma: +26/-0
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #27 on: August 01, 2024, 12:10:22 am »
Hey Martin,

...For what I see on the F2 boot the %LIBPATH% is not recognized, but the config files looks fine. Is there any elegant way to see full the enviroment variables on the command line (image LIBPATH_F2.png )?...

Dave Yeo already gave the much bigger answer, but otherwise, if you want to look at each individual ENV variable you can do this at CLI:

Code: [Select]
echo %PATH%

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5029
  • Karma: +113/-1
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #28 on: August 01, 2024, 07:38:06 am »
Code: [Select]
echo %PATH%

Easier,
Code: [Select]
set PATH
Make sure you don't add an equals sign :)

Alex Taylor

  • Sr. Member
  • ****
  • Posts: 398
  • Karma: +6/-0
    • View Profile
Re: Unzip Version 6.0 hangs when booting to a commandline
« Reply #29 on: August 01, 2024, 01:52:35 pm »
Current versions of ArcaOS don't use klibccfg.dll at all.  It doesn't load it, TTBOMK doesn't even ship with it.

(It instead provides a replacement called prewrite.dll which provides the path remapping feature to the limit extent that it's needed/useful.)