Crash printing reports in Linux

Hi everybody,

I’m trying to resolve a bug in Xojo under Linux Mint 64 bit with Cinnamon; if I try to print a normal report using the below procedure both the IDE and the executable crash without leaving traces.
The procedure it’s quite a “standard” one like this, and works like a charm under Win7 or MacOS (I’ve extracted the most interesting part):

Dim ps As New PrinterSetup
dim sql as string
Dim rpt As Report1
dim rs as recordSet
dim i as integer

sql="SELECT * FROM table;"
rpt=New Report1
rs=db.SQLSelect(sql)
				
'set the resolution to 300 DPI for printing
ps.MaxHorizontalResolution = 300
ps.MaxVerticalResolution = 300
						
If ps.PageSetupDialog Then
		dim g as graphics
		g = OpenPrinterDialog(ps, nil)
		if g <> nil then
                           dim rsq as new Reports.RecordSetQuery(rs) 
			   If rpt.Run( rsq, ps ) Then
							rpt.Document.Print(g)
			end If
		end if
end if

Do you have any workaround for this?
Have I to fill a Feedback issue?
Thanks everybody.

Am I the only one with this kinda problem?

You are not alone, with 3 reports here, two prints perfect, the third one crashes on this line : “rpt.Document.Print(g)”, messages i see in Terminal are:
…/…/…/…/src/cairo-surface.c:1733: cairo_surface_mark_dirty_rectangle: La declaracin `! _cairo_surface_has_snapshots (surface)’ no se cumple.
Abortado
Xojo 17.1.1 on Devuan ASCII here. I forgot to say that the code is the same in all three Reports, I only change the SQL sentence (and it works giving records correctly).

File Feedback report with simple example project and details of the OS and version you’re using. That’s the only way it’ll get looked at by Xojo.

The same problem may still exist. When I do a simple dialog call, the dialog briefly shows and then the program crashes (closes without any message).

I tried this with 2019r1.1 and it fails on Manjaro:

[code]Dim p As New PrinterSetup
Dim g As Graphics

g = OpenPrinterDialog§

If g <> Nil Then
// Draw text 1 inch across and 1 inch down
g.DrawString(“Hello World”, p.HorizontalResolution, p.VerticalResolution)
End If[/code]

I also tried this with 2019r2.1 and it too fails on Manjaro:

Var ps As New PrinterSetup Var g As Graphics g = ps.ShowPrinterDialog() If g <> Nil Then // Draw text 1 inch across and 1 inch down g.DrawText("Hello World", ps.HorizontalResolution, ps.VerticalResolution) End If

Does anyone else have this problem with different Linux flavours?

When run from the terminal the following message shows up:

Then when I fire the dialog:

The dialog that briefly shows up:

I can reproduce this 100% on the latest Raspbian (and a RasPi 4). Sadly, Xojo can’t.
I have heard about this effect from a couple of customers, but can’t reproduce it in a VM.

At the very least, please add your information here: <https://xojo.com/issue/58365>
Give Xojo as much info about the Distribution/Setup as possible, so that they can finally reproduce and fix this crash…

[quote=474479:@Jürg Otter]When run from the terminal the following message shows up:

(TestPrinter:5350): dbind-WARNING **: 15:33:58.074: Couldn’t register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Then when I fire the dialog:

Aborted (core dumped)[/quote]
Just added the information.

Which “flavour” (XFCE, Plasma, Gnome) are you using, and which Version of the Manjaro-Distribution…? 32Bit / 64Bit?
I just can guess that it might be an issue related to a certain Window Manager, used GTK3 version, …
Anything that helps Xojo to set up the same environment will hopefully help them.

And what I’ve forgotten to write… unfortunately I don’t know of a workaround when that happens.

[quote=474490:@Jürg Otter]Which “flavour” (XFCE, Plasma, Gnome) are you using, and which Version of the Manjaro-Distribution…? 32Bit / 64Bit?
I just can guess that it might be an issue related to a certain Window Manager, used GTK3 version, …
Anything that helps Xojo to set up the same environment will hopefully help them.

And what I’ve forgotten to write… unfortunately I don’t know of a workaround when that happens.[/quote]
I use Manjaro x64 XFCE

It’s the same crux… I’ve just quickly set up a VM with that… and Xojo built apps just print fine.
So I (and probably Xojo, too - since they can’t reproduce it either) keep wondering what configuration/setting it is that leads to these crashes when trying to print on Linux… They are definitely there, just why/when…?

Are either of you running under SELinux or AppArmor? I’ve seen SELinux block all sort of device control requests.

[quote=474506:@Jürg Otter]It’s the same crux… I’ve just quickly set up a VM with that… and Xojo built apps just print fine.
So I (and probably Xojo, too - since they can’t reproduce it either) keep wondering what configuration/setting it is that leads to these crashes when trying to print on Linux… They are definitely there, just why/when…?[/quote]
So from within a VM it works fine, but not natively? If that’s the case, then testing should not be done using VM’s. I hope the Xojo dev team won’t stick to VM environments.

Not that I’m aware of. All I have is a RasPi4 that crashes when-ever a Xojo-built app is trying to print.
And I “have” a customer saying the same for “MX Linux 18.3 64bit, XFCE Desktop”.
And we have Frank with “Manjaro x64 XFCE” also getting crashes when trying to print with xojo-built apps.

I have tried to install both these distributions in VMWare Fusion (default settings, “out of the box”). And I can’t reproduce it.
So I guess I’m not a big help here, other than seeing the same that Xojo has told us: can’t reproduce it (but know it is a real crashing issue). Either it’s some difference when running in a VM. Or that Frank, a customer of ours, and I myself on my RasPi have installed/configured something “differently” - just… what could that be?

Something makes the Xojo Linux Framework “crash” when trying to print - in some environments. But so far we don’t have a simple reproducible environment/setup allowing Xojo to see-debug-and-fix this.

Could it be a bad version or configuration of cups? I’ve seen a bad cups config crash non-Xojo Linux apps when printing simple text.

I dunno… All I know for sure is that I can swipe and freshly setup the latest Raspbian on my Pi4. Simplest, straight-forward setup. Xojo crashes when trying to print. None other applications have an issue. Doesn’t matter if a printer is being configured or not.
And to me it looks the same for some others - not on RasPi, but on Linux/Desktop.

I’ve sent CoreDumps, gdb-trace from my RasPi to Xojo - they couldn’t figure it out.
@Frank Hoogerbeets could certainly attach the CoreDumps he gets to Feedback. There’s a little chance that Xojo can read out more of a x64-CoreDump…

But I’m giving up trying to figure this out… at least for this weekend - have a good one, too :wink:

I am running a freshly installed Manjaro and I can print just fine from ‘native’ apps like Mousepad etc using the same print dialog. I’m pretty sure CUPS is configured correctly.

In my opinion the error message that appears when running a xojo app from the terminal isn’t a good thing and perhaps it is part of the problem.

Further testing reveals that the error message in the terminal is unrelated to xojo apps and the printing issue. I was able to get rid of the message by adding the line [quote]export NO_AT_BRIDGE=1 [/quote] to /etc/environment. It looks like it is Arch specific.

Seems to be the same problem as discussed in this topic: 51581-printersetup-crash-on-linux

Apparently it even happens on Mint and Debian. So how can they close these feedback reports as “the behavior described is not a widely reproducible bug and in most distros this is not an issue, only affects certain configurations it seems.” Going through the comments on this forum, I beg to differ.

Since my first experience with REALbasic (2006) printing capabilities have never been fully supported for Linux and apparently it is still not on the priority list.

I continued my comments on this topic because it is more recent.