Mailing List ecs-isp@2rosenthals.com gearchiveerd bericht #1135

Van: "Peter Moylan" <ecs-isp@2rosenthals.com> Volledige berichtkoppen
Ongedecodeerd bericht
Onderwerp: Re: [eCS-ISP] Getting started with Let's Encrypt
Datum: Sun, 5 Jan 2025 21:11:01 +1100
Aan: eCS ISP Mailing List <ecs-isp@2rosenthals.com>

On 05/01/25 18:21, Steven Levine wrote:
In <list-11710856@2rosenthals.com>, on 01/05/25 at 04:51 PM, "Peter
Moylan" <ecs-isp@2rosenthals.com> said:

Has anyone else had problems with VioWrtCharStr?

Not really.  It just works as long as you respect the limits.  As we
know a VIO app cannot have more than 256 threads.  Also since under
the covers, this is a 16-bit API, any buffers need to be in lower
memory or the thunking will fail.

That brings up an interesting point. The linker map shows code
addresses, but I've never given much thought to where the data and stack
segments go. I'll have to take a look with the debugger.

The code in question is
>>   rc := OS2.VioWrtCharStr (p^, amount, CurrentRow,CurrentColumn, 0);
>>    IF rc <> 0 THEN HALT; END (*IF*);
>> The
HALT is there because I was searching for a way to discover the
value of rc, but it turns out that the exit occurs before an rc
value can be returned. The parameter values: CurrentRow=19,
CurrentColumn=0, amount is something like 50, and p points to a
character string that is guaranteed not to cross a 64K boundary in
memory.

I wonder if the modula runtime has a new to us thunking issue.

If I compare the above, to what WriteStringAt does there is a
difference. Your new code passes a pointer to a buffer.  The
WritestringAt code copies the string to the stack and passes a
pointer to a copy of the buffer on the stack.

What happens if you modify the failing code to use WriteStringAt
rather calling OS2.VioWrtCharStr?

An interesting question. My original code used the same parameter
passing in WriteString as in WriteString. I introduced the pointer
yesterday because I thought there might be a problem with crossing a 64K
boundary. (There wasn't, at least this time.) Now I've changed it back,
so that the call becomes
   rc := OS2.VioWrtCharStr (text, amount, CurrentRow, CurrentColumn, 0);
(In the interest of changing only one thing at a time, I still allocate
heap memory and make a copy of text, but I don't use the copy.) Same
result: if I just run the program, it happily gets past the writing to
screen, but hits an unrelated bug further downstream If instead I use
the debugger, the program fails at this VioWritCharStr.

But only in this one special case. The procedure in question is what I
use when logging to the screen, and many other log lines go through
without a problem. It's just the one rare case where there's a failure.

Next, I implemented your suggestion of making WriteString call
WriteStringAt. This worked. Thank you. I don't know why it worked,
because all that that changes is an extra redundant copy of the string
on the stack, but it gets me past my immediate problem.

By stepping through machine instructions I found that the problem
is somewhere in a module called BVHWNDW$, in something called from
DOSCALL1, but I haven't been able to pin it down more precisely
than that.

This makes sense if you are running your app in a VIO session.
BVHWNDW.DLL supports using VIO APIs in a VIO Session which is really
a PM window.

Will the debugger allow you to step into the BVHWNDW code?  If so,
what's the last cs:ip before the code goes away?

I tried to do this, but ran out of patience. After a lot of
single-stepping, I noticed that the CX register was working as a loop
counter, and that I still had about 30 loop executions to go, so I set a
breakpoint at the loop exit. The program exited before getting to that
breakpoint. (Maybe the last time around the loop was a special case.)
This was after about half an hour of single stepping, and I didn't have
the courage to go back and try it again.

Maybe later. For now, thanks to your suggestion, I have a useful
debugger again, so I can proceed to the bug that I was originally trying
to track.

--
Peter Moylan                  peter@pmoylan.org
http://www.pmoylan.org

Aanmelden: Feed, Samenvatting, Index.
Afmelden
Mail naar ListMaster