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

Build GUI for non-Linux systems #17

Closed
wants to merge 3 commits into from

Conversation

blakharaz
Copy link
Contributor

Change the cmake files so that the GUI and print part of heaptrack can be built on a non-Linux system, e.g. on macOS. On non-Linux systems everything but heaptrack_print and heaptrack_gui is skipped, also the tests.
Add a short description for macOS using homebrew.

Copy link
Collaborator

@milianw milianw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great initiative, thanks for stepping up! some small nitpicks, otherwise lgtm

thanks!

3rdparty/CMakeLists.txt Outdated Show resolved Hide resolved
3rdparty/CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
src/analyze/CMakeLists.txt Outdated Show resolved Hide resolved
@blakharaz blakharaz force-pushed the gui_for_macos branch 2 times, most recently from 5b7d635 to 06b6f04 Compare December 26, 2018 21:12
@blakharaz
Copy link
Contributor Author

On top of your comments I made the change a bit larger and added more configuration flags in the latest pushed version. It's now possible to skip building the tests, only build the tracker, or only build the analyzer.

CMakeLists.txt Outdated Show resolved Hide resolved
src/analyze/CMakeLists.txt Outdated Show resolved Hide resolved
@milianw
Copy link
Collaborator

milianw commented Jan 9, 2019

Great, I want to merge this now. But KDE requires full names and valid email addresses associated with git commits. The commits here don't fulfill either of these rules. Can you please give me your full name and a valid mail address?

Thanks

* Allow building UI also on non-Linux systems
Disable track and interpret modules when not on Linux.

* Allow to disable building heaptrack_print
When cross-compiling, e.g. for an embedded target, no analyzer is needed for
that platform.

* Allow to disable building the tests
This uses homebrew to get the KDE dependencies on an easy way.
@blakharaz
Copy link
Contributor Author

I changed it in the commits and rebased it onto master.

README.md Outdated Show resolved Hide resolved
@milianw
Copy link
Collaborator

milianw commented Jan 15, 2019

Thanks, I squashed the fixup and commit it all now!

@milianw milianw closed this Jan 15, 2019
@blakharaz blakharaz deleted the gui_for_macos branch January 15, 2019 21:20
@YangZhou1997
Copy link

I tried to install heaptrack on macOS Mojave 10.14.4. Everything seems going well, but both
CMAKE_PREFIX_PATH=/usr/local/opt/qt PATH=$PATH:/usr/local/opt/gettext/bin cmake .. and
cmake -DCMAKE_BUILD_TYPE=Release .. show

-- The following OPTIONAL packages have not been found:

 * KF5KIO
 * KF5

That causes being unable to make heaptrack_gui since gui relies on the two packages.

Not sure how to solve it; any suggestions are highly appreciated!

@milianw
Copy link
Collaborator

milianw commented Jun 17, 2019

