Ticket #2906 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

64-bit versions of 4.8.x crash on Solaris while trying to copy a file

Reported by: drookie Owned by: andrew_b
Priority: major Milestone: 4.8.7
Component: mc-core Version: 4.8.4
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master committed-stable

Description

4.8.6 crashes on Solaris while trying to copy a file
I launch mc, I try to copy a file (no matter what), and it crashes.
100% reproduceable.

System:

# uname -a
SunOS anthe 5.11 11.0 i86pc i386 i86pc

Executable info:

# file /usr/local/mc/bin/mc
/usr/local/mc/bin/mc: ELF 64-bit LSB executable AMD64 Version 1 [SSE2 SSE CMOV FPU], dynamically linked, not stripped

Built with system glib, with gcc:

# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/lto-wrapper
Target: i386-pc-solaris2.11
Configured with: /builds/hudson/workspace/nightly/build/i386/components/gcc45/gcc-4.5.2/configure CC=/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/cc CXX=/ws/onnv-tools/SUNWspro/sunstudio12.1/bin/CC --prefix=/usr/gcc/4.5 --mandir=/usr/gcc/4.5/share/man --bindir=/usr/gcc/4.5/bin --libdir=/usr/gcc/4.5/lib --sbindir=/usr/gcc/4.5/sbin --enable-languages=c,c++,fortran,objc --enable-shared --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr --prefix=/usr/gcc/4.5 --mandir=/usr/gcc/4.5/share/man --infodir=/usr/gcc/4.5/share/info --libexecdir=/usr/gcc/4.5/lib CFLAGS='-g -O2 '
Thread model: posix
gcc version 4.5.2 (GCC)

MC version:
# /usr/local/mc/bin/mc -V
GNU Midnight Commander 4.8.6
Built with GLib 2.28.6
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64

Backtrace:

[root@anthe /home/emz/mc-4.8.6]# mdb /usr/local/mc/bin/mc core
Loading modules: [ libc.so.1 ld.so.1 ]

$C

fffffd7fffdfecc0 libc.so.1`statfs+0xa()
fffffd7fffdff510 file_mask_dialog+0x995()
fffffd7fffdff900 panel_operate+0x43c()
fffffd7fffdff910 copy_cmd+0x25()
fffffd7fffdff940 midnight_execute_cmd+0xc8()
fffffd7fffdff9a0 midnight_callback+0x5dc()
fffffd7fffdff9e0 buttonbar_call+0xa7()
fffffd7fffdffa20 buttonbar_callback+0x75()
fffffd7fffdffa50 send_message+0x2c()
fffffd7fffdffa90 dlg_try_hotkey+0x170()
fffffd7fffdffad0 dlg_key_event+0xc0()
fffffd7fffdffb10 dlg_process_event+0x97()
fffffd7fffdffb60 frontend_run_dlg+0x143()
fffffd7fffdffb80 run_dlg+0x24()
fffffd7fffdffb90 create_panels_and_run_mc+0x141()
fffffd7fffdffc00 do_nc+0x121()
fffffd7fffdffc60 main+0x3b9()
fffffd7fffdffc70 _start+0x6c()

Attachments

config.h (25.2 KB) - added by drookie 7 years ago.
ticket-2906.patch (323 bytes) - added by drookie 7 years ago.

Change History

comment:1 Changed 7 years ago by drookie

  • Summary changed from 4.8.6 crashes on Solaris while trying to copy a file to 4.8.6, 4.8.5 crashes on Solaris while trying to copy a file

4.8.5 does exactly the same.

Info:

# /usr/local/mc/bin/mc -V
GNU Midnight Commander 4.8.5
Built with GLib 2.28.6
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

Backtrace:

# mdb /usr/local/mc/bin/mc core
Loading modules: [ libc.so.1 ld.so.1 ]

$C

fffffd7fffdfecc0 libc.so.1`statfs+0xa()
fffffd7fffdff510 file_mask_dialog+0x995()
fffffd7fffdff900 panel_operate+0x43c()
fffffd7fffdff910 copy_cmd+0x25()
fffffd7fffdff940 midnight_execute_cmd+0xc8()
fffffd7fffdff9a0 midnight_callback+0x5dc()
fffffd7fffdff9e0 buttonbar_call+0xa7()
fffffd7fffdffa20 buttonbar_callback+0x75()
fffffd7fffdffa50 send_message+0x2c()
fffffd7fffdffa90 dlg_try_hotkey+0x170()
fffffd7fffdffad0 dlg_key_event+0xc0()
fffffd7fffdffb10 dlg_process_event+0x97()
fffffd7fffdffb60 frontend_run_dlg+0x143()
fffffd7fffdffb80 run_dlg+0x24()
fffffd7fffdffb90 create_panels_and_run_mc+0x141()
fffffd7fffdffc00 do_nc+0x121()
fffffd7fffdffc60 main+0x3b9()
fffffd7fffdffc70 _start+0x6c()

