Re: lynx-dev 2-8-1 bug: print vs partial

From:

Klaus Weide

Subject:

Re: lynx-dev 2-8-1 bug: print vs partial

Date:

Thu, 3 Dec 1998 03:38:49 -0600 (CST)

On Tue, 1 Dec 1998, Philip Webb wrote:
> a number of times during the past few weeks i've encountered a problem
> using 2-8-1rel.1 with partial display enabled.
> it happens with the following sequence of commands
> when i e-mail a document to someone using the Print screen:
>
> p -- down-arrow -- right-arrow -- ^u -- address@hidden --
> Enter -- left-arrow .
>
> what should occur is restoration of the document
> from which i linked to the document i just e-mailed;
> what actually occurs is deletion of the window (i'm using Screen):
> all i see is the next window, with no error message,
> & the temporary files in my personal /tmp directory have been deleted.
> the latest occurrence saw partial restoration of one of the documents
> -- i'm not sure which -- before the window was lost.
You are probably getting a signal, but the way you invoke Lynx prevents
you from seeing the exit message.
> this looks like a bug introduced somewhere in the partial-display code.
> can anyone else reproduce it -- using Screen or otherwise --
> or suggest the cause of the problem?
It may or may not be caused by partial display. Did you test it without?
Anyway, before spending more time looking for a bug with the partial
display code, you should apply the HText_trimHightext patch (at least).
Since your problem occurs after mailing from the Print menu, it is more
likely that it is caused by some memory corruption in LYPrint.c.
There is a patch I found in
Linkname: Index of /pub/lynx/release2-8-1/patches/
URL: ftp://www.slcc.edu/pub/lynx/release2-8-1/patches/
The relevant change is described as
* Fix core dump which may happen after printing-to-email. - LP
(Aside: what is the status of that directory? Is somebody keeping
it updated?)
These fixes seem to be integrated into the development code.
You could have found the description by looking in the development
source CHANGES file.
The fixe in that patch (and in the devel code) should prevent the
memory corruption, but it introduces a memory leak. Here is
a better fix:
[This is for 2.8.1rel. For the devel code, also revert
StrAllocCopy(subject, subject_translate8bit(newdoc->title));
back to
subject = subject_translate8bit(newdoc->title);
]
*** lynx2-8-1.orig/src/LYPrint.c Wed Oct 14 07:23:56 1998
--- lynx2-8-1/src/LYPrint.c Thu Dec 3 02:55:23 1998
***************
*** 1226,1231 ****
--- 1226,1232 ----
* it may correspond to US-ASCII as the safest value or any other
* lynx character handler, -1 for no translation (so display charset).
*
+ * Always returns a new allocated string which has to be freed.
*/
PRIVATE char* subject_translate8bit ARGS1(char *, source)
{
***************
*** 1242,1248 ****
if (i < 0
|| LYHaveCJKCharacterSet
|| LYCharSet_UC[i].enc == UCT_ENC_CJK) {
! return(source); /* OK */
} else {
charset_out = i;
charset_in = current_char_set;
--- 1243,1250 ----
if (i < 0
|| LYHaveCJKCharacterSet
|| LYCharSet_UC[i].enc == UCT_ENC_CJK) {
! StrAllocCopy(target, source);
! return(target); /* OK */
} else {
charset_out = i;
charset_in = current_char_set;