Hits when copying texts from OWB to editor
  • rms
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    rms
    Posts: 602 from 2004/11/27
    Hi,

    I noticed that I get hits when copying texts (RAMIGA+C), I select text on web pages, and then paste them into an editor which uses Texteditor mcc like NoWinEd, or into YAM...

    This seems only to happen when the textes come from OWB, I tried the same copying texts from an editor to another, no problem. Don't know if this is a problem in OWB or Texteditor...

    Here is a log file (btw this is reproducable, I could do it several times...):

    TLSF_FreePooled: pool 0x27742888 ptr 0x2dc42d20 wrong size 1698 (memory was allocated for 1669-1684 bytes)
    **************************************************************
    **************************************************************
    Task 0x27942f48 Name 0x27943cac <Background CLI> Type 13 Pri 0
    Flags 0x8 State 2 IDNestCnt -1 TDNestCnt -1
    SigAlloc 0x07f0ffff SigWait 0x07f01000 SigRecvd 0x00080130 SigExcept 0x00000000
    ExceptCode 0x10100130 ExceptData 0x00000000 TrapCode 0x10100128 TrapData 0x00000000
    Switch 0x00000000 Launch 0x00000000 UserData 0x00000000
    SPLower 0x270da8b4 SPUpper 0x272da8b4 SPReg 0x272da84c
    ----------------------------------------------------------------------
    ETask 0x277b2b24
    MemPool 0x26416a98 PPCLibData 0x00000000
    PPCSPLower 0x27926da4 PPCSPUpper 0x2793bbc0
    PPCTrapMsgPort 0x00000000 PPCTrapMessage 0x27439d94
    PPCRegFrame 0x278fcd70
    Private[] 0x00000000 0x00000000 0x00000000 0x00000000
    EmulHandle 0x00000000
    ----------------------------------------------------------------------
    EmulHandle 0x278fd160 Type 0x00000004 Flags 0x00000001
    ----------------------------------------------------------------------
    SRR0 0x10123dc4 SRR1 0x02007030
    LR 0x260fd05c CTR 0x10243664
    CR 0x48004288 XER 0x00000000
    GPR[00] 20a5d788 2793a4a0 278fd160 ffffffbe 2793ad3c 10243664 81002002 00000004
    GPR[08] 00000000 20a65f68 11008a3c 2dc42e51 88004288 00000000 2793ad88 00000000
    GPR[16] 2dc42870 00000000 00000000 00000000 00000000 277a1cec 2793ad3c 2dc42d24
    GPR[24] 20001948 277b2b24 27942f48 00000000 10020010 10100000 2793a8a8 278fcd70
    LR -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x00006924
    PPCStackFrame History:
    StackFrame[0].LR-> Address 0x10122788
    StackFrame[-1].LR-> Address 0x1010feb4
    StackFrame[-2].LR-> Address 0x1010cfa8
    StackFrame[-3].LR-> Address 0x1010d07c
    StackFrame[-4].LR-> Address 0x260fd144 -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x00006a0c
    StackFrame[-5].LR-> Address 0x260fd3f0 -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x00006cb8
    StackFrame[-6].LR-> Address 0x26104180 -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x0000da48
    StackFrame[-7].LR-> Address 0x26101b4c -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x0000b414
    StackFrame[-8].LR-> Address 0x2610276c -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x0000c034
    StackFrame[-9].LR-> Address 0x260fc838 -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x00006100
    StackFrame[-10].LR-> Address 0x260fbba4 -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x0000546c
    StackFrame[-11].LR-> Address 0x260fc50c -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x00005dd4
    StackFrame[-12].LR-> Address 0x260fcedc -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x000067a4
    StackFrame[-13].LR-> Address 0x20bd92cc -> MOSSYS:LIBS/muimaster.library Hunk 1 Offset 0x00015324
    StackFrame[-14].LR-> Address 0x27976228 -> System:Tools/NoWinED/NoWinED Hunk 1 Offset 0x000243f8
    StackFrame[-15].LR-> Address 0x27975f00 -> System:Tools/NoWinED/NoWinED Hunk 1 Offset 0x000240d0
    StackFrame[-16].LR-> Address 0x20bd92cc -> MOSSYS:LIBS/muimaster.library Hunk 1 Offset 0x00015324
    StackFrame[-17].LR-> Address 0x20bc996c -> MOSSYS:LIBS/muimaster.library Hunk 1 Offset 0x000059c4
    StackFrame[-18].LR-> Address 0x20bc9c0c -> MOSSYS:LIBS/muimaster.library Hunk 1 Offset 0x00005c64
    StackFrame[-19].LR-> Address 0x20bca0ac -> MOSSYS:LIBS/muimaster.library Hunk 1 Offset 0x00006104
    StackFrame[-20].LR-> Address 0x20c586cc -> MOSSYS:LIBS/muimaster.library Hunk 1 Offset 0x00094724
    Full PPC mode: Last 68k context
    PC 87654321 SR 0008
    Dn[0] 000006a2 00000004 000000b5 00000069 00000003 0000000f 00000018 ffffffff
    An[0] 27942f48 2dc42d20 277a1c28 00000000 27a27e04 2dc4280c 20001948 272da8ac
    Stack: 0x272da8ac
    0x2a000000 -> OWB Hunk 4 Offset 0x007a4450
    Last saved PPCThread State:
    SRR0 0x260fd068 SRR1 0x200f030 LR 0x260fd05c R1 0x2793ad30
    GPR[00] 20a5d788 2793ad30 278fd160 ffffffbe 2793ad3c 10243664 81002002 00000004
    GPR[08] 00000000 20a65f68 11008a3c 2dc42e51 88004288 00000000 2793ad88 00000000
    GPR[16] 2dc42870 00000000 00000000 00000000 00000000 277a1cec 2793ad3c 2dc42d24
    GPR[24] 24f40000 24f40000 2dc43424 24f40000 2dc42e51 24f40000 00000001 2dc4354c
    FPSCR 43efff0000104008
    FPR[00] 3cb7f25f0004d528 27a27b2c00000000 0000000000000004 27a27b2c00000000
    FPR[04] fff8000000003a98 3fd4031ce0000000 3fd50e2c20000000 3f30000000000000
    FPR[08] 4010000000000000 4330000000000000 4330000080000000 4064400000000000
    FPR[12] 4064800000000000 4330000080000000 0000000000000000 0000000000000000
    FPR[16] 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    FPR[20] 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    FPR[24] 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    FPR[28] 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    SRR0 -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x00006930
    LR -> LIBS:mui/TextEditor.mcc Hunk 1 Offset 0x00006924
    ----------------------------------------------------------------------
    SegList 0x09e3340c GlobVec 0x20028b94
    StackBase 0x09c36a2d StackSize 0x00200000
    TaskNum 0x00000003 Result2 0x00000000
    CurrentDir 0x09dddf42 CIS 0x09ddde13
    COS 0x09ddde01 CES 0x09d0e751
    ConsoleTask 0x277775b8 FileSystemTask 0x201e5074
    CLI 0x098ad7a9 ReturnAddr 0x272da8ac
    PktWait 0x00000000 WindowPtr 0xffffffff
    HomeDir 0x098ad758 Flags 0x00000044
    ExitCode 0x00000000 ExitData 0x00000000
    Arguments 0x274359cc ShellPrivate 0x00000000
    NEW_Alert: MsgPort 0x2793ac80
    NEW_Alert: Task 0x27942f48 <Background CLI>
    NEW_Alert: Msg 0x2793ac60
    NEW_Alert: AlertMsgPort 0x200c4fe8
    NEW_Alert: Send Msg
    NEW_Alert: Wait Msg
    NEW_Alert: Replied Msg 0x2793ac60
    NEW_Alert: continue
  • »01.05.10 - 07:13
    Profile Visit Website
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    Well, that's obviously texteditor's fault. Use an older texteditor version, and it might disappear (latest versions of these classes generally only introduce bugs).

    I also just tested here (with some probably old texteditor and yam versions), and it's not reproducible

    [ Edited by Fab on 2010/5/1 13:55 ]
  • »01.05.10 - 11:53
    Profile Visit Website
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    It could have something to do with UTF-8 in texteditor.mcc paste function.

    @fab

    Does OWB export text to clipboard in UTF-8 format? With

    @rms

    Would you like to try my build of texteditor.mcc? I'd like to check if bug is gone in current version and also get decent offsets for debug purposes.
    1 + 1 = 3 with very large values of 1
  • »01.05.10 - 14:05
    Profile
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    @itix

    It exports either in UTF8 or local charset depending on what you choose in menu. That being said, there's no charset indicator set in the written chunk (what would be expected for UTF8 by texteditor?)
  • »01.05.10 - 14:42
    Profile Visit Website
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Applications exporting text to clipboard can insert CSET chunk to indicate charset. If present and indicating UTF-8 (CodeSet == CODESET_UTF8) TextEditor MCC converts UTF-8 stream to a local 8bit charset when pasting text. Otherwise text is pasted as is.
    1 + 1 = 3 with very large values of 1
  • »01.05.10 - 21:29
    Profile
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    @itix

    Ok, well, i handle this codeset partially, except i always set it to 0 when copying, since i didn't know if there was a standard value for UTF8 codeset.

    Anyway, this doesn't excuse texteditor from crashing. :)
  • »01.05.10 - 21:55
    Profile Visit Website
  • rms
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    rms
    Posts: 602 from 2004/11/27
    @ itix

    yes no problem I test your build of text editor and send you feed-back if this helps to clear out this problem/bug.

    @ Fab

    I would rather see a solution here to clear out the bugs then just stepping back to older versions! That's the reason why I send this report.
  • »03.05.10 - 04:57
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Okay I tracked the problem down.

    The bug is in MCC_TextEditor. The bug was added to release 15.31. Also 15.32 is affected.

    Basically pasting any UTF-8 content results in a crash due to attempt to FreeVecPooled a pointer allocated via AllocVec.

    mcc/EditorStuff.c

    utf8_to_ansi() call is used to convert the UTF-8 data. Unfortunately whoever did the changes to .31 forgot to modify utf8_to_ansi routine to use AllocVec/FreeVec aswell. Additionally while the original routine (.30) updates the content pointer correctly, the new one doesn't (because it's in line->line.Contents now), resulting in a double free.

    This is typical crap you get with damatoware.

    I seriously suggest everyone to try phase out any applications which depend on these classes. New code should not use these MCCs anymore.

    [ Edited by Piru on 2010/5/3 13:08 ]
  • »03.05.10 - 09:06
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    I guess it is under my responsibility since I maintain MorphOS build (more or less).

    Edit: I just investigated code and in 15.31 clipboard server was added and original MorphOS code was left as is. Changes were made when I was working abroad, moving flat and other stuff so I didnt see it coming and I have to say other maintainers could not know what MorphOS does with Unicode. I already developed fix for this one, have to verify it works and check betterstring mcc also.

    [ Edited by itix on 2010/5/4 0:05 ]
    1 + 1 = 3 with very large values of 1
  • »03.05.10 - 10:11
    Profile
  • Just looking around
    Jason
    Posts: 14 from 2009/11/6
    The latest NoWinEd requires the broken texteditor mcc in question. Be warned.
  • »03.05.10 - 20:03
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    I have to say other maintainers could not know what MorphOS does with Unicode.

    Well, I disagree here. The code is in the same source code file. It is quite obvious that it changes the pointer in question and any decent developer would have noticed it when doing the changes. At least the double free should have been obvious from just the program logic point of view.

    Maybe my standards are just set too high or something.
  • »03.05.10 - 22:03
    Profile
  • Caterpillar
    Caterpillar
    tboeckel
    Posts: 21 from 2009/10/29
    From: Germany
    You should not point fingers at persons who are not responsible for the bugs you find. In fact I was the one who did the modifcation and not Jens. So if you want to blame anybody then you must blame me. And I can stand that accusation, believe me. Neither me nor you can claim himself to produce 100% working code all the time.
  • »05.05.10 - 07:24
    Profile
  • Caterpillar
    Caterpillar
    tboeckel
    Posts: 21 from 2009/10/29
    From: Germany
    I admit that the bug was quite obvious, but even a MorphOS core developer introduced MorphOS-only bugs, because his very own code relied on the fact that certain functions are available in all releases of MorphOS. Unfortunately this is not the case and hence the code crashed on MorphOS 1.4.x. Thus itix is no decent developer from your point of view, isn't he? Does itix still fulfill your high standards?
  • »05.05.10 - 07:31
    Profile
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    a MorphOS core developer introduced MorphOS-only bugs, because his very own code relied on the fact that certain functions are available in all releases of MorphOS.

    I don't know what you're referring to specifically (you know it's good practice to use references), but at least the code in question checks for MorphOS 2.x correctly.

    In http://texteditor-mcc.svn.sourceforge.net/viewvc/texteditor-mcc/releases/15.28/mcc/EditorStuff.c
    Code:
    if (IS_MORPHOS2)
    contents = utf8_to_ansi(data, contents);


    Agreed, it can happen that you forget such check at times. I've made such mistake myself, too. These things are often very tricky to spot if you skip proper testing.

    Quote:

    Does itix still fulfill your high standards?

    Yes.

    Itix has a lot to improve in the testing sector, however. I know he knows this ;-)
  • »05.05.10 - 09:16
    Profile
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    the code crashed on MorphOS 1.4.x

    We try to support the "free" MorphOS 1.4.x version in as many ways as we can. For example we've released updates to MorphOS 1.4.x that make it possible to use many software originally designed for MorphOS 2.x only.

    I think this goes way beyond the usual commitment for support.

    Obviously we try to keep things backward compatible if only possible. Sometimes we just fail at it due to a silly mistake, and sometimes it just doesn't make sense anymore.

    The officially supported version of MorphOS is 2.x.

    [ Edited by Piru on 2010/5/5 13:28 ]
  • »05.05.10 - 09:28
    Profile
  • Caterpillar
    Caterpillar
    tboeckel
    Posts: 21 from 2009/10/29
    From: Germany
    Quote:

    I don't know what you're referring to specifically (you know it's good practice to use references), but at least the code in question checks for MorphOS 2.x correctly.


    I was referring to the modification itix made to codeset.lib to obtain MorphOS' default character set. His code always dereferenced NULL pointer which is a clear indication that he did not verify his own modification at all. But this bug has been fixed by itix himself for a long time now. So let it rest.

    Anyway, we will release a fixed version as soon as itix can confirm that the bug in TE.mcc is fixed. If there are more volunteers to test please let us know.

    Furthermore everybody is invited to report any bug (s)he spots on the usual bugtrackers, no matter for which class. Things can only become better if such issues are reported on the bugtracker. Discussing issues in fora like this will most probably let them go unnoticed. And this in turn leads to a negative attitude many people seem to share nowadays.

    Please keep in mind that classes like TextEditor.mcc are not restricted to one single platform and hence we simply cannot verify all modifications on all platforms ourself. System specific modification might very well cause system specific harm.

    [ Edited by tboeckel on 2010/5/5 14:54 ]
  • »05.05.10 - 11:46
    Profile
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    Discussing issues in fora like this will most probably let them go unnoticed.

    Discussing like what?

    I of course reported the issue to the bugtracker as soon as I found out what the problem was.

    Quote:

    System specific modification might very well cause system specific harm.

    The change in question wasn't system specific.
  • »05.05.10 - 14:24
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jcmarcos
    Posts: 1178 from 2003/3/13
    From: Pinto, Madrid ...
    Interesting developer talk. Like it!
  • »05.05.10 - 15:03
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Please try http://www.amigasoftware.org/test/texteditor-mcc.lha

    If it works I commit changes to SVN.
    1 + 1 = 3 with very large values of 1
  • »07.05.10 - 20:37
    Profile
  • rms
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    rms
    Posts: 602 from 2004/11/27
    @ itix

    thanks for this version which I tested and it seem to work without any problems which is great!

    I can confirm, that I don't get any hits anymore doing the same operation as before.

    thanks for your help!
  • »08.05.10 - 12:55
    Profile Visit Website
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Can you please also try this:

    http://www.amigasoftware.org/test/texteditor-svn.lha

    It is from the texteditor-mcc SVN with fix from tboeckel.
    1 + 1 = 3 with very large values of 1
  • »12.05.10 - 18:59
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    xyphoid
    Posts: 870 from 2008/7/11
    From: Delaware, USA
    not sure of the relation of this problem I seem to now have, but I'm trying to copy text from finalwriter to my google docs, but it keeps pasting a previous copied line from google docs instead of the new copied line from final writer... Any suggestions? I got a lot of docs to transfer up to gdocs

    it seems to be intermittent not sure why...I'M copying into a preset word form, but its not copying
    and pasting the new material from FW, but does perfectly from gdos to gdocs

    resetting seemed to work



    [ Edited by xyphoid on 2010/5/13 20:52 ]

    [ Edited by xyphoid on 2010/5/13 22:21 ]
  • »13.05.10 - 23:25
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    It is probably a bug in FW which probably fails to write clipboard. Try deleting files from CLIPS: drawer, it is a temporary place where copied items are stored for pasting.
    1 + 1 = 3 with very large values of 1
  • »14.05.10 - 04:46
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    xyphoid
    Posts: 870 from 2008/7/11
    From: Delaware, USA
    @itix
    didn't work. It just wrote to CLIPS again 603b and pasting on owb did the owb previous mem line. Seems I have to close out owb to clear its mem, or reboot.

    [ Edited by xyphoid on 2010/5/14 19:21 ]
  • »14.05.10 - 22:16
    Profile