[Not Solved - Not worth chasing. Simply using shared libs and moving on: Repeatable wxWidgets 3.1.3 issue...

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
dcbdbis
Knows some wx things
Knows some wx things
Posts: 42
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

[Not Solved - Not worth chasing. Simply using shared libs and moving on: Repeatable wxWidgets 3.1.3 issue...

Post by dcbdbis » Wed Oct 30, 2019 8:47 pm

This is a followup to this post: viewtopic.php?f=19&t=46493

I've done some experimentation. I rebuilt wxWidgets with

Code: Select all

../configure --disable-shared --with-gtk=3
. Then I rebuilt my target app. The same issue comes back - "Floating Point Error" and a crash of my app.

I then uninstalled and rebuilt wxWidgets with:

Code: Select all

../configure --with-gtk=3
. Then once again I rebuilt my target app. The issue is resolved and the app runs flawlessly.

I will work with whomever to help wxWidgets find and squash this issue. And I am not 110% convinced it is wxWidgets - still. Just becuase I can change things by changing the build of wxWidgets is certainly indicative....But with all things digital - NOT definitive proof. Look at the screenshot I attached to the referenced post (reattached here for convenience). There is a wxWidgets 3.0 component that is causing the floating point error. And I do NOT have any idea where it is coming from. I've been through my CB settings dozens of times to ensure correctness and found no issues.

Frankly - I am out of ideas where to look for this issue.

I have NOT rebuilt CB 17.12 against wx 3.1.3. It is "stock" as it comes.

I would prefer static libraries - so I can statically link them in and not have to worry about a target machine having wxWidgets 3.1.3 installed.


Sincerely and respectfully,

Dave
Attachments
CodeBlocksError.png
CodeBlocksError.png (32.28 KiB) Viewed 417 times
Last edited by dcbdbis on Wed Oct 30, 2019 10:51 pm, edited 2 times in total.

User avatar
doublemax
Moderator
Moderator
Posts: 14509
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Repeatable wxWidgets 3.1.3 issue...

Post by doublemax » Wed Oct 30, 2019 10:23 pm

If you want to prove that this is wxWidgets fault and want someone to fix it, you'll need to create a sample that reproduces the issue. Ideally with one of the samples that come with wxWidgets.

Referring to the previous post: Does the compiled binary also crash on the same machine where you built it?
I would prefer static libraries - so I can statically link them in and not have to worry about a target machine having wxWidgets 3.1.3 installed.
This may work under Windows, under Linux it's not that simple. There dynamic linking is highly recommended. That's because you can't link everything into the binary, there are still parts that are linked dynamically. And if these parts don't match the machine where the project was built, you get problems.That could be the issue here. But as i'm not a Linux expert, i can't tell you how to tackle this.
Use the source, Luke!

dcbdbis
Knows some wx things
Knows some wx things
Posts: 42
Joined: Sun Nov 24, 2013 9:49 pm
Location: Aurora, Colorado

Re: Repeatable wxWidgets 3.1.3 issue...

Post by dcbdbis » Wed Oct 30, 2019 10:50 pm

Hello @doublemax,

I am not interested in assigning blame to anyone. I was simply offering to help track it down in case someone thought it may be wxWidgets related.

I've posted to the CB forums to ask if I needed to build CB against 3.1.3 - no response in the last 48 hours.

I did a text search through each of the wxWidgets source files using grep - and found no reference to the 3.0 lib causing me the issue. I was thinking that maybe there was an old reference that remained with the "--disable-shared" configure flag. I've searched through the code and the configure scripts, and can assure you that this is not the case.

I agree - static linking is dicey under Linux. But when you use the wx-config --libs flag in the compiler settings, the wxWidgets libs are linked in automatically - mixed in with any shared libraries one may have specified (SQLite) for example. It's just one less level of complexity to an installer that the dev doesn't have to worry about - dependencies.

As it is - The app works well with the shared library build, and my text search found no old reference in any of the configure scripts nor the source code itself. I am now comfortable that this is NOT a wxWidgets issue.

So - I will use the shared libs, copy the libs to the target machine's installation directory - and generate a small shell script that sets a temporary local LD_LIBRARY_PATH to point to the 3.1.3 libraries inside of the target machine's install directory - instead of having them linked into the app. I don't want to install them into the target system for fear of causing other issues. I am OK with this approach. I just didn't want to do it. I'm over hours in this contract and was looking at a way to reduce the hours needed for delivery.

Contractually, I can't provide the target app to reproduce the error...so I think we are going to have to write this one off as a system quirk on this particular sys.

It's esoteric to say the least. And unless someone responds with an "AHA!" post - I don't feel it is worth taking up everyone's time chasing it. It's just too obscure - and Google/DuckDuckGo/Bing - come up with nothing anywhere close to my particular issue. So it's very obscure to say the least.


Sincerely and respectfully,


Dave

User avatar
doublemax
Moderator
Moderator
Posts: 14509
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: [Not Solved - Not worth chasing. Simply using shared libs and moving on: Repeatable wxWidgets 3.1.3 issue...

Post by doublemax » Wed Oct 30, 2019 10:56 pm

I've posted to the CB forums to ask if I needed to build CB against 3.1.3 - no response in the last 48 hours.
That's shouldn't make any difference. No part of CB will end up in the compiled executable. The only thing that matters is the command lines CB uses to build the project.

Looking at the screenshot again: Does it crash before wxApp::OnInit gets called? In that case you should check your code for any global wxString instances. Because these would be constructed before wxWidgets itself is initialized. I don't know why this should work when linking dynamically and not when linking statically, but it's a known issue.
Use the source, Luke!

DavidHart
Site Admin
Site Admin
Posts: 3925
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: [Not Solved - Not worth chasing. Simply using shared libs and moving on: Repeatable wxWidgets 3.1.3 issue...

Post by DavidHart » Thu Oct 31, 2019 10:35 am

Hi,
The same issue comes back - "Floating Point Error" and a crash of my app.
In the screenshot backtrace, frame 3 is a call to /usr/lib/libwx_base*, an installed wx lib. If that was from your disable-shared version, it was linking wrongly. (IIRC, and it was something I read years ago, if the ?linker/?runtime loader has a choice between using shared and static libs, it will go for the former.)

ldd /path/to/disableshared/app | grep libwx
might be informative. I just built a disable-shared wx3.0.4; ldd on its 'text' sample showed no libwx*.
I agree - static linking is dicey under Linux. But when you use the wx-config --libs flag in the compiler settings, the wxWidgets libs are linked in automatically - mixed in with any shared libraries one may have specified (SQLite) for example.
I'm not sure that the 'any shared libraries one may have specified' bit of that is true. Certainly you don't get the whole of libgtk+* or libc or... So you need to be sure that the target machine(s) have everything 1) installed, and 2) ABI compatible.

It would be safer to create a flatpak/snap/whatever.

Regards,

David

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3787
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: [Not Solved - Not worth chasing. Simply using shared libs and moving on: Repeatable wxWidgets 3.1.3 issue...

Post by ONEEYEMAN » Thu Oct 31, 2019 2:33 pm

Hi,
Can you build and successfully run minimal sample from --disable-shared configuration?

Thank you.

Post Reply