Uncaught 'Genode::Ipc_error'

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

[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.

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?

1 Like

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?

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

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 (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!)

1 Like

Indeed. This tool adds heaps of convenience. Moreover, the tool was recently integrated into Goa.

1 Like

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.

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

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

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

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.

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.

1 Like

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.

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?

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().

1 Like

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

QQuickWindow::setSceneGraphBackend("software");

1 Like

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.

1 Like