# Uncaught 'Genode::Ipc\_error'

**URL:** <https://genode.discourse.group/t/uncaught-genode-ipc-error/69>\
**Category:** Developer's Corner\
**Created:** [September 8, 2024, 3:57pm UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69 "2024-09-08T15:57:22Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://genode.discourse.group/u/hamed)\
**Post date:** [September 8, 2024, 3:57pm UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/1 "2024-09-08T15:57:22Z")

</div>

I’m working on a kiosk application (same falkon configuration), and I’m encountering the following warnings and errors:

```auto
[init -> kiosk] Warning: minherit: minherit not implemented
[init -> kiosk] Warning: getrlimit called for unsupported resource 7, returning 0
[init -> kiosk] Warning: socketpair: socketpair not implemented
[init -> kiosk] [1:285200560:0517/000105.324000:FATAL:platform_channel.cc(148)] : Function not implemented (78)
Warning: unresolvable exception 3, pd 'init -> kiosk', thread 'ep', cpu 0, ip=0x433324a sp=0x403fd630 bp=0x403fdb20 no signal handler
[init -> kiosk] Error: Uncaught exception of type 'Genode::Ipc_error'
[init -> kiosk] Warning: abort called - thread: main

```

I’m getting this error when using the QWebView widget.

Please help me out.

---

<div class="post-metadata">

