Menu

#339 less.exe causes cmd.exe to crash

open-accepted
nobody
None
5
2014-08-16
2010-02-18
No

Download less.exe from http://www.greenwoodsoftware.com/less/download.html or http://unxutils.sourceforge.net/
Try to run less.exe on any text file.
The output flashes, then disappears, leaving you with a command-line
>less foo.txt

when issuing the exit command ":q" cmd.exe crashes. The stack shows it's a crash from "operator new" invoked from "ConsoleHook.dll" inside cmd.exe.
This happens both x64 and x86, on Win7 and IIRC on Vista as well.

Discussion

  • Eugene Talagrand

    • summary: less.exe causes Console Window Host to crash --> less.exe causes cmd.exe to crash
     
  • Anonymous

    Anonymous - 2010-02-28

    have the same issue, would be nice if that is fixed some when, though i'm not using less too often, its a handy tool when working with command line

     

    Last edit: Anonymous 2013-11-26
  • Patrick W.

    Patrick W. - 2010-03-05

    I think you can solve this by setting the environment variable `LESS` to "FRSX" (for example with $env:LESS = 'FRSX' in PowerShell).

     
  • Anonymous

    Anonymous - 2010-05-04

    Would also love to see this fixed. This is the only thing that is stopping me from ditching normal windows console in favour of Console2. For me the screen just flashes and then the whole console crashes.

     

    Last edit: Anonymous 2015-12-02
  • Tao Yue

    Tao Yue - 2010-07-21

    This behavior is triggered by the same problem as described in bug 2944920.

    I investigated the problem in a debugger. In the comments for the older bug, I've described my findings, along with some possible partial fixes and workarounds. Here's a link if you're interested:

    https://sourceforge.net/tracker/?func=detail&aid=2944920&group_id=43764&atid=437332

     
  • Tao Yue

    Tao Yue - 2010-07-21

    If all you need is "less," then the simplest workaround is to switch to Cygwin. Their less does not cause Console2 to crash.

    See related forum thread: https://sourceforge.net/projects/console/forums/forum/143117/topic/3475713

     
  • Marko Bozikovic

    Marko Bozikovic - 2010-08-22
    • status: open --> open-fixed
     
  • Marko Bozikovic

    Marko Bozikovic - 2010-08-22

    I think I have fixed this. The fix is committed, it will be available in the next build.

    Cheers,
    --
    Marko

     
  • Marko Bozikovic

    Marko Bozikovic - 2010-08-26

    Nope, not fixed.

     
  • Marko Bozikovic

    Marko Bozikovic - 2010-08-26
    • status: open-fixed --> open-accepted
     
  • Gordon Tyler

    Gordon Tyler - 2011-03-24

    I'm stilling seeing this problem with Console 2.00.147 64-bit on Windows 7 Enterprise 64-bit using the less executable from GNUWin32.

     
  • Thomas Menzel

    Thomas Menzel - 2011-10-05

    also seeing this with win7 x64
    this is a real pain for me as i use less VERY often and pretty much cant live w/o it.
    does anyone have a workaround (other than switching to x86) for this?

    PS: my observed behavior is that the console app just dies instantly when starting less.

    as a workaround i have placed a win shortcut pointing to cygwin's less into the gunwin32/bin folder. for this to work u must add .lnk to PATHEXT, e.g. PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.lnk

     
  • Torsten Martinsen

    I am also seeing this. Setting LESS=FSRX does prevent the crash, but also prevents less from working properly.

    For me, LESS=X works perfectly.

     
  • amannuc

    amannuc - 2014-08-16

    I've found using the --no-init (or -X) option solves the problem, but I don't know if this creates any other problems. So far, it seems to be working. This could the same as what's suggested in the previous post, but I am not sure what "LESS=X" means. I guess it means this option is used automatically. Thanks.

     

    Last edit: amannuc 2014-08-16

Log in to post a comment.