Menu

#269 joe 3.7 crashes after writing many "-" characters on a line

v3.8
closed-fixed
5
2015-03-13
2009-01-10
Josip Rodin
No

Apparently the paragraph formatter doesn't like 83-87 dashes being typed on the same line. The original bug report was filed in the Debian BTS at
http://bugs.debian.org/508159
There is some additional discussion there about where this might be caused - the joe wordwrap() function seems to be doing a double free(3), the backtrace says:

#5 0x0000000000457492 in joe_free (ptr=0xdb8b10) at utils.c:280
#6 0x0000000000446ef5 in wrapword (bw=0xdb88d0, p=0xdb5530, indent=88,
french=0, no_over=0, indents=0xdb8b10 '-' <repeats 87 times>, " ")
at uformat.c:511

Alhough it's not immediately obvious to me when it would do that, or why different configuration settings would influence it (the Debian build crashes; the vanilla one doesn't).

Related

Bugs: #333

Discussion

  • Joe Allen

    Joe Allen - 2010-04-24

    This is now fixed in CVS.

     
  • D Miles

    D Miles - 2011-11-16

    http://joe-editor.cvs.sourceforge.net/viewvc/joe-editor/joe-current/uformat.c?r1=1.42&r2=1.43

    And where is the variable "orgx" initialized (in uformat.c:365) maybe "gcc -O2 -Wall" should find this error ?

    The issue I have with this code (from joe-3.7) is that "x == r->byte - s->byte" i.e. the space inserted is already the last character, the <NUL> character assignment is a write into unallocated memory. So if you need to insert this space you need to extend the length of "indents" by 1 character to allow it, or you need to not insert the space character.

    I think you need to do:

    int orgx = x;

    or

    int x = orgx = zlen(indents);

    This would not insert the space character.

     
  • D Miles

    D Miles - 2011-11-16

    How about maintainers of SF tarballs ask their downstream to kindly submit any patches for review upstream, so a new release can be rolled.

    Part of package management is to not only make software work on a given distro but also to ensure the patch is attached to the upstream bug system and I can't see it on this particular bug entry or any comment about the problems with the solution on CVS. Open source works better if 10 people work on 10 different itches.

    The onus is on downstream (debian) to submit patches through the allowed submission process to their upstream (joe-editor @ SF), since the submission process should take care of Copyright and licensing matters. It is not allowed for the upstream to just go and take the patch in the other direction.

    I see there are other patches again if those are useful to the upstream they should have been attached to bug entries by now.

     
  • John J. Jordan

    John J. Jordan - 2015-03-13
    • status: open --> closed-fixed
    • assigned_to: Joe Allen
    • Group: --> v3.8
     
  • John J. Jordan

    John J. Jordan - 2015-03-13

    Old bug.

     

Log in to post a comment.