mc crashes on saving after editing at EOF in hex mode

Bug #713630 reported by Vladimir Rutsky
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mc (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: mc

Steps to reproduce:
 1. Create new file with single byte in it:
  $ echo -n 'a' > test
 2. Open file:
  $ mcedit -v test
 3. Press <F4> to switch in hex mode.
 4. Press <F2> to start editing.
 5. Press <b>, <c>, <d> to substitute current character with new hexadecimal value.
 6. Press <F10> and select "Yes" to exit with saving.

Observed behavior - mc crashes outputting:
> mcedit: datasource.c:229: mcview_set_byte: Assertion `offset < mcview_get_filesize (view)' failed.
> Aborted (core dumped)

Expected behaviour - normal exit.

When reproducing in gdb session following stack trace observed:
(gdb) bt
#0 0x00007ffff7244a75 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff72485c0 in *__GI_abort () at abort.c:92
#2 0x00007ffff723d941 in *__GI___assert_fail (assertion=0x497fa8 "offset < mcview_get_filesize (view)", file=<value optimized out>, line=229,
    function=0x497ee0 "mcview_set_byte") at assert.c:81
#3 0x0000000000481f81 in ?? ()
#4 0x00000000004836ad in ?? ()
#5 0x000000000047ffbe in ?? ()
#6 0x000000000048094b in mcview_callback ()
#7 0x0000000000415811 in ?? ()
#8 0x000000000040bcc0 in ?? ()
#9 0x000000000040bea7 in ?? ()
#10 0x000000000047ecc0 in ?? ()
#11 0x000000000042f4ac in ?? ()
#12 0x0000000000447099 in ?? ()
#13 0x00007ffff722fc4d in __libc_start_main (main=<value optimized out>, argc=<value optimized out>, ubp_av=<value optimized out>, init=<value optimized out>,
    fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fffffffe158) at libc-start.c:226
#14 0x000000000040a2a9 in ?? ()
#15 0x00007fffffffe158 in ?? ()
#16 0x000000000000001c in ?? ()
#17 0x0000000000000003 in ?? ()
#18 0x00007fffffffe495 in ?? ()
#19 0x0000000000000000 in ?? ()
(gdb)

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: mc 3:4.7.0-1ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-28.55-generic 2.6.32.27+drm33.12
Uname: Linux 2.6.32-28-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Sat Feb 5 15:44:31 2011
SourcePackage: mc

Related branches

Revision history for this message
Vladimir Rutsky (rutsky) wrote :
Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Try the packages from my PPA. I can no longer reproduce this segfault. If it works I will mark this bug as fixed since 4.7.0.9 was auto-synced in Natty.

Yury V. Zaytsev (zyv)
Changed in mc (Ubuntu):
status: New → Incomplete
Revision history for this message
Vladimir Rutsky (rutsky) wrote :

Yury,

I installed Midnight Commander from your ppa and bug is still reproducible (with steps described in original bug report).

The only difference is assertion line number:
> datasource.c:241: mcview_set_byte: Assertion `offset < mcview_get_filesize (view)' failed.

Changed in mc (Ubuntu):
status: Incomplete → New
Revision history for this message
Vladimir Rutsky (rutsky) wrote :

For last test I used mc from ppa:zyv/ppa with version:
$ mc --version
GNU Midnight Commander 4.7.0.9
Virtual File System: tarfs, extfs, cpiofs, ftpfs, fish, undelfs
With builtin Editor
Using system-installed S-Lang library with terminfo database
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
Data types: char 8 int 32 long 64 void * 64 off_t 64 ecs_char 8

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Hi! Ok, I was able to reproduce it. Maybe I did something wrong the first time around. This bug is fixed in 4.7.5.1. One day I will get to uploading it :-(

Changed in mc (Ubuntu):
status: New → In Progress
Revision history for this message
Maarten Bezemer (veger) wrote :

I can confirm it is broken in 4.7.0.9-2 and it will/is fixed in 4.8.1 (see bug #905610)

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.4 KiB)

This bug was fixed in the package mc - 3:4.8.1-2ubuntu1

---------------
mc (3:4.8.1-2ubuntu1) precise; urgency=low

  * Sync from debian testing (LP: #905610, LP: #314614, LP: #410031,
      LP: #562361, LP: #632816, LP: #713630, LP: #770673, LP: #837163)
  * Added Pre-Depends for dpkg-maintscript-helper availability

mc (3:4.8.1-2) unstable; urgency=low

  * Build-Depends are updated: 'bison' moved to build-deps;
    architecture wildcard replaced silly "type-handling | not+linux-gnu"
    (Closes: #587875 N:"Please remove type-handling dependency")
  * new patch to increase maximum file size for mcedit to 128 MiB
    (Closes: #369565 W:"mcedit: wishing a bigger file size limit")
    Thanks to Daniele Giacomini.
  * new patch to disable "Return does autoindent" by default in mcedit
    (Closes: #570502 N:"mcedit: adding extra spaces when pasting a text
     preceded by spaces")
    (Closes: #575711 N:"pasting extra tabs, AGAIN")
  * added mc.NEWS file with notes about important changes in this release
    (Closes: #661435 W:"lynx-like motion is lost during upgrade to 4.8.1")
  * added symlinks to all scripts in /usr/lib/mc for backward compatibility
  * new patch to correct path to scripts in man page
    (Closes: #661481 N:"Acknowledgement mc: /usr/share/mc/bin/mc.sh missing")
  * 'unzip' added to build-deps to set proper zip mode at build-time;
    'unzip' moved to Recommends from Suggests.
    (Closes: #661467 N:"mc: zip file browsing broken")
  * Recommends 'perl' and 'unzip' instead of Suggests
  * dropped old 20_wrong_path_to_wrappers.patch, which was breaking
    correct path to wrappers (note the precisely chosen file name ;)
  * corrected and properly annotated 09_uzip_broken_528239.patch

mc (3:4.8.1-1) unstable; urgency=low

  * New upstream release [December 2011]
    (Closes: #618542 N:"please follow upstream progress")
    (Closes: #528331 N:"[VFS] utar is unable to open .tar files")
    (Closes: #626287 N:"SHIFT+F6 should open rename dialog")
    (Closes: #609489 I:"If <F4> is pressed ~/.mc/cedit/Syntax is missing")
    (Closes: #606331 I:"regression: panel configuration on startup;
     view search configuration")
    (Closes: #567119 I:"mcedit ignores editnormal in MC_COLOR_TABLE")
    (Closes: #587372 N:"fish does not preserve modification time when
     copying files to remote host")
    (Closes: #592396 N:"file rename (F6) with non-usual characters failed")
    (Closes: #525146 N:"mc hangs when copying multiple files from ftp")
    (Closes: #574761 N:" [VFS] internal tar considers files containig
     '@' as directories.")
    (Closes: #584687 N:"mc/fish segfaults when remote copy/move appends
     to existing file")
    (Closes: #619092 W:"Wishlist: mc to open ISO files")
    (Closes: #602857 M:"use 7zr for generic .7z archives if available")
    (Closes: #61987 W:"total ETA wanted")
  * debian/watch
    • fixed and updated to fetch latest .tar.xz
  * dropped CDBS, now using debhelper only
  * debhelper & compat to version 9
  * dh-autoreconf to update toolchain
  * intltoolize to refresh Makefile.in.in
  * debian/control
    • standards to 3.9.3 (thanks to Andreas Tille)
    • added to build-deps:
      + 'type-handling...

Read more...

Changed in mc (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.