Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#5168 closed defect (fixed)

Special mac menu handling is broken after saving preferences

Reported by: knauslists@… Owned by: lasgouttes
Priority: high Milestone: 1.6.0
Component: general Version: 1.6.0svn
Severity: critical Keywords: regression crash patch
Cc: bewihelm@…, younes@…, eric.cavalcanti@…, hofbauer@…

Description

When Lyx 1.6 is started and you customize the appearance settings via the "Preferences..." dialogue and
then click on the "Apply" button or the "Save" button, a new item appears in the OSX menu bar labelled
"special" with the menu items "Preferences", "About Lyx" (both greyed out) and "Quit Lyx". In the normal
"Lyx" menu "Reconfigure" now appears two times and "Preferences..." isn't responsive any more. The only
solution is to quit and restart Lyx via the "special" menu. Changes of preferences are lost then if you
clicked "Apply" only.
This also occurs on the new version rc1 released on the ftp.devel...server.

Attachments (3)

global_menubar_resetGui.patch (608 bytes ) - added by younes 16 years ago.
reset the global menubar
macmenu.patch (4.3 KB ) - added by sts@… 16 years ago.
Fix for duplicated special mac menu items
macmenu.2.patch (4.3 KB ) - added by sts@… 16 years ago.
Fix for duplicated special mac menu items

Download all attachments as: .zip

Change History (23)

comment:1 by lasgouttes, 16 years ago

Cc: younes@… added
Summary: Interface problems with 1.6b4 and 1.6rc1Special mac menu handling is broken after saving preferences

Abdel, could you please have a look? I think it is related to the reloading of
everything after prefs change (and maybe menu changes).

comment:2 by Uwe Stöhr, 16 years ago

Keywords: regression added
Milestone: 1.6.0

comment:3 by bewihelm@…, 16 years ago

I can reproduce this. It sometimes leads to a crash with normal editing, but always leads to a crash
when you try quitting from the LyX menu (or with <cmd>Q). Here's the backtrace:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000062
lyx::to_utf8 (ucs4=@0x14d4ab8) at docstring.cpp:106
106 vector<char> const utf8 = ucs4_to_utf8(ucs4.data(), ucs4.size());
(gdb) bt
#0 lyx::to_utf8 (ucs4=@0x14d4ab8) at docstring.cpp:106
#1 0x0012c4d0 in lyx::LyXFunc::dispatch (this=0x142d0b0, cmd=@0x14d4ab4) at LyXFunc.cpp:713
#2 0x0010e46e in lyx::dispatch (action=@0x14d4ab8) at LyX.cpp:1132
#3 0x0035c634 in lyx::frontend::Action::qt_metacall (this=0xf25f390,
_c=QMetaObject::InvokeMetaMethod, _id=-1, _a=0xbfffe278) at Action.cpp:69
#4 0x00b8012d in QMetaObject::activate () at LyX.cpp:1250
#5 0x005b03bc in QAction::triggered () at LyX.cpp:1250
#6 0x005b21cf in QAction::activate () at LyX.cpp:1250
#7 0x0096e739 in qt_mac_activate_action () at LyX.cpp:1250
#8 0x0096ed15 in qt_mac_menu_event () at LyX.cpp:1250
#9 0x90946763 in DispatchEventToHandlers ()
#10 0x90945b9d in SendEventToEventTargetInternal ()
#11 0x909624ee in SendEventToEventTarget ()
#12 0x90996bc1 in SendHICommandEvent ()
#13 0x909bd3d3 in SendMenuCommandWithContextAndModifiers ()
#14 0x909bd390 in SendMenuItemSelectedEvent ()
#15 0x90a4131f in HIMenuBar::HandleKeyboardEvent ()
#16 0x90946c71 in HIObject::EventHook ()
#17 0x90946763 in DispatchEventToHandlers ()
#18 0x90945b9d in SendEventToEventTargetInternal ()
#19 0x90945a02 in SendEventToEventTargetWithOptions ()
#20 0x90974def in ToolboxEventDispatcherHandler ()
#21 0x90946b1c in DispatchEventToHandlers ()
#22 0x90945b9d in SendEventToEventTargetInternal ()
#23 0x909624ee in SendEventToEventTarget ()
#24 0x00600881 in qt_mac_send_event () at LyX.cpp:1250
#25 0x0060cdb2 in QEventDispatcherMac::processEvents () at LyX.cpp:1250
#26 0x00b6e221 in QEventLoop::processEvents () at LyX.cpp:1250
#27 0x00b6e34a in QEventLoop::exec () at LyX.cpp:1250
#28 0x00b71041 in QCoreApplication::exec () at LyX.cpp:1250
#29 0x00119479 in lyx::LyX::exec (this=0xbffff258, argc=@0xbffff280, argv=0xbffff2a0) at
LyX.cpp:343
#30 0x00002989 in main (argc=1, argv=0xbffff2a0) at main.cpp:46

