bugDatabase-driven manual pager suite - Bugs: bug #31633, man crashes if argv[1] is in /bin

 
 

bug #31633: man crashes if argv[1] is in /bin

Submitted by:  None
Submitted on:  Fri 12 Nov 2010 08:13:33 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Colin Watson <cjwatson>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Tue 16 Nov 2010 04:36:59 PM UTC, comment #8:

Excellent, thank you. In that case I made the right decision to go ahead and release man-db 2.5.8 including that patch last night. :-)

Colin Watson <cjwatson>
Project AdministratorIn charge of this item.
Tue 16 Nov 2010 04:11:35 PM UTC, comment #7:

I tested the patch, and it fixed the bug, thanks!

Anonymous
Mon 15 Nov 2010 09:42:49 PM UTC, comment #6:

I've committed this patch in advance of testing - it seems to work for me and I think ought to be at least no worse.

Colin Watson <cjwatson>
Project AdministratorIn charge of this item.
Mon 15 Nov 2010 09:55:54 AM UTC, comment #5:

Thanks. Could you try the attached patch?

(file #22022)

Colin Watson <cjwatson>
Project AdministratorIn charge of this item.
Sun 14 Nov 2010 07:20:48 PM UTC, comment #4:

I attached the valgrind output.

(file #22020)

Anonymous
Sun 14 Nov 2010 02:58:12 PM UTC, comment #3:

Hmm. This crash is happening just before man starts freeing memory in preparation for exiting. Unfortunately this means that the error is probably corruption of the malloc arena, and the original cause could be practically anywhere.

valgrind is good for tracking this sort of thing down, although you'll need to make sure that you have a build of man-db with debugging symbols. Any chance you could run this command under valgrind?

Colin Watson <cjwatson>
Project AdministratorIn charge of this item.
Sat 13 Nov 2010 06:30:38 PM UTC, comment #2:

Here is the output.
The crash occours after the last line ("Found 1 man pages")

(file #22004)

Anonymous
Fri 12 Nov 2010 10:23:40 PM UTC, comment #1:

This new feature was documented in the release notes for 2.5.7, so isn't really hidden.

I can't reproduce this crash myself. To help me, could you please post the output of 'man --debug /bin/bash'?

Colin Watson <cjwatson>
Project AdministratorIn charge of this item.
Fri 12 Nov 2010 08:13:33 PM UTC, original submission:

It seems like there is a hidden feature in man:
When you call it with the path to an executable in /bin or /usr/bin, it opens the corresponding manpage.
But after pressing 'q', it crashes instead of doing a clean exit.

I'm using man 2.5.7 on Linux.

Output:

$ man /bin/bash

      • glibc detected *** man: double free or corruption (!prev): 0x00000000020b4540 ***

======= Backtrace: =========
/lib/libc.so.6(+0x71676)[0x7fcca13da676]
/lib/libc.so.6(cfree+0x6c)[0x7fcca13df47c]
man[0x40c8a5]
man[0x40bb3c]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7fcca1387c4d]
man[0x403919]
======= Memory map: ========
00400000-0043a000 r-xp 00000000 08:08 1162628 /usr/bin/man
0063a000-0063c000 rw-p 0003a000 08:08 1162628 /usr/bin/man
0063c000-0063d000 rw-p 00000000 00:00 0
02088000-021a2000 rw-p 00000000 00:00 0 [heap]
7fcc9c000000-7fcc9c021000 rw-p 00000000 00:00 0
7fcc9c021000-7fcca0000000 ---p 00000000 00:00 0
7fcca112c000-7fcca1141000 r-xp 00000000 08:08 1164825 /usr/lib/libgcc_s.so.1
7fcca1141000-7fcca1341000 ---p 00015000 08:08 1164825 /usr/lib/libgcc_s.so.1
7fcca1341000-7fcca1342000 rw-p 00015000 08:08 1164825 /usr/lib/libgcc_s.so.1
7fcca1369000-7fcca14bc000 r-xp 00000000 08:08 492599 /lib/libc-2.12.1.so
7fcca14bc000-7fcca16bc000 ---p 00153000 08:08 492599 /lib/libc-2.12.1.so
7fcca16bc000-7fcca16c0000 r--p 00153000 08:08 492599 /lib/libc-2.12.1.so
7fcca16c0000-7fcca16c1000 rw-p 00157000 08:08 492599 /lib/libc-2.12.1.so
7fcca16c1000-7fcca16c6000 rw-p 00000000 00:00 0
7fcca16c6000-7fcca16de000 r-xp 00000000 08:08 91236 /usr/lib/libz.so.1.2.5
7fcca16de000-7fcca18dd000 ---p 00018000 08:08 91236 /usr/lib/libz.so.1.2.5
7fcca18dd000-7fcca18de000 rw-p 00017000 08:08 91236 /usr/lib/libz.so.1.2.5
7fcca18de000-7fcca18e3000 r-xp 00000000 08:08 1159122 /usr/lib/libgdbm.so.3.0.0
7fcca18e3000-7fcca1ae2000 ---p 00005000 08:08 1159122 /usr/lib/libgdbm.so.3.0.0
7fcca1ae2000-7fcca1ae3000 rw-p 00004000 08:08 1159122 /usr/lib/libgdbm.so.3.0.0
7fcca1ae3000-7fcca1b01000 r-xp 00000000 08:08 492604 /lib/ld-2.12.1.so
7fcca1b22000-7fcca1cd5000 r--p 00000000 08:08 1165768 /usr/lib/locale/locale-archive
7fcca1cd5000-7fcca1cd8000 rw-p 00000000 00:00 0
7fcca1cde000-7fcca1d00000 rw-p 00000000 00:00 0
7fcca1d00000-7fcca1d01000 r--p 0001d000 08:08 492604 /lib/ld-2.12.1.so
7fcca1d01000-7fcca1d02000 rw-p 0001e000 08:08 492604 /lib/ld-2.12.1.so
7fcca1d02000-7fcca1d03000 rw-p 00000000 00:00 0
7fff7a6ff000-7fff7a720000 rw-p 00000000 00:00 0 [stack]
7fff7a7c7000-7fff7a7c8000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #22022:  31633.patch added by cjwatson (1KiB - text/x-diff)
file #22020:  man-valgrind.log added by None (383KiB - text/x-log - valgrind --leak-check=full -v man --debug /bin/bash)
file #22004:  mancrash.log added by None (14KiB - text/x-log - man --debug /bin/bash (stderr only))

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cjwatson (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 16 Nov 2010 04:36:59 PM UTCcjwatsonStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Mon 15 Nov 2010 09:55:54 AM UTCcjwatsonAttached File-=>Added 31633.patch, #22022
      Assigned toNone=>cjwatson
    Sun 14 Nov 2010 07:20:47 PM UTCNoneAttached File-=>Added man-valgrind.log, #22020
    Sat 13 Nov 2010 06:30:38 PM UTCNoneAttached File-=>Added mancrash.log, #22004
    Fri 12 Nov 2010 10:23:40 PM UTCcjwatsonStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1