**Author:** ![cproc](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cproc](https://genode.discourse.group/u/cproc)\
**Post date:** [September 8, 2024, 6:21pm UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/2 "2024-09-08T18:21:43Z")

</div>

I can reproduce the error in `platform_channel.cc` with `falkon.run` when I remove the `<arg value="--single-process"/>` line. Could it be missing in your run script?

---

<div class="post-metadata">

**Author:** ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://genode.discourse.group/u/hamed)\
**Post date:** [September 9, 2024, 7:48am UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/3 "2024-09-09T07:48:37Z")

</div>

Thanks, the issue was exactly as you pointed out. When building the program as a black box, there was no problem. However, when the program was built as a module, the input arguments were not properly set, which caused the issue. It’s been resolved now.

Another question: I’m repeatedly encountering the following error. What could be the cause?

```auto
Error: illegal READ at address 0x8c0 by pager_object: pd='init -> kiosk' thread='ep' ip=0xd1e23cd

```

---

<div class="post-metadata">

**Author:** ![ttcoder](https://dub1.discourse-cdn.com/flex006/user_avatar/genode.discourse.group/ttcoder/32/9_2.png) [@ttcoder](https://genode.discourse.group/u/ttcoder)\
**Post date:** [September 9, 2024, 5:56pm UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/4 "2024-09-09T17:56:30Z")

</div>

When I get that kind of segfault message and want to lookup the guilty code, my personnal favorite is to use addr2line, mentionned down [this Genodians article](https://genodians.org/nfeske/2021-02-11-pine-fun-debugging) (together with objdump ad backtrace()).

The article seems to focus on absolute addresses, but for many components one has to substract the base offset from the logged IP (instruction pointer, which here is `0xd1e23cd`) so as to get the relative address to be fed to addr2line.

I can’t find it right now, but I think there is another article that mentions that aspect.

Basically you have to make sure the config xml node of the crashing component says “ld\_verbose=true”, and then when it starts up it will display a list of base addresses.

Oh – now that I think of it, I seem to remember Genode 24.05 introduced a new utility in the tool/ subfolder, that allows to easily lookup that kind of segfault message !

Anyway, some day I’ll create a “pinned” thread which will list that kind of recurrent information inside a ‘FAQ’ post, so that it is all in one place and the FAQ becomes the one-stop-shop for Genode developers (and if some day I ever create a wiki as I’ve been meaning to for a while, I’ll base it off that pinned thread).

(and talking of “laundry list of things to do”, we could also have a pinned thread in #Genode and SculptOS listing packages in the Genode Depot, which would be a collaboratively maintained post… Oh and one about listing hardware compatibility, to help maintain the semi-official HCL… And… ok I’ll stop there – for now!)

---

<div class="post-metadata">

**Author:** ![jschlatow](https://dub1.discourse-cdn.com/flex006/user_avatar/genode.discourse.group/jschlatow/32/12_2.png) [@jschlatow](https://genode.discourse.group/u/jschlatow)\
**Post date:** [September 10, 2024, 6:18am UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/5 "2024-09-10T06:18:59Z")

</div>

> [@ttcoder](#):
>
> Oh – now that I think of it, I seem to remember Genode 24.05 introduced a new utility in the tool/ subfolder, that allows to easily lookup that kind of segfault message !

Indeed. This tool adds heaps of convenience. Moreover, the tool was recently [integrated into Goa](http://genodians.org/jschlatow/2024-07-31-goa-gdb).

---

<div class="post-metadata">

**Author:** ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://genode.discourse.group/u/hamed)\
**Post date:** [September 10, 2024, 6:34am UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/6 "2024-09-10T06:34:52Z")

</div>

The reality is that the application I’ve labeled as “kiosk” here consists merely of a simple line edit widget and a Qt5 WebView. I haven’t implemented any pointer-based memory operations that would raise concerns about such errors. The key point is this:

I integrated the kiosk code into the program in two different ways. The first method was as a black box (contrib), where no Genode-specific tools were used. In this case, the application works flawlessly. The second method involved incorporating the same code as a module within the program, utilizing Libc::Component::construct. In this case, I encounter resource issues. Initially, the program seems to hit a deadlock, and then I receive a memory error. After this error, the WebView module completely fails, yet the rest of the application continues to function normally.

In essence, I have a single XML configuration and an application with two structures: one works without any issues, while the other generates errors. It seems the process of porting QtWebEngine is causing the disruption.

---

<div class="post-metadata">

**Author:** ![chelmuth](https://dub1.discourse-cdn.com/flex006/user_avatar/genode.discourse.group/chelmuth/32/1_2.png) [@chelmuth](https://genode.discourse.group/u/chelmuth)\
**Post date:** [September 10, 2024, 6:45am UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/7 "2024-09-10T06:45:29Z")

</div>

> [@hamed](#):
>
> The second method involved incorporating the same code as a module within the program, utilizing Libc::Component::construct.

In this variant, I’d expect some precautions have to be taken (most importantly `QApplication::exec()` must be called to service Qt’s event loop). You may look into _libports/src/app/qt5/qt\_launchpad_ for inspiration.

---

<div class="post-metadata">

**Author:** ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://genode.discourse.group/u/hamed)\
**Post date:** [September 10, 2024, 7:24am UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/8 "2024-09-10T07:24:27Z")

</div>

> [@chelmuth](#):
>
> In this variant, I’d expect some precautions have to be taken (most importantly `QApplication::exec()` must be called to service Qt’s event loop). You may look into _libports/src/app/qt5/qt\_launchpad_ for inspiration.

That’s right, I’ve written several programs with Qt5 in Genode, and first of all, I have to say it’s amazing. Up until now, there have been no issues. The problem only appeared when I added the `WebView` to the program. (I couldn’t find a suitable space to share the files, so I’ll post the code here.)

**File: `main.cpp`**

```cpp
static inline QApplication & web_engine_initialization(Libc::Env &env) {
	qpa_init(env);

	const char *argv[] = { 
		"kiosk", 
		"--single-process", 
		"--enable-logging", 
		"--log-level=3", 
		"--v=0", 
		"--use-fake-device-for-media-stream", 
		0 
	};
	int argc = 7;

	static QApplication app(argc, (char**)argv);

	QFile file(":style.qss");
	if (!file.open(QFile::ReadOnly)) {
		qWarning() << "Warning:" << file.errorString()
			<< "opening file" << file.fileName();
	} else {
		qApp->setStyleSheet(QLatin1String(file.readAll()));
	}

	app.connect(&app, SIGNAL(lastWindowClosed()), SLOT(quit()));

	return app;
}

struct Main {
	Libc::Env &env;
	QApplication &app { web_engine_initialization(env) };
	QMember<Kiosk> kiosk { };

	Main(Libc::Env &env) : env(env) {
		kiosk->show();
	}
};

void Libc::Component::construct(Libc::Env &env) {
	Libc::with_libc([&] {
		static Main main { env };
		exit(main.app.exec());
	});
}

```

**File: `kiosk.h`**

```cpp
class Kiosk : public Compound_widget<QWidget, QVBoxLayout> {
	Q_OBJECT

private:
	QMember<QLineEdit> _urlInput;
	QMember<QPushButton> _reloadButton;
	QMember<QWebEngineView> _webView;
	QString _configUrl;

public:
	Kiosk();
	~Kiosk() {}

private slots:
	void loadUrl();
	void checkNetworkConnection(std::function<void()> callback);
};

```

**File: `kiosk.cpp`**

```cpp
Kiosk::Kiosk(): _reloadButton("Reload"), _configUrl("https://www.google.com") {
	_urlInput->setPlaceholderText("Enter URL...");
	_layout->addWidget(_urlInput);
	_layout->addWidget(_reloadButton);
	_layout->addWidget(_webView);
	
	connect(_reloadButton, &QPushButton::clicked, this, &Kiosk::loadUrl);

	loadUrl();
}

void Kiosk::loadUrl() {
	QString urlText = _urlInput->text().trimmed();
	if (!urlText.startsWith("http://") && !urlText.startsWith("https://")) {
		urlText = "https://" + urlText;
	}
	_configUrl = urlText;

	checkNetworkConnection([this]() {
		_webView->load(QUrl(_configUrl));
	});
}

void Kiosk::checkNetworkConnection(std::function<void()> callback) {
	QNetworkAccessManager *manager = new QNetworkAccessManager(this);
	QNetworkRequest request(QUrl("http://www.google.com"));
	QNetworkReply *reply = manager->get(request);

	connect(reply, &QNetworkReply::finished, this, [reply, callback]() {
		if (reply->error() == QNetworkReply::NoError) {
			callback();
		} else {
			QMessageBox::critical(nullptr, "Network Error", "No network connection.");
		}
		reply->deleteLater();
	});
}

```

I ran this code. Simply removing the line `_layout->addWidget(_webView);` causes no resource issues. However, with this line included, the entire system freezes. After the error occurs, the system exits the frozen state, but the Kiosk module becomes unusable.

---

<div class="post-metadata">

**Author:** ![ttcoder](https://dub1.discourse-cdn.com/flex006/user_avatar/genode.discourse.group/ttcoder/32/9_2.png) [@ttcoder](https://genode.discourse.group/u/ttcoder)\
**Post date:** [September 10, 2024, 7:54am UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/9 "2024-09-10T07:54:12Z")

</div>

> [@hamed](#):
>
> I ran this code. Simply removing the line `_layout->addWidget(_webView);` causes no resource issues. However, with this line included, the entire system freezes. After the error occurs, the system exits the frozen state, but the Kiosk module becomes unusable.

Talking of freezes, when I use Falkon I’ve noticed that if I open the Preferences window and start exploring options (esp. the “open printer panel” or some such, as I recall), at some point I lose mouse/keyboard interaction (i.e. the mouse pointer “freezes”, nothing moves). Until now I thought maybe it was `event_filter` running into a ram or cap resource request, but now I’m not so sure. I never felt an urgency to investigate as I don’t really need to tweak the Falkon preferences anyway. But I thought I’d mention this in case this helps resolve the above.

---

<div class="post-metadata">

**Author:** ![cproc](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cproc](https://genode.discourse.group/u/cproc)\
**Post date:** [September 10, 2024, 11:12pm UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/10 "2024-09-10T23:12:48Z")

</div>

I could not reproduce the freeze problem with the kiosk code so far, but had to add the `"--disable-gpu-compositing"` argument to see the web content instead of a black rectangle. Tried with x86\_64 base-linux and NOVA on Lenovo X260 with a run script based on `falkon.run`.

---

<div class="post-metadata">

**Author:** ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://genode.discourse.group/u/hamed)\
**Post date:** [September 11, 2024, 6:32am UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/11 "2024-09-11T06:32:38Z")

</div>

Thanks. After your response, I realized the issue might be due to using it alongside other modules. I ran the code in `tiled_wm`, but it didn’t work properly, whereas `Falkon` worked fine in the same setup.

Removing all modules improved the kiosk’s performance.

One more question:  
Have you tested `Falkon` with a Realtek network card, and were there any issues?

---

<div class="post-metadata">

**Author:** ![cproc](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cproc](https://genode.discourse.group/u/cproc)\
**Post date:** [September 11, 2024, 8:15pm UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/12 "2024-09-11T20:15:02Z")

</div>

> [@hamed](#):
>
> Have you tested `Falkon` with a Realtek network card, and were there any issues?

I tested `falkon.run` on a PC with a Realtek RTL8111H onboard NIC now and had to increase the RAM quota of `nic_drv` and there was initially the problem that the `XID` of the NIC was not detected correctly, but after I started Linux on the PC to compare the driver messages this problem did not occur with Genode anymore.

I also tried the kiosk application on this PC and noticed that it ran slower than Falkon. When I removed the `<env key="QT_QUICK_BACKEND" value="software"/>` line from the Falkon run script, Falkon became slow as well and an `EXEC violation` error occurred after a while, similar to the symptom you described for the kiosk application. Without this environment variable, QtQuick used an OpenGL backend without GPU acceleration, which caused the slowness. So you might need to set up this environment variable for the kiosk application as well, like the `qt5_component` library does it when `main()` is used instead of `Libc::Component::construct()`.

---

<div class="post-metadata">

**Author:** ![cproc](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@cproc](https://genode.discourse.group/u/cproc)\
**Post date:** [September 11, 2024, 9:01pm UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/13 "2024-09-11T21:01:43Z")

</div>

Alternatively, adding the following in `web_engine_initialization()` works as well:

`QQuickWindow::setSceneGraphBackend("software");`

---

<div class="post-metadata">

**Author:** ![hamed](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hamed](https://genode.discourse.group/u/hamed)\
**Post date:** [September 13, 2024, 10:15am UTC](https://genode.discourse.group/t/uncaught-genode-ipc-error/69/15 "2024-09-13T10:15:10Z")

</div>

Thank you for the explanation; that was exactly the issue, and I wasn’t aware of it. By adding the function `qputenv("QT_QUICK_BACKEND", "software");` to the program, the performance problem was completely resolved. I appreciate your help.

It seems there’s another issue with the RTL8111H network card. If I find it, I’ll share it here.
