PrinterSetup crash on Linux

Since the last Xojo update I have this problem.
a simple button that executes this code causes it to break:

Dim pageSetup As New PrinterSetup Dim s As String If pageSetup.PageSetupDialog Then 'In this line breaks s= PageSetup.SetupString End If

a few milliseconds you see the print dialog, then nothing.

But what kind of error do you see? Do you have a crash report?

I’m seeing something similar and, no - i can’t find a crash report for my project nor the IDE.

I have the same problem!

Dim ps As New PrinterSetup If ps.PageSetupDialog Then 'Dim page As Graphics 'page = OpenPrinterDialog(ps) 'If page <> Nil Then '' Draw text on page 1 with 1 inch left/top margin 'Dim leftMargin As Double = ps.HorizontalResolution 'Dim topMargin As Double = ps.VerticalResolution 'page.TextSize = Val(FontPopup.Text) 'page.DrawString(TextArea1.Text, leftMargin, topMargin, ps.Width - leftMargin * 2) 'End If End If
If “If ps.PageSetupDialog Then” and “end if” are deactivated it works.
It seems that the printerdialog is flickering for a msec.
No messages found in var/log.

Who can help?

What distribution are you using? And more specific: What GTK3 version does it have? Do you build for 32Bit or 64Bit?

This is a known issue: <> Linux, GTK3: Printing crashes the application
Xojo built 32Bit GTK3 apps may hard crash (with a segmentation fault) when trying to print.
This happens only with certain distributions: Ubuntu 14.04.5 LTS, Debian 8 (and possibly others).

Since Xojo has closed that report: “the behavior described is not a widely reproducible bug and in most distros this is not an issue, only affects certain configurations it seems.

I then have added another Feedback: <>
I’m just asking to have the framework not crashing with a Segmentation Fault. Just a try-catch (in case of error: MsgBox) in that Framework function. Even just try-catch-do-nothing is better than crashing - since users of Xojo built applications may loose unsaved data…

But again… closed. It seems that Xojo is not willing to fix this. Not even a fix to not crash with a Segmentation Fault :frowning:

And… for this very reason, we’re currently providing two Linux 32Bit builds. A GTK2 one compiled with 2016r3 (for the “older Linux distributions” that may have this issue when printing). And a shiny new HiDPI capable one compiled with 2018r4 for the others.

While I don’t know if you’re having the same issue, it sure seems like it. You could ask the <> to be reopened - providing information about Distribution/GTK3-version. That way Xojo at least gets to know what is not working. And the more are requesting the case to be looked at again, the more likely it is they consider it once more - even though having closed it twice already. We can just let them know that this is important to us.

That sounds not good…
I’m using Linux Mint Tesa 64bit and Xojo 19r1.

Können wir eigentlich auch deutsch reden? :slight_smile:

Hmm - I haven’t seen this with 64Bit builds (Ubuntu, Debian)…
If you launch your application from the Terminal - do you get a 'Segmentation fault", too?
If so - does it happen with Xojo’s printing example projects, too? Then it would be best to report this in Feedback as a “new case” (and just mentioned the others/older ones).

On the german channel, sure :slight_smile:

Trying to update my Linux 64-bit versions from Xojo2016r3 to 2018r4/2019r1 I tested this. On fresh installed Mint 18.3 and 19.1 it crashes with the printerdialog, on Ubuntu 18.04 it works great.
But is this really a Xojo problem?
Abandoned my tests for now as I have a lot of other things to do.

The crash also happens on Manjaro 64bits with XFCE desktop. See my addition to (]feedback case #58365

The current crash only adds to the problem. I was willing to go from Real Studio to Xojo back in 2013 and purchase a professional license if printer support on Linux would be improved, in particular the ability to save the setup string. See my comment on this issue at the time. Going by (>]this latest feedback report, it still has not been fixed/enabled. Seven years down the road there is still no improvement. Apparently it has only become worse. My disappointment cannot be overstated.

