[MacPorts] #63007: par @1.52_2: update to 1.53 to fix crashes with utf-8

MacPorts noreply at macports.org
Fri Dec 31 03:57:54 UTC 2021


#63007: par @1.52_2: update to 1.53 to fix crashes with utf-8
---------------------+--------------------
  Reporter:  grr     |      Owner:  (none)
      Type:  update  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:  par     |
---------------------+--------------------

Comment (by qbarnes):

 Replying to [comment:10 casr]:
 > Would you be able to share your small repro?
 >
 > I've updated the patch for wide char support that applies cleanly
 against 1.53. It seems to be fine against the text from that webpage where
 the same patch on 1.52 crashes. However, the new test suite that 1.53
 introduces now has some failures so it isn't perfect. Perhaps we can use
 it as a starting point?

 I've had trouble locating my work on 1.53.0.  It wasn't that far along.
 You've probably gotten further than I had.

 I did find all of my 1.52 work with test cases I was using.  I didn't have
 the work in a repo, so I converted it to one and uploaded it to
 `https://github.com/qbarnes/Par`.  I got close, but still had crashes with
 Thai with characters of zero width and Japanese with characters of two
 width.

 Note the branches in my `Par` repo.  The one you want to use to reproduce
 my crashes and debugging output when using ASAN is `wcwidth0-debugging`.

 I put my testing results in
 `https://gist.github.com/qbarnes/4445673340b52ec4c8698c295e4f0085`.  Files
 `lynxa.out`, `lynx7.out`, and `japanese.out` are the input files to `par`.
 The files `asan-test11.out` and `japanese-asan-test1.out` show the buffer
 corruption crashes that ASAN detected.  The latter two files also have the
 shell commands embedded starting with `$ ` in them I was using for
 reproducing the output.  If you don't get functionally equivalent output I
 captured, please let me know.

 The 3 input files above are samples I took from
 `https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt`.  I just
 reduced them from their source.

 One thing I didn't remember was if there was a reason why a small patch
 from my earlier work got dropped from the work under branch
 `wcwidth0-debugging`.  The original patch was under branch `wcwidth0`:
 {{{
 --- a/par.c
 +++ b/par.c
 @@ -422,9 +422,10 @@ static wchar_t **readlines(
          }
          continue;
        }
 -      // Exclude non-breaking space from the class of space chars
 -      if (isspace(c) && isascii(c)) ch = ' ';
 -      else blank = 0;
 +      if (isspace(c))
 +        ch = ' ';
 +      else
 +        blank = 0;
        additem(cbuf, &ch, errmsg);
        if (*errmsg)
          goto rlcleanup;
 }}}
 Simple regression or a problem I later found with it?

 I'll send you the emails I exchanged with Adam this summer if you send me
 your email address.  (Mine is in the cc: for this ticket.)  They go into
 detail with explaining my changes to him and his thoughts on them.

-- 
Ticket URL: <https://trac.macports.org/ticket/63007#comment:13>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list