Ticket #1621 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

mc segfault on F7 in viewer & editor on FreeBSD

Reported by: S_Paul Owned by: slavazanko
Priority: critical Milestone: 4.7.0-pre3
Component: mc-search Version: 4.7.0-pre2
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

try to search in some file - Segmentation fault: 11 (core dumped)

FreeBSD-7
git 4.7.0-pre2-68-g43537b0
Compiler: gcc -std=gnu99
Compiler flags: -g -O2 -Wall
File system: Midnight Commander Virtual File System

cpio, tar, ftp, fish, extfs, sfs

Screen library: S-Lang library (installed on the system)
Mouse support: xterm only
X11 events support: yes
With subshell support: yes
Internal editor: yes
Support for charset: yes
Search type: glib-regexp

Attachments

mc.core.bz2 (349.1 KB) - added by S_Paul 7 years ago.
mc.core
mc_segfault.bz2 (3.2 KB) - added by S_Paul 7 years ago.
segfault.bz2 (3.2 KB) - added by S_Paul 7 years ago.
segfault2109.bz2 (3.3 KB) - added by S_Paul 7 years ago.
segfault.2.bz2 (3.2 KB) - added by S_Paul 7 years ago.

Change History

Changed 7 years ago by S_Paul

mc.core

comment:1 Changed 7 years ago by iNode

Please check at the latest master branch (your test on changeset 68, actual for now 84) and use search before reporting bugs. Also here described how to report segfaults, please read.

Changed 7 years ago by S_Paul

comment:2 Changed 7 years ago by S_Paul

latest ..83..

comment:3 Changed 7 years ago by S_Paul

attach

comment:4 Changed 7 years ago by S_Paul

and thanks.

comment:5 Changed 7 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Component changed from mc-core to mc-search
  • Milestone changed from 4.7 to 4.7.0-pre3

Created branch 1621_segfault_search_f7. Parent branch:master.
chahgeset:857e64a6ec1c31651d65de96e63b619dda21f6f4

Please test it.

comment:7 Changed 7 years ago by andrew_b

  • severity changed from no branch to on review

comment:8 follow-up: ↓ 9 Changed 7 years ago by S_Paul

still segfault

comment:9 in reply to: ↑ 8 Changed 7 years ago by angel_il

Replying to S_Paul:

still segfault

please attach last crash report.

Changed 7 years ago by S_Paul

comment:10 Changed 7 years ago by S_Paul

ok

comment:11 Changed 7 years ago by andrew_b

Please test again this branch.

comment:12 Changed 7 years ago by andrew_b

  • Blocking 1623 added

(In #1623) Replying to dmartina:

I have been debugging this for a copuple of hours. I think I got some clues:

1) src/search/libc.c (251): mc_search_get_types_strings_array
ret = g_malloc0(sizeof(char) * sizeof(types_str) );

Is the last sizeof(types_str) giving the size of the array or just the size of a pointer? I tested it and always got 4 whatever I chopped the array! Here we need 4 strings plus a null. Should be fixed. I mean completely fixed.

Seems this bug and #1621 have the same root.

2) edit/editcmd_dialogs.c (122):editcmd_dialog_replace_show
When back from QuickDialog? the list_of_types has new string pointers with the same content. I suppose that these strings are translated twice, QuickDialog? is getting rid (gfree) of the second set and we get the error when trying to free the second set twice. Maybe it's just memory we try to steal from gettext if we didn't strdup somewhere... Memory leak: ¿where did the first set go?

Yepp. :(

3) If 2) is right we may avoid the _() call used in the 1) function.

I agree.

4) Cross fingers not to have many more side-effects.

Changed 7 years ago by S_Paul

comment:12 Changed 7 years ago by S_Paul

  • Blocking 1623 removed

stil segfault..
attach

comment:13 Changed 7 years ago by andrew_b

  • Blocked By 1556 added

The one piece of code is modified in several tickets. Thus set blockedby 1556.

comment:14 Changed 7 years ago by andrew_b

  • Blocked By 1556 removed

(In #1556) Merged to master.
changeset:434ebd3780d400cffa274b96ea29614e668f58fc

All other dialogs will be fixed in #64.

comment:16 follow-up: ↓ 17 Changed 7 years ago by S_Paul

is my reports help you?
something more?

comment:17 in reply to: ↑ 16 Changed 7 years ago by andrew_b

Replying to S_Paul:

is my reports help you?

Yes. I'm working with this bug.

something more?

No.

comment:19 Changed 7 years ago by sfionov

I had the same problem on OpenSolaris? with Sun Studio compiler (in -m32 mode). mc built from master branch segfaults by pressing F7 or F4 in editor. Switching to ticket's branch helps, mc no longer segfaults.

comment:20 Changed 7 years ago by slavazanko

Big thanks for your comment. In some situation (like this) we just beleive :)

comment:21 Changed 7 years ago by dmartina

Now it doesn't crash. Code looks good.

comment:22 Changed 7 years ago by S_Paul

stil segfault
only options - ./configure --enable-charset

Changed 7 years ago by S_Paul

comment:23 Changed 7 years ago by andrew_b

  • Status changed from accepted to assigned
  • Owner changed from andrew_b to slavazanko

comment:24 Changed 7 years ago by andrew_b

The same prоblem. I have not any idea how to fix it. I believe that slavazanko will achieve success. :)

comment:25 Changed 7 years ago by S_Paul

It works! thank to all!

comment:26 Changed 7 years ago by slavazanko

It works! thank to all!

S_Paul, is it exactly? What about segfault.2.bz2 attachment?

comment:27 Changed 7 years ago by S_Paul

да, i have some problem with brain :)
sorry for

comment:28 Changed 7 years ago by slavazanko

Okay, if all good (and you sure) - you may vote for this branch.

S_Paul, dmartina: votes are present.

comment:29 Changed 7 years ago by S_Paul

how? "resolve as?"

comment:30 Changed 7 years ago by iNode

Enter you nickname in "Votes for changeset" field.

comment:31 Changed 7 years ago by S_Paul

  • Votes for changeset set to S_Paul

comment:32 Changed 7 years ago by slavazanko

  • Votes for changeset changed from S_Paul to S_Paul slavazanko
  • severity changed from on review to approved

I'm downloaded FreeBSD-7.2 ISO image, then I'm installed FreeBSD into virtual mashine.

Well, trouble resolved. Vote here.

comment:33 Changed 7 years ago by dmartina

  • Votes for changeset changed from S_Paul slavazanko to S_Paul slavazanko dmartina

OK

comment:34 Changed 7 years ago by slavazanko

  • Status changed from assigned to testing
  • Votes for changeset changed from S_Paul slavazanko dmartina to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:35 Changed 7 years ago by slavazanko

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.