comment:2 Changed 7 years ago by drookie

4.8.1.6 - same behaviour.

Info :

# /usr/local/mc/bin/mc -V
GNU Midnight Commander 4.8.1.6
Built with GLib 2.28.6
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

Backtrace:

# mdb /usr/local/mc/bin/mc core
Loading modules: [ libc.so.1 ld.so.1 ]

$C

fffffd7fffdfecd0 libc.so.1`statfs+0xa()
fffffd7fffdff520 file_mask_dialog+0x995()
fffffd7fffdff910 panel_operate+0x43c()
fffffd7fffdff920 copy_cmd+0x25()
fffffd7fffdff950 midnight_execute_cmd+0xc8()
fffffd7fffdff9b0 midnight_callback+0x5dc()
fffffd7fffdff9f0 buttonbar_call+0xa4()
fffffd7fffdffa30 buttonbar_callback+0x75()
fffffd7fffdffa60 send_message+0x2c()
fffffd7fffdffaa0 dlg_try_hotkey+0x162()
fffffd7fffdffae0 dlg_key_event+0xbd()
fffffd7fffdffb20 dlg_process_event+0x94()
fffffd7fffdffb70 frontend_run_dlg+0x13c()
fffffd7fffdffb90 run_dlg+0x24()
fffffd7fffdffba0 create_panels_and_run_mc+0x141()
fffffd7fffdffc00 do_nc+0x115()
fffffd7fffdffc60 main+0x3b9()
fffffd7fffdffc70 _start+0x6c()

comment:3 Changed 7 years ago by drookie

4.8.6, being built with Solaris Studio compiler, and examined with the dbx gives more verbose output:

# /usr/local/mc/bin/mc
To remove this message, put `dbxenv suppress_startup_message 7.9' in your .dbxrc
Reading mc
core file header read successfully
Reading ld.so.1
Reading libslang.so.2.2.4
Reading libgmodule-2.0.so.0.2800.6
Reading libpthread.so.1
Reading libglib-2.0.so.0.2800.6
Reading libxnet.so.1
Reading libc.so.1
Reading libm.so.2
Reading libsocket.so.1
Reading libnsl.so.1
Reading en_US.UTF-8.so.3
Reading methods_unicode.so.3
Reading UTF-8%UTF-8.so
t@1 (l@1) program terminated by signal SYS
0xfffffd7fff24b6fa: statfs+0x000a: jb cerror [ 0xfffffd7fff1a7720, .-0xa3fda ]
Current function is filegui
check_attrs_on_fs

246 if (statfs (fs_path, &stfs) != 0)

(dbx) where
current thread: t@1

[1] statfs(0x6c93b0, 0xfffffd7fffdfec30, 0x0, 0xfffffd7ffe1b00fc, 0x61c920, 0x3b), at 0xfffffd7fff24b6fa

=>[2] fileguicheck_attrs_on_fs(fs_path = 0x6c93b0 "/home/emz/mc.cores/"), line 246 in "filegui.c"

