Ticket #1621 (closed defect: fixed)
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
Change History
Changed 15 years ago by S_Paul
- Attachment mc.core.bz2 added
comment:1 Changed 15 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.
comment:5 Changed 15 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:10 Changed 15 years ago by S_Paul
ok
comment:11 Changed 15 years ago by andrew_b
Please test again this branch.
comment:12 Changed 15 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.
comment:13 Changed 15 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 15 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 15 years ago by S_Paul
is my reports help you?
something more?
comment:17 in reply to: ↑ 16 Changed 15 years ago by andrew_b
comment:18 Changed 15 years ago by andrew_b
Branch is completely rewritten. Please test.
changeset:2959b2697c095392172d5cf940bf3b781eef92c7
changeset:f7f5ccd7d8c219568bb9c4f18c75e9aeb7800e71
comment:19 Changed 15 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 15 years ago by slavazanko
Big thanks for your comment. In some situation (like this) we just beleive :)
comment:21 Changed 15 years ago by dmartina
Now it doesn't crash. Code looks good.
comment:22 Changed 15 years ago by S_Paul
stil segfault
only options - ./configure --enable-charset
comment:23 Changed 15 years ago by andrew_b
- Status changed from accepted to assigned
- Owner changed from andrew_b to slavazanko
comment:24 Changed 15 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 15 years ago by S_Paul
It works! thank to all!
comment:26 Changed 15 years ago by slavazanko
It works! thank to all!
S_Paul, is it exactly? What about segfault.2.bz2 attachment?
comment:27 Changed 15 years ago by S_Paul
да, i have some problem with brain :)
sorry for
comment:28 Changed 15 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 15 years ago by S_Paul
how? "resolve as?"
comment:30 Changed 15 years ago by iNode
Enter you nickname in "Votes for changeset" field.
comment:32 Changed 15 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 15 years ago by dmartina
- Votes for changeset changed from S_Paul slavazanko to S_Paul slavazanko dmartina
OK
comment:34 Changed 15 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
mc.core