Hi,
Roland Stigge wrote:
> when starting hydrogen, selecting "File/New" and changing the pattern size
> (e.g., from "8" to "7"), hydrogen segfaults (but not always). This is pretty
> annoying in regular work since the problem also occurs later after some work.
> I
> could trace it to m_nSize and actual sizes being inconsistent between the
> PatternEditor and PatternEditorPanel classes. Missing deeper conceptual
> insight, I just fixed the segfault with a more consistent size handling in
> PatternEditor::drawPattern(), see attachment. This makes hydrogen work with
> odd
> pattern sizes easier. However, some inconsistencies remain since hydrogen
> sometimes doesn't remember sizes between patterns on pattern changes.
>
> I can't see the current approach how the data is maintained consistent between
> the classes...
Some more details: Looking at the data in GDB, I can see that
PatternEditor::drawPattern() is working with a Pattern instance
(m_pPattern) different from PatternEditorPanel::patternSizeChanged().
drawNote() just tries to access the "8th" note where only 7 are
available after the size change. The problem primarily occurs on size
changes of empty patterns. I'm attaching a backtrace of the segfault.
bye,
Roland
[EMAIL PROTECTED]:~/temp/debian/hydrogen-0.9.3$ gdb /usr/bin/hydrogen
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program: /usr/bin/hydrogen
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1229429056 (LWP 7418)]
Qt: gdb: -nograb added to command-line options.
Use the -dograb option to enforce grabbing.
[New Thread -1231557712 (LWP 7421)]
Warning: no locale found: /usr/share/hydrogen/data/i18n/hydrogen.en_GB.UTF-8
Warning: error loading locale:
/usr/share/hydrogen/data/i18n/hydrogen.en_GB.UTF-8.qm
Hydrogen 0.9.3 [Apr 1 2007] [http://www.hydrogen-music.org]
Copyright 2002-2005 Alessandro Cominu
Compiled modules: (FLAC) (Jack) (Alsa) (OSS) (LRDF)
Hydrogen comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details
Using data path: /usr/share/hydrogen/data
[WARNING] SongReader [readSong] Trying to load a song created with a
different version of hydrogen.
[WARNING] SongReader [readSong] Song
[/usr/share/hydrogen/data/DefaultSong.h2song] saved with version 0.9.2
[LadspaFX::getPluginList] reading directory: /usr/lib/ladspa
[LadspaFX::getPluginList] reading directory: /usr/lib/hydrogen/plugins
[LadspaFX::getLadspaFXGroup]
[LadspaFX::getPluginList] reading directory: /usr/lib/ladspa
[LadspaFX::getPluginList] reading directory: /usr/lib/hydrogen/plugins
[New Thread -1246483536 (LWP 7423)]
[New Thread -1254876240 (LWP 7424)]
[WARNING] JackDriver Jack server not running?
[ERROR] Hydrogen [createDriver] Error starting audio driver
[audioDriver::init()]
[WARNING] LocalFileMng [readXmlString] Using default value in name
[WARNING] LocalFileMng [readXmlString] Using default value in name
[WARNING] LocalFileMng [readXmlString] Using default value in name
[ERROR] AlsaAudioDriver Can't set realtime scheduling for ALSA Driver
[WARNING] SongReader [readSong] Trying to load a song created with a
different version of hydrogen.
[WARNING] SongReader [readSong] Song
[/usr/share/hydrogen/data/DefaultSong.h2song] saved with version 0.9.2
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1229429056 (LWP 7418)]
0x080f5b7b in PatternEditor::drawNote (this=0x84f13a0, note=0xa8, nSequence=31,
pixmap=0x84f1428) at src/gui/PatternEditor/PatternEditor.cpp:606
606 uint pos = note->m_nPosition;
(gdb) bt
#0 0x080f5b7b in PatternEditor::drawNote (this=0x84f13a0, note=0xa8,
nSequence=31, pixmap=0x84f1428) at src/gui/PatternEditor/PatternEditor.cpp:606
#1 0x080ff41a in PatternEditor::drawPattern (this=0x84f13a0, pixmap=0x84f1428)
at src/gui/PatternEditor/PatternEditor.cpp:906
#2 0x080ff83d in PatternEditor::paintEvent (this=0x84f13a0) at
src/gui/PatternEditor/PatternEditor.cpp:827
#3 0xb781bafe in QWidget::event () from /usr/lib/libqt-mt.so.3
#4 0xb777cc26 in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#5 0xb777f5d6 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#6 0xb7710421 in QApplication::sendEvent () from /usr/lib/libqt-mt.so.3
#7 0xb774943d in QWidget::repaint () from /usr/lib/libqt-mt.so.3
#8 0xb777dc36 in QApplication::sendPostedEvents () from /usr/lib/libqt-mt.so.3
#9 0xb777dd56 in QApplication::sendPostedEvents () from /usr/lib/libqt-mt.so.3
#10 0xb7723d6f in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#11 0xb7797179 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#12 0xb7796f9a in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#13 0xb777e7bf in QApplication::exec () from /usr/lib/libqt-mt.so.3
#14 0x081872a3 in main (argc=136073032, argv=0xbf937894) at src/gui/main.cpp:262
(gdb)