[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Bug located, not in pppd



I know I am replying to myself. It may be easier that way.

The fatal calculation is at line 464 of tcpout.c, and involves a miscalculation of wndnxt. Wndnxt is calculated in ways that are elegant, hard to follow, and which produce bulky object code.

If using a compiler that lets you get at the .asm files it writes on the way to making .o files, such statements produce most obscure and lengthy assembly language.

The calculation space for the program involved is compiled in, and not at the end of the program, which is usual. It is probably not enough for bulky calculations, and produces memory leaks, which is probably why this error is reported as the error of almost any other running process.

So it is debatable whether an error for an imagined link burp should be DEBUG, instead of FATAL, since to get there requires a memory leak or overrun.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand" Martin Fowler, Refactoring: Improving the Design of Existing Code.

I have seen worse, but to fix this one, if it is what I think, will require printing out and studying the source code, adding a variable or two to a header file, and simplifying many redirect and conditional statements. The compiled in space will move to the end, and changeable by anyone who knows the offset for that information in the program header. It might even get a stack. I may get to that when I have my fast cheap printer fixed. Then I will have a file that works for me, fast and efficient, and quite human readable, in an obsolete version of MiNT.

Or, perhaps, the fix might be one line, checking to see if wndnxt and wnd1st are the same value, and if so, add 1 to wndnxt. That will not however, fix a memory leak.

So I am in no hurry to do something of not much value, but will look at the corresponding code in 1.16, which probably has the same problem, which means that 1.16 will not work any better than 1.15 in this area.

Jim

On Sat, 28 Aug 2004, Jim DeClercq wrote:

The bug I have in mind had about the same frequency as the old Phantom Typist bug, and a typical one of these fatal errors was:

(AESSSYS): tcp_sndsig: seg: (1092741134 1092741135) outside wnd (1092741134 1092741134)

The numbers and apparent source process differed, but always involved
a one-unit seg not making it through a window with no opening.

Of course, the test strings involved are in the object code, when viewed with a binary editor.

So, I looked through MiNT kernel, N_AES, pppd, telnet, bash, and toswin, and found nothing. So I started in at other things, ext2.xfs, flop_raw.xdd, mfp.xdd, moose.xdd, scc.xdd, and sockdev.xdd, and finally found it. tcp_sndseg: seg: (%ld %ld) outside wnd (%ld %ld)

So, it is or was a spurious error from sockdev.xdd being reported as a fatal error from a variety of sources by a MiNT kernel. It was not, as the documentation suggests, a too-small stack problem.

I finally realized that I may have been greatly in error about 1.16.0
not running pppd. When looking for a version of sockdev.xdd with a different date or size, I came across a text file for slip, saying that was what provided pppd support in 1.16.0. Easier to install? Nope. Moved slip to where it should have been, and may try 1.16.0 again. But still it can't be made to work with a .rc init file that works with 1.15. Or at least it didn't when I tried it, since it failed to start syslogd.

I have no reason to believe that any changes were made to the coding for sockdev.xdd when moving it to some other file, so that bug is probably still there, but harder to find, and bothers only those who do a lot of typing, just as the old Phantom Typist bug, which lived in the keyboard handler bothered only certain people.

Source code must be available, so eventually I will find out what that tcp_sndseg error is supposed to catch.

Jim

--
/"\      Jim DeClercq--jimd@panix.com--Sylvania, Ohio, USA
\ /      ASCII ribbon campaign | I'm a .signature virus!       |
 X       against HTML mail     | Copy me into your ~/.signature|
/ \      and postings          | to help me spread!            |
.