Problem using CsWebKit...segment fault

Report any problems with CopperSpice
Post Reply
FullAlquimista
Posts: 12
Joined: Sun Jan 10 2021 11:24 pm

Problem using CsWebKit...segment fault

Post by FullAlquimista »

Hi all,

I am trying to use the WebKit library to open a page from a Keyence camera's web server, but the program crashes with a segmentation fault. To debug the issue, I created a simple program with a QMainWindow and a QWebView as the central widget, intended to open a single page: "http://www.google.com.br".

When I run the program, it does display the page, but there is an issue: any text input only shows the first letter of what is typed. If I click "Search," the page updates to display the results, but when I try to input new text for another search, the same problem occurs—only the first letter is displayed. Eventually, the program crashes with the following error:

ASSERT failure in int QFontMetrics::width(const QString&, int, int) const
"stringToCMap should not fail twice", file D:/cs5/src/gui/text/qfontmetrics.cpp, line 314
terminate called after throwing an instance of 'std::system_error'
what(): Operation not permitted

I am using CopperSpice 1.9.2 PreBuild binaries from you guys and using MinGW64 13.1.0 from CLion.

Thks in advance.
barbara
Posts: 485
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Problem using CsWebKit...segment fault

Post by barbara »

I am using CopperSpice 1.9.2 PreBuild binaries from you guys and using MinGW64 13.1.0 from CLion.
We can not guarantee this is the issue you are experiencing, however different builds of MinGW may not be binary compatible and there is almost no way to test for ABI. There are two choices.

(1) Build your application with our pre-built MinGW distribution.
(2) Build CS with the same version of MinGW as you are using for your application.

You can find our MinGW binary files here: https://github.com/copperspice/cs_mingw_w64

Barbara
FullAlquimista
Posts: 12
Joined: Sun Jan 10 2021 11:24 pm

Re: Problem using CsWebKit...segment fault

Post by FullAlquimista »

barbara wrote: Sat Jan 18 2025 3:40 am
I am using CopperSpice 1.9.2 PreBuild binaries from you guys and using MinGW64 13.1.0 from CLion.
We can not guarantee this is the issue you are experiencing, however different builds of MinGW may not be binary compatible and there is almost no way to test for ABI. There are two choices.

(1) Build your application with our pre-built MinGW distribution.
(2) Build CS with the same version of MinGW as you are using for your application.

You can find our MinGW binary files here: https://github.com/copperspice/cs_mingw_w64

Barbara
I have build all the libraries including the CopperSpice 1.9.2 and my project with the Cs-Mingw64 14.2.0. And down below, is the test code that I use. Using the keyboard only the first letter get inputed on the search bar, but if I use the virtual keyboard of the google site, I can input more letters. But the error as described before keeps happening.
In the exemple in the copperspice site, go to forum and try to enter more than 3 letters on the search bar. It will crash with this assertion:

ASSERT failure in int QFontMetrics::width(const QString&, int, int) const
"stringToCMap should not fail twice", file ../src/gui/text/qfontmetrics.cpp, line 314
terminate called after throwing an instance of 'std::system_error'
what(): Operation not permitted


#include <QtCore>
#include <QtGui>
#include <QWebView>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow mainWindow;

QWebView *view = new QWebView(&mainWindow);
mainWindow.setCentralWidget(view);
view->load(QUrl("http://www.copperspice.com"));

mainWindow.show();

int res = a.exec();
return res;
}
barbara
Posts: 485
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Problem using CsWebKit...segment fault

Post by barbara »

So now you are using the same MinGW to build CS and your application and you are seeing a problem. We will take a look and see if we can reproduce this issue.

Thanks for reporting.

Barbara
Post Reply