I did some more testing. It appears that the crash only occurs with 64 bits. If I run this code in 32 bits mode, there is no problem. I tried Xojo 2016r4 (which only supports 32 bits apps) on Manjaro 64 bits with XFCE desktop (not in a VM), and the app does not crash. This bug appeared with Xojo2017 and 64 bits compilation and still exists in Xojo2019r3.1.

I updated (>]feedback case #58365

I have some good news, well perhaps partially. As I said earlier I tried Xojo2016r4 and it turns out that the PrinterSetupDialog pops up just fine.

But there is an oddity. On 64 bit systems Xojo2016r4 runs and can compile projects, but only when set to “x86 32 bit”. This would give one the idea that the compiled app would not run on 64 bit systems, but this is not true. Even though the project is set to 32 bit compilation, apparently the compiled app IS 64 bit. All later Xojo versions I tried complained that it cannot compile 32 bit apps because my system (Manjaro 64 bit XFCE) does not have the necessary libraries installed.

It seems Xojo2016r4 sneaked through…

Because I’m no longer seeing this on CentOS 7, Mint 19, SuSE LEAP, or my home-brewed Linux, I built 5 VM’s with Manjaro, Mageia, Arch 2019.12.01, stock Debian Buster, and Ubuntu 18.04.3 and I can’t get a crash when calling ps.PageSetupDialog on any of them, either. I’ve also tried on 2 rPI 4’s (Raspbian), and 1 rPI 3 B+ (Armbian) with no error.

This is from 19r1.1, but it’s the same with 19r3.

My point is not to say that it’s not happening, but there has to be some odd set of circumstances involved to cause the error. The above were all default installs with the update/upgrade via each platforms software manager to the latest patches on each.

Try without VMs. It appears to make a difference.

The Pi’s and my primary systems aren’t VMs. Only the other 5 systems that I was checking were. And, since I use VirtualBox for Linux VM’s, there’s none of the “magic” that VMWare or Parallels apply that would change the hardware signatures.

Well, the crash appears to be reproducible according to the feedback report. I bet it is 64bits and/or GTK3 related. What desktops do you use?

What system did you use at the time when you experienced the same problem?

Those were back under Fedora 24, Mint 17, and other distros available back in 2018.

[quote=474632:@Tim Jones] I’ve also tried on 2 rPI 4’s (Raspbian) with no error.
My point is not to say that it’s not happening, but there has to be some odd set of circumstances involved to cause the error.[/quote]
I have just flashed a Micro SD using Etcher with the latest available Raspbian Buster. Put it in the Pi 4 (4GB), setup with defaults (even configured to default US/English, to rule out possible european countries/localization issues). Installed all updates, then installed Xojo’s RemoteDebugger, loaded an example project of Xojo (any of the printing ones) on macOS. RemoteDebug - and boom - app dies on the Pi4, as soon as any PageSetup or Printer Dialog should be shown. Same if I build the app and run it on the Pi4.

To me this fresh setup of a Pi 4 doesn’t look like an “odd set of circumstances”… so what could be the difference? There has to be one…
I understand that “pc hardware” and various drivers could result into some odd complications. But an official Pi 4 and the official Raspbian seems pretty standard and straight-forward (to me)… So why can your Xojo built apps print, but none of mine (on my Pi4)?

I don’t get it… it’s odd for sure. Lucky you, Tim :slight_smile: I’m still curious to somewhen figure out what makes this difference of being able to print with Xojo built apps, or have them crash/quit unexpectedly. We see this effect on arm32 and x64, and so does Frank. At least I’m not the only odd one :wink:

I take back what I said about Xojo 2016r4. Simply put, as of 2015r3 all versions make my 64-bits apps silently crash when trying to open a printer dialog. All 32-bits versions run just fine. So Xojo isn’t doing something the right way because no other software has printing issues on my Manjaro system.