Ticket #1906 (closed defect: fixed)

Opened 15 years ago

Last modified 15 years ago

edit: crash on file open whoen some Syntax files are absent (reported by pavlinux)

Reported by: slyfox Owned by: slyfox
Priority: major Milestone: 4.7.0.1
Component: mcedit Version: master
Keywords: syntax, crash Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description (last modified by slyfox) (diff)

valgrind log snippet: (from here http://pavlinux.ru/vgmc.log)

==26750== Memcheck, a memory error detector
==26750== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==26750== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==26750== Command: /usr/libexec/mc/cons.saver /dev/pts/0
==26750== Parent PID: 26749
==26750== 
==26750== 
==26750== HEAP SUMMARY:
==26750==     in use at exit: 0 bytes in 0 blocks
==26750==   ==26749== Invalid free() / delete / delete[]
==26749==    at 0x4A06DD8: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==26749==    by 0x48B5F9: edit_read_syntax_rules (syntax.c:766)
==26749==    by 0x48CDA7: edit_read_syntax_file (syntax.c:1140)
==26749==    by 0x48D06D: edit_load_syntax (syntax.c:1219)
==26749==    by 0x4762F6: edit_init (edit.c:834)
==26749==    by 0x4858FC: edit_file (editwidget.c:241)
==26749==    by 0x44D017: do_edit_at_line (cmd.c:304)
==26749==    by 0x44D098: do_edit (cmd.c:324)
==26749==    by 0x44D10E: edit_cmd (cmd.c:331)
==26749==    by 0x46C2E4: midnight_execute_cmd (main.c:1193)
==26749==    by 0x46CD41: midnight_callback (main.c:1690)
==26749==    by 0x4353F4: buttonbar_call (widget.c:2654)
==26749==  Address 0x60f8e10 is 0 bytes inside a block of size 30 free'd
==26749==    at 0x4A06DD8: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==26749==    by 0x48B32C: open_include_file (syntax.c:705)
==26749==    by 0x48B6E8: edit_read_syntax_rules (syntax.c:784)
==26749==    by 0x48CDA7: edit_read_syntax_file (syntax.c:1140)
==26749==    by 0x48D06D: edit_load_syntax (syntax.c:1219)
==26749==    by 0x4762F6: edit_init (edit.c:834)
==26749==    by 0x4858FC: edit_file (editwidget.c:241)
==26749==    by 0x44D017: do_edit_at_line (cmd.c:304)
==26749==    by 0x44D098: do_edit (cmd.c:324)
==26749==    by 0x44D10E: edit_cmd (cmd.c:331)
==26749==    by 0x46C2E4: midnight_execute_cmd (main.c:1193)
==26749==    by 0x46CD41: midnight_callback (main.c:1690)

We see doublefree memory corruption here, introduced by spurious g_free(error_file_name) of changeset:0c17219b2ab5cb5fe2e73f8d7cc9c11c755a3ae4 (syntax.c file)

The rest of code seems to store real syntax file name there.

Merged as changeset:4c8dbd8f3bf7456de818ef272e5ca2dce5c6a6ce

Change History

comment:1 Changed 15 years ago by slyfox

  • Status changed from new to accepted
  • severity changed from no branch to on review

Pushed as
changeset:721c93222c0ee1903d16d0e2a804a886a3bd0520
branch:1906_crash_on_syntax

Please review!

comment:2 Changed 15 years ago by metux

  • Votes for changeset set to metux

should be rebased ... ;-o

comment:3 Changed 15 years ago by metux

  • Blocked By 1872 added

Buildfarm test still fails, since #1872 not yet merged ;-o

comment:4 Changed 15 years ago by andrew_b

  • Votes for changeset changed from metux to metux andrew_b
  • severity changed from on review to approved
  • Blocked By 1872 removed

Removed blockedby #1872 because this branch doesn't produce new compile warnings.

comment:5 Changed 15 years ago by slyfox

  • Status changed from accepted to testing
  • Resolution set to fixed
  • severity changed from approved to merged
  • Description modified (diff)

comment:6 Changed 15 years ago by slyfox

  • Blocking 1864 added

(In #1864) Replying to yury_t:

It definitely seems now that these editor crashes are eliminated with the #1906 patch! (I told you it's the coloured syntax processing :)

Heh, true. One of compatibility paths to Syntax was handles incorrectly. Fresh mc users won't suffer from it, so it was hard to reproduce.

Thanks again!

Merged as changeset:4c8dbd8f3bf7456de818ef272e5ca2dce5c6a6ce (as #1906 bug)

comment:7 Changed 15 years ago by angel_il

  • Milestone changed from 4.7.1 to 4.7.0.1

comment:8 Changed 15 years ago by andrew_b

  • Blocking 1864 removed

comment:9 Changed 15 years ago by andrew_b

  • Status changed from testing to closed

comment:10 Changed 15 years ago by andrew_b

  • Votes for changeset changed from metux andrew_b to commited-master
Note: See TracTickets for help on using tickets.