install the kde frameworks 5 packages from homebrew or similar (afaik, I'm not a mac person)

catskul pushed a commit to catskul/heaptrack that referenced this pull request Sep 29, 2020
Hopefully fixes issues such as this one:

heaptrack debug(2) [8859:8859]@5830 dlopen_notify_callback: /tmp/KDevelop-5.2.1-x86_64/usr/lib/libxcb-dri2.so.0 7fd27a93d000
heaptrack debug(1) [8885:8885]@5830 child_fork()
heaptrack debug(1) [8859:8859]@5831 write error 4/Interrupted system call
KDE#1  0x00007fd298297f1e sp=0x00007ffe33957bd0 _ZN12_GLOBAL__N_19HeapTrack10writeErrorEv + 0x4c
KDE#2  0x00007fd298297cff sp=0x00007ffe33957c00 _ZN12_GLOBAL__N_19HeapTrack24dl_iterate_phdr_callbackEP12dl_phdr_infomPv + 0x13c
KDE#3  0x00007fd29123fc81 sp=0x00007ffe33957c50 dl_iterate_phdr + 0x171
KDE#4  0x00007fd298297ec1 sp=0x00007ffe33957d00 _ZN12_GLOBAL__N_19HeapTrack17updateModuleCacheEv + 0xa5
KDE#5  0x00007fd298297ae0 sp=0x00007ffe33957d20 _ZN12_GLOBAL__N_19HeapTrack12handleMallocEPvmRK5Trace + 0x54
KDE#6  0x00007fd298298805 sp=0x00007ffe33957d60 heaptrack_malloc + 0xef
KDE#7  0x00007fd298295f9b sp=0x00007ffe33957fb0 malloc + 0x5f
KDE#8  0x00007fd291ab6089 sp=0x00007ffe33957fe0 _Znwm + 0x19
KDE#9  0x00007fd29205cd42 sp=0x00007ffe33957ff0 _ZN7QObjectC1EPS_ + 0x22
KDE#10 0x00007fd292023374 sp=0x00007ffe33958010 _ZN8QLibraryC2ERK7QStringP7QObject + 0x14
KDE#11 0x00007fd292ef53d0 sp=0x00007ffe33958030 _ZN13KPluginLoader4loadEv + 0x60
KDE#12 0x00007fd292ef54aa sp=0x00007ffe33958090 _ZN13KPluginLoader8instanceEv + 0xa
KDE#13 0x00007fd292ef54ec sp=0x00007ffe339580a0 _ZN13KPluginLoader7factoryEv + 0x1c
KDE#14 0x00007fd297d4eece sp=0x00007ffe33958140 _ZN8KDevelop16PluginController18loadPluginInternalERK7QString + 0x58e
KDE#15 0x00007fd297d50396 sp=0x00007ffe339582a0 _ZN8KDevelop16PluginController10initializeEv + 0x8d6
KDE#16 0x00007fd297d5ab85 sp=0x00007ffe339583f0 _ZN8KDevelop11CorePrivate10initializeENS_4Core5SetupERK7QString + 0xb95
KDE#17 0x00007fd297d5c03d sp=0x00007ffe33958490 _ZN8KDevelop4Core10initializeENS0_5SetupERK7QString + 0x5d
KDE#18 0x000000000040b472 sp=0x00007ffe339584c0 main + 0x5182
KDE#19 0x00007fd29112ff4a sp=0x00007ffe339587d0 __libc_start_main + 0xea
KDE#20 0x000000000040caed sp=0x00007ffe33958890 _start + 0x29
heaptrack debug(1) [8859:8859]@5858 shutdown()
heaptrack debug(1) [8859:8859]@5858 destroying LockedData
heaptrack debug(1) [8859:8859]@5858 done destroying LockedData
heaptrack debug(1) [8859:8859]@5885 shutdown() done

CCBUG: 393387
kdesysadmin pushed a commit that referenced this pull request Sep 4, 2023
Return when we get asked for invalid data which seems to happen
through the KDChart attributes model. Fixes assertions/crashes like:

```
#0  0x00007fdcfc88e83c in  () at /usr/lib/libc.so.6
#1  0x00007fdcfc83e668 in raise () at /usr/lib/libc.so.6
#2  0x00007fdcfc8264b8 in abort () at /usr/lib/libc.so.6
#3  0x00007fdcfd8a0098 in qt_assert(char const*, char const*, int) () at /usr/lib/libQt5Core.so.5
#4  0x00007fdcfd8a0157 in  () at /usr/lib/libQt5Core.so.5
#5  0x00005649da68cf3f in QVector<QBrush>::at(int) const (this=0x6070001170a0, i=-1) at /usr/include/qt/QtCore/qvector.h:449
#6  0x00005649da70272e in ChartModel::headerData(int, Qt::Orientation, int) const (this=0x607000117060, section=-1, orientation=Qt::Horizontal, role=175763350) at /home/milian/projects/src/heaptrack/src/analyze/gui/chartmodel.cpp:69
#7  0x00007fdcfda67f5e in QAbstractProxyModel::headerData(int, Qt::Orientation, int) const () at /usr/lib/libQt5Core.so.5
#8  0x00007fdcfda7ba54 in QSortFilterProxyModel::headerData(int, Qt::Orientation, int) const () at /usr/lib/libQt5Core.so.5
#9  0x00007fdcff9b6dbf in KChart::AttributesModel::headerData(int, Qt::Orientation, int) const () at /usr/lib/libKChart.so.2
#10 0x00007fdcff9af76a in  () at /usr/lib/libKChart.so.2
#11 0x00007fdcff9a7605 in KChart::AbstractDiagram::brush(int) const () at /usr/lib/libKChart.so.2
#12 0x00007fdcff9ac495 in KChart::AbstractDiagram::datasetBrushes() const () at /usr/lib/libKChart.so.2
#13 0x00007fdcff9ccd77 in  () at /usr/lib/libKChart.so.2
#14 0x00007fdcff9cda4b in KChart::Legend::buildLegend() () at /usr/lib/libKChart.so.2
#15 0x00007fdcff9ce4ba in KChart::Legend::setNeedRebuild() () at /usr/lib/libKChart.so.2
#16 0x00007fdcfdad17f3 in  () at /usr/lib/libQt5Core.so.5
#17 0x00007fdcff98c4f3 in KChart::DiagramObserver::diagramDataChanged(KChart::AbstractDiagram*) () at /usr/lib/libKChart.so.2
#18 0x00007fdcfdad17f3 in  () at /usr/lib/libQt5Core.so.5
#19 0x00007fdcfda59182 in QAbstractItemModel::modelReset(QAbstractItemModel::QPrivateSignal) () at /usr/lib/libQt5Core.so.5
#20 0x00007fdcfda8506d in  () at /usr/lib/libQt5Core.so.5
#21 0x00007fdcfdad17f3 in  () at /usr/lib/libQt5Core.so.5
#22 0x00007fdcfda59182 in QAbstractItemModel::modelReset(QAbstractItemModel::QPrivateSignal) () at /usr/lib/libQt5Core.so.5
#23 0x00005649da708068 in ChartModel::resetData(ChartData const&) (this=0x607000117060, data=...) at /home/milian/projects/src/heaptrack/src/analyze/gui/chartmodel.cpp:261
#24 0x00005649da569a5d in operator()(ChartData const&) const (__closure=0x604000258e20, data=...) at /home/milian/projects/src/heaptrack/src/analyze/gui/mainwindow.cpp:223
```

BUG: 473634
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants