Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mc segfault on F7 in viewer & editor on FreeBSD #1621

Closed
mc-butler opened this issue Sep 16, 2009 · 40 comments
Closed

mc segfault on F7 in viewer & editor on FreeBSD #1621

mc-butler opened this issue Sep 16, 2009 · 40 comments
Assignees
Labels
area: search Search subsystem prio: high Serious problem that could block progress ver: 4.7.0-pre2 Reproducible in version 4.7.0-pre2
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/1621
Reporter S_Paul

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

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 16, 2009 at 4:40 UTC

mc.core

@mc-butler
Copy link
Author

Changed by iNode (@iNode) on Sep 16, 2009 at 5:48 UTC (comment 1)

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.

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 17, 2009 at 5:16 UTC

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 17, 2009 at 5:17 UTC (comment 2)

latest ..83..

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 17, 2009 at 5:17 UTC (comment 3)

attach

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 17, 2009 at 5:18 UTC (comment 4)

and thanks.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 17, 2009 at 7:37 UTC (comment 5)

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

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

Please test it.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 17, 2009 at 7:38 UTC (comment 6)

Sorry...

[857e64a6ec1c31651d65de96e63b619dda21f6f4]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 17, 2009 at 7:56 UTC (comment 7)

  • Severity changed from no branch to on review

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 17, 2009 at 9:33 UTC (comment 8)

still segfault

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Sep 17, 2009 at 10:13 UTC (comment 8.9)

Replying to S_Paul:

still segfault

please attach last crash report.

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 17, 2009 at 11:18 UTC

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 17, 2009 at 11:19 UTC (comment 10)

ok

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 18, 2009 at 10:21 UTC (comment 11)

Please test again this branch.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 21, 2009 at 4:23 UTC

(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.

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 21, 2009 at 4:25 UTC

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 21, 2009 at 4:26 UTC (comment 12)

stil segfault..
attach

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 21, 2009 at 7:51 UTC (comment 13)

  • Blocked by set to #1556

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 21, 2009 at 9:23 UTC

  • Blocked by #1556 deleted

(In #1556) Merged to master.
[434ebd3]

All other dialogs will be fixed in #64.

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 21, 2009 at 9:52 UTC (comment 16)

is my reports help you?
something more?

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 21, 2009 at 10:11 UTC (comment 16.17)

Replying to S_Paul:

is my reports help you?

Yes. I'm working with this bug.

something more?

No.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 22, 2009 at 9:45 UTC (comment 18)

Branch is completely rewritten. Please test.
[2959b2697c095392172d5cf940bf3b781eef92c7]
[f7f5ccd7d8c219568bb9c4f18c75e9aeb7800e71]

@mc-butler
Copy link
Author

Changed by sfionov (fionov@….com) on Sep 22, 2009 at 20:16 UTC (comment 19)

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.

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Sep 22, 2009 at 20:26 UTC (comment 20)

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

@mc-butler
Copy link
Author

Changed by dmartina (dhmartina@….es) on Sep 22, 2009 at 21:12 UTC (comment 21)

Now it doesn't crash. Code looks good.

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 23, 2009 at 6:26 UTC (comment 22)

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

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 23, 2009 at 6:27 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 23, 2009 at 7:21 UTC (comment 23)

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 23, 2009 at 7:31 UTC (comment 24)

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

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 23, 2009 at 11:40 UTC (comment 25)

It works! thank to all!

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Sep 23, 2009 at 12:10 UTC (comment 26)

It works! thank to all!

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

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 23, 2009 at 12:21 UTC (comment 27)

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

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Sep 23, 2009 at 12:43 UTC (comment 28)

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

S_Paul, dmartina: votes are present.

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 24, 2009 at 3:24 UTC (comment 29)

how? "resolve as?"

@mc-butler
Copy link
Author

Changed by iNode (@iNode) on Sep 24, 2009 at 3:54 UTC (comment 30)

Enter you nickname in "Votes for changeset" field.

@mc-butler
Copy link
Author

Changed by S_Paul on Sep 24, 2009 at 6:03 UTC (comment 31)

  • Votes set to S_Paul

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Sep 24, 2009 at 23:07 UTC (comment 32)

  • Votes 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.

@mc-butler
Copy link
Author

Changed by dmartina (dhmartina@….es) on Sep 25, 2009 at 20:54 UTC (comment 33)

  • Votes changed from S_Paul slavazanko to S_Paul slavazanko dmartina

OK

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Sep 25, 2009 at 21:23 UTC (comment 34)

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

merge [d450e8e]

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Sep 25, 2009 at 21:24 UTC (comment 35)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: search Search subsystem prio: high Serious problem that could block progress ver: 4.7.0-pre2 Reproducible in version 4.7.0-pre2
Development

No branches or pull requests

2 participants