comment:4 by bewihelm@…, 16 years ago

Cc: bewihelm@… added

comment:5 by younes, 16 years ago

I committed a fix in r26266. Please test and close the bug if that fixes it.

comment:6 by bewihelm@…, 16 years ago

The fix doesn't work; here's the new backtrace:

E2BIG There is not sufficient room at *outbuf.
LyXAction.cpp(3083): action: 6553705 is not known.
lassert.cpp(21): ASSERTION false VIOLATED IN LyXAction.cpp:3084
Assertion triggered in void lyx::doAssert(const char*, const char*, long int) by failing check "false" in
file lassert.cpp:23

Program received signal SIGABRT, Aborted.
0x936f5b9e in kill ()
(gdb) bt
#0 0x936f5b9e in
kill ()
#1 0x936f5b91 in kill$UNIX2003 ()
#2 0x9376cec2 in raise ()
#3 0x9377c47f in abort ()
#4 0x0010ee2a in lyx::lyx_exit (exit_code=1) at LyX.cpp:200
#5 0x00572f4a in lyx::doAssert (expr=0x936f5b9e "s\016?", file=0x936f5b9e "s\016?", line=-
1821418594) at lassert.cpp:23
#6 0x00124aad in lyx::LyXAction::funcHasFlag (this=0xf122bc, action=6553705,
flag=lyx::LyXAction::Noop) at LyXAction.cpp:3084
#7 0x00128eec in lyx::LyXFunc::getStatus (this=0x142d060, cmd=@0xf113dc) at LyXFunc.cpp:421
#8 0x0012c6ef in lyx::LyXFunc::dispatch (this=0x142d060, cmd=@0x14d4c54) at LyXFunc.cpp:727
#9 0x0010e58e in lyx::dispatch (action=@0x0) at LyX.cpp:1132
#10 0x0035c664 in lyx::frontend::Action::qt_metacall (this=0x15b5e920,
_c=QMetaObject::InvokeMetaMethod, _id=-1, _a=0xbfffe268) at Action.cpp:69
#11 0x00b8017d in QMetaObject::activate () at LyX.cpp:1250
#12 0x005b040c in QAction::triggered () at LyX.cpp:1250
#13 0x005b221f in QAction::activate () at LyX.cpp:1250
#14 0x0096e789 in qt_mac_activate_action () at LyX.cpp:1250
#15 0x0096ed65 in qt_mac_menu_event () at LyX.cpp:1250
#16 0x90946763 in DispatchEventToHandlers ()
#17 0x90945b9d in SendEventToEventTargetInternal ()
#18 0x909624ee in SendEventToEventTarget ()
#19 0x90996bc1 in SendHICommandEvent ()
#20 0x909bd3d3 in SendMenuCommandWithContextAndModifiers ()
#21 0x909bd390 in SendMenuItemSelectedEvent ()
#22 0x90a4131f in HIMenuBar::HandleKeyboardEvent ()
#23 0x90946c71 in HIObject::EventHook ()
#24 0x90946763 in DispatchEventToHandlers ()
#25 0x90945b9d in SendEventToEventTargetInternal ()
#26 0x90945a02 in SendEventToEventTargetWithOptions ()
#27 0x90974def in ToolboxEventDispatcherHandler ()
#28 0x90946b1c in DispatchEventToHandlers ()
#29 0x90945b9d in SendEventToEventTargetInternal ()
#30 0x909624ee in SendEventToEventTarget ()
#31 0x006008d1 in qt_mac_send_event () at LyX.cpp:1250
#32 0x0060ce02 in QEventDispatcherMac::processEvents () at LyX.cpp:1250
#33 0x00b6e271 in QEventLoop::processEvents () at LyX.cpp:1250
#34 0x00b6e39a in QEventLoop::exec () at LyX.cpp:1250
#35 0x00b71091 in QCoreApplication::exec () at LyX.cpp:1250
#36 0x00119599 in lyx::LyX::exec (this=0xbffff248, argc=@0xbffff270, argv=0xbffff288) at
LyX.cpp:343
#37 0x00002aa9 in main (argc=1, argv=0xbffff288) at main.cpp:46