[3] file_mask_dialog(ctx = 0x6e4690, operation = OP_COPY, only_one = 1, format = 0x6402c0 "Copy file "%s" with source mask:", text = 0x6ad880, def_text = 0x6c93b0 "/home/emz/mc.cores/", do_bg = 0xfffffd7fffdff72c), line 1121 in "filegui.c"
[4] panel_operate(source_panel = 0x6bde10, operation = OP_COPY, force_single = 0), line 2711 in "file.c"
[5] copy_cmd(), line 833 in "cmd.c"
[6] midnight_execute_cmd(sender = 0x6a4f30, command = 21U), line 1145 in "midnight.c"
[7] midnight_callback(h = 0x6abe40, sender = 0x6a4f30, msg = DLG_ACTION, parm = 21, data = (nil)), line 1587 in "midnight.c"
[8] buttonbar_call(bb = 0x6a4f30, i = 4), line 155 in "buttonbar.c"
[9] buttonbar_callback(w = 0x6a4f30, msg = WIDGET_HOTKEY, parm = 1005), line 175 in "buttonbar.c"
[10] send_message(w = 0x6a4f30, msg = WIDGET_HOTKEY, parm = 1005), line 136 in "widget-common.h"
[11] dlg_try_hotkey(h = 0x6abe40, d_key = 1005), line 465 in "dialog.c"
[12] dlg_key_event(h = 0x6abe40, d_key = 1005), line 510 in "dialog.c"
[13] dlg_process_event(h = 0x6abe40, key = 1005, event = 0xfffffd7fffdffaac), line 1259 in "dialog.c"
[14] frontend_run_dlg(h = 0x6abe40), line 569 in "dialog.c"
[15] run_dlg(h = 0x6abe40), line 1291 in "dialog.c"
[16] create_panels_and_run_mc(), line 962 in "midnight.c"
[17] do_nc(), line 1770 in "midnight.c"
[18] main(argc = 1, argv = 0xfffffd7fffdffc28), line 567 in "main.c"

(dbx)

Hope it will help.

comment:4 follow-up: ↓ 5 Changed 7 years ago by drookie

  • Summary changed from 4.8.6, 4.8.5 crashes on Solaris while trying to copy a file to 4.8.x crashes on Solaris while trying to copy a file

comment:5 in reply to: ↑ 4 Changed 7 years ago by andrew_b

Replying to drookie:

Summary changed from 4.8.6, 4.8.5 crashes on Solaris while trying to copy a file to 4.8.x crashes on Solaris while trying to copy a file

Does 4.8.4 or older crash too?

Please attach here your config.h.

Changed 7 years ago by drookie

comment:6 Changed 7 years ago by drookie

It does.
I attached the requested file.

By the way, every 4.8.x version complaing about filegui.c (the piece of the coder in creashed later in) saying 'implicit declaration of statfs function'.

Info:

# /usr/local/mc/bin/mc -V
GNU Midnight Commander 4.8.4
Built with GLib 2.28.6
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

Backtrace:

# /usr/local/solarisstudio12.3/bin/dbx /usr/local/mc/bin/mc core-4.8.4
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.9' in your .dbxrc
Reading mc
core file header read successfully
Reading ld.so.1
Reading libslang.so.2.2.4
Reading libgmodule-2.0.so.0.2800.6
Reading libpthread.so.1
Reading libglib-2.0.so.0.2800.6
Reading libxnet.so.1
Reading libc.so.1
Reading libm.so.2
Reading libsocket.so.1
Reading libnsl.so.1
Reading en_US.UTF-8.so.3
Reading methods_unicode.so.3
Reading UTF-8%UTF-8.so
t@1 (l@1) program terminated by signal SYS
0xfffffd7fff23b6fa: statfs+0x000a: jb cerror [ 0xfffffd7fff197720, .-0xa3fda ]
Current function is filegui
check_attrs_on_fs

246 if (statfs (fs_path, &stfs) != 0)

(dbx) where
current thread: t@1

[1] statfs(0x5e5250, 0xfffffd7fffdfec80, 0xfffffd7fffdfec80, 0x3b, 0xfffffd7ffe1b00fc, 0x0), at 0xfffffd7fff23b6fa

=>[2] fileguicheck_attrs_on_fs(fs_path = 0x5e5250 "/usr/local/mc/bin/"), line 246 in "filegui.c"

