Bug 458626 - Crash on loading qtbase library
Summary: Crash on loading qtbase library
Status: REPORTED
Alias: None
Product: rkward
Classification: Applications
Component: R Console (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: RKWard Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-02 06:55 UTC by Tomas Sieger
Modified: 2022-09-08 08:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Sieger 2022-09-02 06:55:01 UTC
SUMMARY
rkward crashes wih the following error
```
Error: package or namespace load failed for ‘qtbase’:
 .onLoad failed in loadNamespace() for 'qtbase', details:
  call: NULL
  error: C stack usage  45899398072748 is too close to the limit
Error: 
```
when loading the qtbase library

STEPS TO REPRODUCE
1. run `library(qtbase)` in the R console within rkward

OBSERVED RESULT
a window pops up saying "R engine has died"
Connection closed unexpectedly
Last error was: QLocalSocket: Remote closed

EXPECTED RESULT
qtbase library loaded ;-)

SOFTWARE/OS VERSIONS
Linux: fedora 36 workstation edition, 64b, gnome 42.4
Qt Version: 4.8.7

ADDITIONAL INFORMATION
---Problem description---

What - in detail - did you do directly before you encountered this problem?
I launched a fresh rkward session.

When you try to repeat the above, does the problem occur again (no, sometimes, always)?
100% replicable

If applicable: When doing the same thing in an R session outside of RKWard, do you see the same problem?
Loading qtbase works in native R session (text console) as well as e.g. when run from within rstudio.

Do you have any further information that might help us to track this problem down? In particular, if applicable, can you provide sample data and sample R code to reproduce this problem?
qtbase library: https://github.com/ggobi/qtbase
The installation can be tricky, I suggest building against qt4 using this code:
```
 if (!require('devtools')) install.packages('devtools')
 library(devtools)
 install_github('ggobi/qtbase@qt4')
```

RKWard is available in many different packagings, and sometimes problems are specific to one method of installation. How did you install RKWard (which file(s) did you download)?
I'm using rpm rkward-0.7.2-6.fc36.x86_64, but I encountered the same problem also when I built rkward from source some time ago.


---Error Message---
Message code: r_engine_has_died
Connection closed unexpectedly. Last error was: QLocalSocket: Remote closed
The R backend will be shut down immediately. This means, you can not use any more functions that rely on it. I.e. you can do hardly anything at all, not even save the workspace (but if you're lucky, R already did that). What you can do, however, is save any open command-files, the output, or copy data out of open data editors. Quit RKWard after that. Sorry!

---Session Info---
RKWard version: 0.7.2
KDE Frameworks version (runtime): 5.97.0
KDE Frameworks version (compile time): 5.90.0
Qt version (runtime): 5.15.5
Qt version (compile time): 5.15.2
Using QtWebKit for HTML rendering
Local config directory: /home/sieger/.config
RKWard storage directory: /home/sieger/.rkward/
Backend version (as known to the frontend): 4.1.3

Debug message file (this may contain relevant diagnostic output in case of trouble):
/tmp/rkward.frontend contains:
```
Assert 'false' failed at /builddir/build/BUILD/rkward-0.7.2/rkward/misc/rkstandardicons.cpp - function iconForWindow line 192
QObject::connect: No such signal KatePluginToolWindow::toolVisibleChanged(bool)
Shortcut for action  "output_refresh" "Reload" set with QAction::setShortcut()! Use KActionCollection::setDefaultShortcut(s) instead.
```
- backend not available or rk.sessionInfo() canceled -
Comment 1 Tomas Sieger 2022-09-06 12:56:49 UTC
The very same error demonstrates in 0.7.4 built from source with full debugs (see below for session info). Is there any way how to fix the problem?

---Session Info---
RKWard version: 0.7.4
KDE Frameworks version (runtime): 5.97.0
KDE Frameworks version (compile time): 5.97.0
Qt version (runtime): 5.15.5
Qt version (compile time): 5.15.5
Using QWebEngine for HTML rendering
Local config directory: /home/sieger/.config
RKWard storage directory: /home/sieger/.rkward/
Backend version (as known to the frontend): 4.1.3
Comment 2 Thomas Friedrichsmeier 2022-09-07 19:26:45 UTC
Sorry for not replying earlier. This is a known issue and very difficult to resolve. The rkward backend links against qt (Qt5, currently) itself, and this results in two distinct issues:

1) In your case, a different version of qt (Qt4) is needed by qtbase. Dynamically loading two versions of the same library (soname) is simply not supported in Linux at all (no definite knowledge on other OSes, here, but I suspect the same limitation to apply). Supporting this use case seems very difficult, indeed.

2) Even with a compatible version, we'll have some issues getting library initialization right (both qtbase, and the rkward backend trying to initialize the library). This might be something that can be fixed, with a reasonable effort. It has been some time since I took a more detailed look. Frankly, I stopped putting time into that, as qtbase never seemed to gain much traction.

Sorry, if I cannot give you a more satisfying answer, esp. regarding part 1). Do you really need qt4, specifically?

Finally, if you're looking into building controls, yourself, then of course, RKWard brings facilities for that. If you're missing something in that direction, perhaps we can discuss on rkward-devel@kde.org .
Comment 3 Tomas Sieger 2022-09-08 08:36:45 UTC
Thanks for the info. That's unfortunate.
(Yes, I'm currently stuck with qt4 as qtbase does not compile against qt5 (smokegen crashes).)