by younes, 16 years ago

reset the global menubar

comment:7 by Uwe Stöhr, 16 years ago

Keywords: crash added
Severity: normalcritical

comment:8 by younes, 16 years ago

What's up with this bug on latest svn?

comment:9 by bewihelm@…, 16 years ago

No change. The backtrace of the resulting crash is identical to that of comment #2.

(I somehow missed comment #5 and so didn't test the patch. Should I, or is that already in?)

comment:10 by younes, 16 years ago

Subject: Re: Special mac menu handling is broken after saving preferences

-------> No change. The backtrace of the resulting crash is identical

to that

of comment #2.

What about the special menu, still broken?

(I somehow missed comment #5 and so didn't test the patch. Should I,
or is that already in?)

No, that's already in.

I'll have a closer look later this week.

comment:11 by bewihelm@…, 16 years ago

Still broken. ("No change" was intended to apply to the entire report.)

comment:12 by anek@…, 16 years ago

Still present in lyx1.6-rc3.

comment:13 by hofbauer@…, 16 years ago

Cc: hofbauer@… added

comment:14 by lasgouttes, 16 years ago

Cc: eric.cavalcanti@… added

comment:15 by lasgouttes, 16 years ago

* #5391 has been marked as a duplicate of this bug. *

comment:16 by stephan.witt@…, 16 years ago

SVN revision 27006:

Console output when saving modified preferences:
/Users/stephan/cvs/lyx/lyx-devel/src/LyXRC.cpp(366): Reading istream...

Backtrace on exit:
(gdb) bt
#0 0x958a88e6 in std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>

::size ()

#1 0x004f5d27 in lyx::to_utf8 (ucs4=@0x1fc6fc8) at /Users/stephan/cvs/lyx/lyx-
devel/src/support/docstring.cpp:106
#2 0x00124b09 in lyx::LyXFunc::dispatch (this=0x1f23fd0, cmd=@0x1fc6fc4) at
/Users/stephan/cvs/lyx/lyx-devel/src/LyXFunc.cpp:730
#3 0x0010cdb5 in lyx::dispatch (action=@0x1fc6fc4) at /Users/stephan/cvs/lyx/lyx-
devel/src/LyX.cpp:1128
#4 0x0030df8f in lyx::frontend::Action::action (this=0xf03b140) at /Users/stephan/cvs/lyx/lyx-
devel/src/frontends/qt4/Action.cpp:69
#5 0x0030e01b in lyx::frontend::Action::qt_metacall (this=0xf03b140,
_c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfffe7e8) at Action_moc.cpp:70
#6 0x011fc420 in QMetaObject::activate ()
#7 0x01335c0c in QAction::triggered ()
#8 0x0133778f in QAction::activate ()
#9 0x017baae9 in qt_mac_activate_action ()
#10 0x017bb0f9 in qt_mac_menu_event ()
#11 0x958d2303 in DispatchEventToHandlers ()
#12 0x958d173d in SendEventToEventTargetInternal ()
#13 0x958ee092 in SendEventToEventTarget ()
#14 0x9592231d in SendHICommandEvent ()
#15 0x95948b6f in SendMenuCommandWithContextAndModifiers ()
#16 0x95948b2c in SendMenuItemSelectedEvent ()
#17 0x959cccd7 in HIMenuBar::HandleKeyboardEvent ()
#18 0x958d2811 in HIObject::EventHook ()
#19 0x958d2303 in DispatchEventToHandlers ()
#20 0x958d173d in SendEventToEventTargetInternal ()
#21 0x958d15a2 in SendEventToEventTargetWithOptions ()
#22 0x959004c7 in ToolboxEventDispatcherHandler ()
#23 0x958d26bc in DispatchEventToHandlers ()
#24 0x958d173d in SendEventToEventTargetInternal ()
#25 0x958ee092 in SendEventToEventTarget ()
#26 0x01390521 in qt_mac_send_event ()
#27 0x0139eb62 in QEventDispatcherMac::processEvents ()
#28 0x011ea2c1 in QEventLoop::processEvents ()
#29 0x011ea38d in QEventLoop::exec ()
#30 0x011ee331 in QCoreApplication::exec ()
#31 0x00320df7 in lyx::frontend::GuiApplication::exec (this=0x1f24590) at
/Users/stephan/cvs/lyx/lyx-devel/src/frontends/qt4/GuiApplication.cpp:1044
#32 0x00113d9f in lyx::LyX::exec (this=0xbffff7f8, argc=@0xbffff810, argv=0xbffff830) at
/Users/stephan/cvs/lyx/lyx-devel/src/LyX.cpp:343
#33 0x0013fbbc in main (argc=2, argv=0xbffff830) at /Users/stephan/cvs/lyx/lyx-
devel/src/main.cpp:46

The contents of argument action->action is not constant for various trials.
It was lyx::LFUN_FONT_TYPEWRITER or lyx::LFUN_LINE_DELETE for example.

(gdb) up
#3 0x0010cdb5 in lyx::dispatch (action=@0x1fc6fc4) at /Users/stephan/cvs/lyx/lyx-
devel/src/LyX.cpp:1128
1128 singleton_->pimpl_->lyxfunc_.dispatch(action);
(gdb) print action->argument_
$1 = {

static npos = 4294967295,
_M_dataplus = {

<std::allocator<lyx::char_type>> = {

<gnu_cxx::new_allocator<lyx::char_type>> = {<No data fields>}, <No data fields>},

members of std::basic_string<lyx::char_type,std::char_traits<wchar_t>,std::allocator<lyx::char_type>

::_Alloc_hider:

_M_p = 0x20

}

}

Another trial... crash and up:

Program received signal: “EXC_BAD_ACCESS”.
(gdb) up
#3 0x0010cdb5 in lyx::dispatch (action=@0x1fc8054) at /Users/stephan/cvs/lyx/lyx-
devel/src/LyX.cpp:1128
1128 singleton_->pimpl_->lyxfunc_.dispatch(action);
(gdb) print action->argument_
$1 = {

static npos = 4294967295,
_M_dataplus = {

<std::allocator<lyx::char_type>> = {

<gnu_cxx::new_allocator<lyx::char_type>> = {<No data fields>}, <No data fields>},

members of std::basic_string<lyx::char_type,std::char_traits<wchar_t>,std::allocator<lyx::char_type>

::_Alloc_hider:

_M_p = 0x29

}

}
(gdb) print action->action
$2 = lyx::LFUN_MATH_EXTERN
(gdb)

by sts@…, 16 years ago

Attachment: macmenu.patch added

Fix for duplicated special mac menu items

by sts@…, 16 years ago

Attachment: macmenu.2.patch added

Fix for duplicated special mac menu items

comment:17 by sts@…, 16 years ago

attachments.isobsolete: 01

comment:18 by sts@…, 16 years ago

Keywords: patch added

comment:19 by sts@…, 16 years ago

Keywords: fixedintrunk added
Resolution: fixed
Status: newclosed

comment:20 by ps@…, 15 years ago

Keywords: fixedintrunk removed
Note: See TracTickets for help on using tickets.