[3] file_mask_dialog(ctx = 0x607350, operation = OP_COPY, only_one = 1, format = 0x55aab0 "Copy file "%s" with source mask:", text = 0x5d1100, def_text = 0x5e5250 "/usr/local/mc/bin/", do_bg = 0xfffffd7fffdff79c), line 1121 in "filegui.c"
[4] panel_operate(source_panel = 0x5c8c10, operation = OP_COPY, force_single = 0), line 2709 in "file.c"
[5] copy_cmd(), line 833 in "cmd.c"
[6] midnight_execute_cmd(sender = 0x5cf610, command = 21U), line 1145 in "midnight.c"
[7] midnight_callback(h = 0x5c2b50, sender = 0x5cf610, msg = DLG_ACTION, parm = 21, data = (nil)), line 1587 in "midnight.c"
[8] buttonbar_call(bb = 0x5cf610, i = 4), line 153 in "buttonbar.c"
[9] buttonbar_callback(w = 0x5cf610, msg = WIDGET_HOTKEY, parm = 1005), line 175 in "buttonbar.c"
[10] send_message(w = 0x5cf610, msg = WIDGET_HOTKEY, parm = 1005), line 136 in "widget-common.h"
[11] dlg_try_hotkey(h = 0x5c2b50, d_key = 1005), line 465 in "dialog.c"
[12] dlg_key_event(h = 0x5c2b50, d_key = 1005), line 510 in "dialog.c"
[13] dlg_process_event(h = 0x5c2b50, key = 1005, event = 0xfffffd7fffdffb80), line 1259 in "dialog.c"
[14] frontend_run_dlg(h = 0x5c2b50), line 569 in "dialog.c"
[15] run_dlg(h = 0x5c2b50), line 1291 in "dialog.c"
[16] create_panels_and_run_mc(), line 962 in "midnight.c"
[17] do_nc(), line 1778 in "midnight.c"
[18] main(argc = 1, argv = 0xfffffd7fffdffcd8), line 567 in "main.c"

(dbx)

comment:7 Changed 7 years ago by drookie

Yeah, it's a config.h from 4.8.4 (forgot to mention).

comment:8 Changed 7 years ago by drookie

  • Summary changed from 4.8.x crashes on Solaris while trying to copy a file to 64-bit versions of 4.8.x crash on Solaris while trying to copy a file

By the way, I found a workaround:

being compiled without -m64 it doesn't crash on copying.

Last MC version without this bug that I built with -m64 is 4.7.5.2.

comment:9 Changed 7 years ago by andrew_b

Wait for a minute.

Can you build and test some branch from repo? If not, I will create a tar.gz for you.

comment:10 follow-up: ↓ 11 Changed 7 years ago by drookie

Sure. Which branch should I test ?

By the way, a friend of mine took a look into a problem and found a solution. I attached the patch that solves this issue with 64-bit mode.

Changed 7 years ago by drookie

comment:11 in reply to: ↑ 10 ; follow-up: ↓ 12 Changed 7 years ago by andrew_b

Replying to drookie:

Sure. Which branch should I test ?

The branch is DEV_gnulib_sync. Or you can get https://github.com/downloads/MidnightCommander/mc/mc-DEV_gnulib_sync-gaeb0243.tar.gz

By the way, a friend of mine took a look into a problem and found a solution. I attached the patch that solves this issue with 64-bit mode.

Don't forget about other OSes (Linux, xBSD, etc) and 32-bit mode. You patch probably breaks support of that.

comment:12 in reply to: ↑ 11 Changed 7 years ago by drookie

Replying to andrew_b:


Don't forget about other OSes (Linux, xBSD, etc) and 32-bit mode. You patch probably breaks support of that.

Yup, no doubt it will break all of this, but it was simply the sample raw patch. :)

I built the proposed branch from a tarball (this machine doesn't have git yet) and it doesn't crash while copying. Thanks.

comment:13 Changed 7 years ago by andrew_b

  • Status changed from new to accepted
  • Keywords stable-candidate added
  • Version changed from master to 4.8.4
  • Branch state changed from no branch to on review
  • Milestone set to 4.8.7
  • Owner set to andrew_b

Thanks for the feedback!

Branch: 2906_copy_crash_on_solaris (parent: master).
Initial changeset:d5fce7006f674981693658f0d87536b0446bf079

comment:14 Changed 7 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:15 Changed 7 years ago by angel_il

  • Votes for changeset changed from slavazanko to slavazanko angel_il
  • Branch state changed from on review to approved

comment:16 Changed 7 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko angel_il to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: [80bfefe0ff7d8c03446b2774f219e36f80493779].

git log --pretty=oneline 91f9195..80bfefe

comment:17 Changed 7 years ago by andrew_b

  • Keywords stable-candidate removed
  • Status changed from testing to closed
  • Votes for changeset changed from committed-master to committed-master committed-stable

Merged to 4.8.1-stable: [a4b1424767dab5f573918c77fa144c278cc72e21].

git log --pretty=oneline 5893280..a4b1424
Note: See TracTickets for help on using tickets.