#122 Fix Crash with D///// entries

open
common (6)
5
2006-11-15
2006-07-26
No

When an CVS Entries file contains a D///// entry, gCvs
crashes.

The attached fix prevents such entries from being
handled at all, by preventing new Nodes from being created.

Discussion

  • Jerzy Kaczorowski

    • assigned_to: nobody --> jerzyk
     
  • Jerzy Kaczorowski

    Logged In: YES
    user_id=119527
    Originator: NO

    How do you get the "D/////" entries?

    According to CVS documentation it should either be single D or D/name/filler1/filler2/filler3/filler4 (where fillers are blank so you get D/name////).

     
  • Robert Lichtenberger

    Logged In: YES
    user_id=68692
    Originator: YES

    >How do you get the "D/////" entries?
    They are created by another "CVS-enabled" application. You are right, the D///// entries shouldn't be there, however for the sake of robustness, gCVS shouldn't crash.

     
  • Jerzy Kaczorowski

    Logged In: YES
    user_id=119527
    Originator: NO

    Can you tell where exactly does it crash?
    I tried to put this kind of entry and WinCvs doesn't crash, so I can put this patch as conditional compilation for gCvs only but I am not happy with strcmp there - maybe a better fix can be found?

     
  • Robert Lichtenberger

    Logged In: YES
    user_id=68692
    Originator: YES

    I will try to reproduce the problem and send a gdb backtrace.

     
  • Robert Lichtenberger

    Logged In: YES
    user_id=68692
    Originator: YES

    This is the backtrace of the crash. It occurs when entering a directory whose Entries-file contains the D///// entry.

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 46912497445056 (LWP 9411)]
    0x0000003ef8274042 in strcmp () from /lib64/libc.so.6
    (gdb) bt
    #0 0x0000003ef8274042 in strcmp () from /lib64/libc.so.6
    #1 0x000000000046ed67 in Entries_Open (entries=@0x752ba0,
    fullpath=0x7b2a40 "/home/rli/devel/ICOSOFT/PROJECTS/Components/I/IcoscriptComponent/Library/icoscript") at SortList.h:250
    #2 0x000000000045b111 in TViewFill::EnterDirectory (this=Variable "this" is not available.
    )
    at UCvsFiles.cpp:239
    #3 0x0000000000474849 in FileTraverse (
    path=0x7b2a40 "/home/rli/devel/ICOSOFT/PROJECTS/Components/I/IcoscriptComponent/Library/icoscript", report=@0x7fff07fe6490, macDirSpec=Variable "macDirSpec" is not available.
    )
    at FileTraversal.cpp:164
    #4 0x00000000004561f2 in UCvsFiles::ResetView (this=0x752ac0,
    forceReload=true, notifyBrowser=false) at UCvsFiles.cpp:524
    #5 0x0000000000456af4 in UCvsFiles::ResetView (this=0x752ac0,
    path=0x7b34d0 "/home/rli/devel/ICOSOFT/PROJECTS/Components/I/IcoscriptComponent/Library/icoscript", notifyBrowser=true) at UCvsFiles.cpp:428
    #6 0x00000000004593e2 in UCvsFiles::EditSel (this=0x752ac0, data=0x7bbb10,
    useDefault=Variable "useDefault" is not available.
    ) at UCvsFiles.cpp:1900
    #7 0x000000000045947e in UCvsFiles::OnDblClick (this=0x752ac0)
    at UCvsFiles.cpp:1969
    #8 0x000000000049eceb in UCmdTarget::UDispatchMessage (this=0x752ac0, evt=71,
    arg1=0, arg2=0x0, dispatchInfo=@0x7fff07fe669c) at uevent.cpp:357
    #9 0x000000000049f406 in UEventSendMessage (wid=4, evt=71, arg1=0, arg2=0x0)
    at uevent.cpp:215
    ---Type <return> to continue, or q <return> to quit---
    #10 0x00000000004a30c8 in gtkclistdblclick (widget=Variable "widget" is not available.
    ) at uwidget.cpp:269
    #11 0x0000003ef91a934e in gtk_marshal_BOOL__POINTER ()
    from /usr/lib64/libgtk-1.2.so.0
    #12 0x0000003ef91d8e87 in gtk_signal_handler_block ()
    from /usr/lib64/libgtk-1.2.so.0
    #13 0x0000003ef91db4be in gtk_signal_new () from /usr/lib64/libgtk-1.2.so.0
    #14 0x0000003ef91dbc6b in gtk_signal_emit () from /usr/lib64/libgtk-1.2.so.0
    #15 0x0000003ef9211a73 in gtk_widget_event () from /usr/lib64/libgtk-1.2.so.0
    #16 0x0000003ef91a78c0 in gtk_propagate_event ()
    from /usr/lib64/libgtk-1.2.so.0
    #17 0x0000003ef91a8662 in gtk_main_do_event () from /usr/lib64/libgtk-1.2.so.0
    #18 0x00000000004a5409 in gtkmaindoevent (event=0x831738) at uwidget.cpp:214
    #19 0x0000003ef9d1b29d in gdk_events_init () from /usr/lib64/libgdk-1.2.so.0
    #20 0x0000003ef9b12d0a in g_main_add_poll () from /usr/lib64/libglib-1.2.so.0
    #21 0x0000003ef9b134a5 in g_get_current_time ()
    from /usr/lib64/libglib-1.2.so.0
    #22 0x0000003ef9b136df in g_main_run () from /usr/lib64/libglib-1.2.so.0
    #23 0x0000003ef91a8b72 in gtk_main () from /usr/lib64/libgtk-1.2.so.0
    #24 0x000000000044eda1 in main (argc=1, argv=0x7fff07fe7128) at main.cpp:142

     
  • Jerzy Kaczorowski

    Logged In: YES
    user_id=119527
    Originator: NO

    Entries_Open looks like a better point of attack then, maybe something like would do?:

    bool Entries_Open(CSortList<ENTNODE>& entries, const char* fullpath)
    {
    string adminPath(fullpath ? fullpath : "");

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks