Skip to content

segmentation fault on line-num-width & -N #529

@elig0n

Description

@elig0n

using 1649cc3:

This causes a crash:

LESS="--line-num-width 1" ./less -N README

This only crashes when reaching the end of file:

LESS="--line-num-width 2" ./less -N +G README

Also when passing arguments directly and not using an environment variable.

here's a stack trace:

       Stack trace of thread 285268:
       #0  0x00005637267704a1 step_charc (less + 0xb4a1)
       #1  0x0000563726770514 step_char (less + 0xb514)
       #2  0x000056372677c9f2 store_char (less + 0x179f2)
       #3  0x000056372677db4d pappend_b (less + 0x18b4d)
       #4  0x000056372677affb back_line (less + 0x15ffb)
       #5  0x000056372677b96f jump_forw (less + 0x1696f)
       #6  0x000056372677483e commands (less + 0xf83e)
       #7  0x000056372676b9b0 main (less + 0x69b0)
       #8  0x00007f598ee33cd0 n/a (libc.so.6 + 0x29cd0)
       #9  0x00007f598ee33d8a __libc_start_main (libc.so.6 + 0x29d8a)
       #10 0x000056372676ba55 _start (less + 0x6a55)
       ELF object binary architecture: AMD x86-64

and also this:

          Stack trace of thread 270002:
          #0  0x00005615484c142c pshift_all (less + 0x1742c)
          #1  0x00005615484bfa9f forw_line_seg (less + 0x15a9f)
          #2  0x00005615484bebbb forw (less + 0x14bbb)
          #3  0x00005615484b9436 commands (less + 0xf436)
          #4  0x00005615484b09b0 main (less + 0x69b0)
          #5  0x00007f2e26287cd0 n/a (libc.so.6 + 0x29cd0)
          #6  0x00007f2e26287d8a __libc_start_main (libc.so.6 + 0x29d>
          #7  0x00005615484b0a55 _start (less + 0x6a55)
          ELF object binary architecture: AMD x86-64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions