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

Command-line render segfaults if ~/.lmmsrc.xml cannot be written #2245

Closed
Wallacoloo opened this issue Aug 9, 2015 · 4 comments
Closed

Command-line render segfaults if ~/.lmmsrc.xml cannot be written #2245

Wallacoloo opened this issue Aug 9, 2015 · 4 comments
Assignees
Labels

Comments

@Wallacoloo
Copy link
Member

This seems like a pretty obscure bug, but it comes down to ConfigManager trying to show a QMessageBox when the gui doesn't exist. All you have to do is chown root ~/.lmmsrc.xml and then launch lmms -r path/to/file.mmpz and you'll segfault.

Backtrace:

#0  0x00007ffff42f0267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1  0x00007ffff42f1eca in __GI_abort () at abort.c:89
#2  0x00007ffff67faa8a in qt_message_output(QtMsgType, char const*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007ffff67fadf9 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007ffff67fb6e1 in qFatal(char const*, ...) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x00007ffff70deb24 in QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#6  0x00007ffff70def94 in QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags<Qt::WindowType>) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#7  0x00007ffff7562532 in QDialog::QDialog(QDialogPrivate&, QWidget*, QFlags<Qt::WindowType>) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#8  0x00007ffff758374c in QMessageBox::QMessageBox(QMessageBox::Icon, QString const&, QString const&, QFlags<QMessageBox::StandardButton>, QWidget*, QFlags<Qt::WindowType>) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#9  0x00007ffff75839e6 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#10 0x00007ffff7583c6f in QMessageBox::critical(QWidget*, QString const&, QString const&, QFlags<QMessageBox::StandardButton>, QMessageBox::StandardButton) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#11 0x00000000004e9fc5 in ConfigManager::saveConfigFile (this=0x7fffea1ce020) at /home/colin/src/lmms/src/core/ConfigManager.cpp:517
#12 0x00000000004e7935 in ConfigManager::addRecentlyOpenedProject (this=0x7fffea1ce020, _file=...) at /home/colin/src/lmms/src/core/ConfigManager.cpp:229
#13 0x00000000005476c8 in Song::loadProject (this=0x97c950, fileName=...) at /home/colin/src/lmms/src/core/Song.cpp:1049
#14 0x00000000004d5854 in main (argc=5, argv=0x7fffffffe0f8) at /home/colin/src/lmms/src/core/main.cpp:515

I'm going to assign this to myself & fix it in the coming days.

@Wallacoloo Wallacoloo added the bug label Aug 9, 2015
@Wallacoloo Wallacoloo self-assigned this Aug 9, 2015
@Wallacoloo
Copy link
Member Author

For what it's worth, rendering is still functional when using the gui, if ~/.lmmsrc.xml is unwritable.

@tresf
Copy link
Member

tresf commented Aug 22, 2015

@Wallacoloo,

We should probably disable config writing when there's no GUI.

However, I've tested your theory about the QMessageBox with the following change and I still receive a segfault so I believe we have a few segfaults related to command line rendering on master. 👍

QString err = MainWindow::tr( "Could not save configuration file %1. "
                    "You're probably not permitted to "
                    "write to this file.\n"
                    "Please make sure you have write-"
                    "access to the file and try again." ).
                            arg( m_lmmsRcFile  );
        if ( gui )
        {       
            QMessageBox::critical( NULL,
                MainWindow::tr( "Could not save config-file" ),
                err );
        }
        return;

@tresf
Copy link
Member

tresf commented Aug 23, 2015

Related: #588

@zonkmachine
Copy link
Member

zonkmachine commented Feb 7, 2017

It's trying to write ./lmmsrc.xml twice. First when opening the project it's calling ConfigManager::addRecentlyOpenedProject() and on closing ConfigManager::~ConfigManager() calls saveConfigFile() again.

- Maybe not add projects rendered from the command line to recently opened projects. if( gui ) ...

  • Check If( gui ) and maybe printf a line but don't exit. The render works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants