Compiled App crashes on one system but not build system

So I have a custom app that I am using for my business and it compiles fine, runs fine from the binary on the development system but when I deploy to the business system it crashes without any error messages. How do I get a crash message generated? All I am able to get is a Segmentation Fault (core dumped) error when I run the app from the CLI.

I had a similar problem. Worked fine on smack but died on windows under VMWare.
It turned out that I was running out of memory because I fucnt close windows - suggest looking at Bratrjce’s article on using test instruments

Hi @Ian McDonald

May it be because the crashing Linux lacks some of the required libraries? (also, check if you’re compiling for 64 bit and the problematic Linux distribution is also 64 bits…or 32 bits).

You can check for the required libraries on deployed systems for Linux at System requirements for current version — Xojo documentation

As @Javier Menéndez suggested check required libraries

In a terminal use ldd while launching the application and see what that outputs

Yeah, starting with -ldd didn’t reveal anything more than a Segmentation Fault (core dump). I thought about the libraries too…

Are you calling out to printer settings?

No on the printer. I do have plans to add a “Gift Certificate” report but that’s on the back burner for now.

Okay, so I have been studying when the app crashes. Again it only does on the work system NOT the build system. I can insert new records no problem, can read them, write files to the disk… BUT when the app goes to UPDATE a record… BAM! Death from above and nothing more than a Segmentation Fault from the CLI.

I even went so far as to install XOJO on the work system and build the app there… same result.

I am using SQLite on Linux Mint 19.3 for the database. There are no special settings no hanky magic, just a simple database that I add data to and update as needed.

Here is a sample of the Update Query code that is dying (at least I believe this is it )

[code]’ *****************************************************
’ Author: XXXXXX “XXXXXX” XXXXXX
’ System: Linux Mint
’ Owner: XXXXXX “XXXXXX” XXXXXX
’ E-Mail: an_emailaddress@somemailbox.com.gov.org
’ Phone: (999) 999-9999
’ *****************************************************

’ – Preliminary Code –

’ – * NONE REQUIRED * –

’ Primary Variable Declaration( s )
Dim recSet As RowSet = JHGCGCDB.SelectSQL( “SELECT * FROM tblSickHours WHERE empId=’” + strEmpId + “’” )

Try
recSet.EditRow
recSet.Column(“empId”).StringValue = strEmpId
recSet.Column(“sickTime”).DoubleValue = dblSickTime
recSet.Column(“vacTime”).DoubleValue = dblVacTime

recSet.SaveRow
MessageBox( "The total Sick Time have been updated for " + strEmpId )

Catch
MessageBox( “Oh crap! Sick Time didn’t update… Call the Dude!!!” )
End Try[/code]

Again this runs on the development system both from the XOJO IDE and the compiled binary file… but on the work system… the app dies running this… and other update queries. Insert, Select they work. Reading files in and adding them to the database… they work to…

Okay, so this is the method that is crashing without any message as to why

Method Name: mthUpdStaffHrs
Parameters: strEmpId As String, strStrtTme As String, strLncStme As String, strLncEtime As String, dblLncHrs As Double, strEndTime As String, strWrkDay As String, strDate As String, dblTotHrs As Double, dblSickTime As Double, dblVacTime As Double, strNewStart As String
Return Type:
Scope: Global

[code]’ Primary Variable Declaration(s)
MessageBox( “In the Update Query just before variable declarations…” ) // Theprogram dies right after this message
Dim recSet As RowSet = JHGCGCDB.SelectSQL( “SELECT * FROM tblHours WHERE empId=’” + strEmpId + “’ AND dates=’” + strDate + “’ AND sTime=’” + strStrtTme + “’” )
Dim dteDay As DateTime = DateTime.Now
MessageBox( “In the Update Query just After variable declarations…” )
’ – Functional Code…
If( strNewStart ="" ) Then
MessageBox( “In the Update Query first part of If statement…” )
Try
recSet.EditRow
recSet.Column(“empId”).StringValue = strEmpId
recSet.Column(“sTime”).StringValue = strStrtTme
recSet.Column(“lStime”).StringValue = strLncStme
recSet.Column(“lEtime”).StringValue = strLncEtime
recSet.Column(“lHrs”).DoubleValue = dblLncHrs
recSet.Column(“eTime”).StringValue = strEndTime
recSet.Column(“wrkDay”).StringValue = dteDay.ToString
recSet.Column(“dates”).StringValue = strDate
recSet.Column(“totHrs”).DoubleValue = dblTotHrs
recSet.Column(“sickTime”).DoubleValue = dblSickTime
recSet.Column(“vacTime”).DoubleValue = dblVacTime

recSet.SaveRow
MessageBox( "Your time updates have been saved." )

Catch
MessageBox( “Oh crap! Staff Hours didn’t save… Call Ian!!!” )
End Try

Else
MessageBox( “In the Update Query second part of If statement…” )
Try
recSet.EditRow
recSet.Column(“empId”).StringValue = strEmpId
recSet.Column(“sTime”).StringValue = strNewStart
recSet.Column(“lStime”).StringValue = strLncStme
recSet.Column(“lEtime”).StringValue = strLncEtime
recSet.Column(“lHrs”).DoubleValue = dblLncHrs
recSet.Column(“eTime”).StringValue = strEndTime
recSet.Column(“wrkDay”).StringValue = dteDay.ToString
recSet.Column(“dates”).StringValue = strDate
recSet.Column(“totHrs”).DoubleValue = dblTotHrs
recSet.Column(“sickTime”).DoubleValue = dblSickTime
recSet.Column(“vacTime”).DoubleValue = dblVacTime

recSet.SaveRow
MessageBox( "Your time changes have been updated." )

Catch
MessageBox( “Oh crap! Staff Hours didn’t save… Call Ian!!!” )
End Try
End If[/code]

I used a bunch of MessgeBoxes to track where I was in the program so I could see exactly where it’s crashing. And it’s not just this update method.
Essentially this Message: “In the Update Query just before variable declarations…” will display then after acknowledging the message the application crashes. Again it’s ONLY crashing on the production system and NOT the development system. I am completely stumped…

Oh, one theory I have is the CPU architecture might be the issue. The dev system is a KabyLake i7 and the prod system is a Sandy Bridge i7. Technically that shouldn’t matter but at the moment I am grasping at straws here…

Not to derail the subject or deminish anything, just had to comment on this line:

ROFL

I am at my wits end here… any ideas at all?

I tried starting by CLI (below) so I can try and find the issue… NERP!

jhgc@jhgc-PC:~/Gift Cert DB$ ./Gift\ Cert\ DB
Segmentation Fault
jhgc@jhgc-PC:~/Gift Cert DB$ ./Gift\ Cert\ DB -ldd
Segmentation Fault

Not sure what to do now…

Is this with 32 bit or 64 bit builds? Or both?

Also, it might be the large number of arguments, i.e. too many (meaning it’s a bug in the compiler). Try putting them into a dictionary and pass the dictionary, or create a class for them and put them in there. See if that avoids the crash. If so, that would be a good indication of said compiler bug.

I am also experiencing crashes on Linux currently and looked into this thread for help with figuring out how to see a crashlog.

So, here’s how I got some more info on the crash:

I am using the Remote Debugger, where I uncheck the option “Launch executable after receiving”. You can probably accomplish the same when using the IDE on Linux by running the app with the “Run Paused” command from the menu. With the Remote Debugger, I also have to uncompress the downloaded .gz file before proceeding.

Then I open the Terminal and cd to the “DebugMyApplication” (or whatever your app is called) folder, then open the executable with “gdb DebugMyApplication”. Once gdb has loaded the code, I enter “run”.

Once the crash occurs, I can get a full stack trace with the command “bt”. In my case it’s crashing in gtk_settings_get_for_screen. Which told me that it’s a declare in my own code. Now looking for help in a separate thread with that.

Ok, so in a second if inspiration I decided to run as sudo… oh, both systems are 64bit Intel i7 CPU’s. The dev system is pretty nice, the prod system is perfect for what it’s set up for. Anyhow I will post both system specs later in this post… back to sudo. So I ran my app as sudo (not something I want staff to do…) and I got a bit more out of the CLI.

[code]thedudeslaptop@thedudeslaptop-PC:~/Gift Cert DB$ sudo ./Gift\ Cert\ DB --ldd
[sudo] password for thedudeslaptop:

** (Gift Cert DB:10128): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Segmentation fault
thedudeslaptop@thedudeslaptop-PC:~/Gift Cert DB$[/code]

Now below are the two systems specs starting with the dev machine:

thedude@thedude-GL73-8RC:~$ inxi -Fxz System: Host: thedude-GL73-8RC Kernel: 5.0.0-32-generic x86_64 bits: 64 compiler: gcc v: 7.4.0 Desktop: Cinnamon 4.4.8 Distro: Linux Mint 19.3 Tricia base: Ubuntu 18.04 bionic Machine: Type: Laptop System: Micro-Star product: GL73 8RC v: REV:1.0 serial: <filter> Mobo: Micro-Star model: MS-17C6 v: REV:1.0 serial: <filter> UEFI: American Megatrends v: E17C6IMS.105 date: 05/08/2018 Battery: ID-1: BAT1 charge: 40.4 Wh condition: 41.0/43.2 Wh (95%) model: MSI Corp. MS-17C6 status: Unknown CPU: Topology: 6-Core model: Intel Core i7-8750H bits: 64 type: MT MCP arch: Kaby Lake rev: A L2 cache: 9216 KiB flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 52992 Speed: 800 MHz min/max: 800/4100 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 801 8: 800 9: 800 10: 801 11: 800 12: 800 Graphics: Device-1: Intel vendor: Micro-Star MSI driver: i915 v: kernel bus ID: 00:02.0 Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] vendor: Micro-Star MSI driver: nvidia v: 435.21 bus ID: 01:00.0 Display: x11 server: X.Org 1.19.6 driver: modesetting,nvidia unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz OpenGL: renderer: GeForce GTX 1050/PCIe/SSE2 v: 4.6.0 NVIDIA 435.21 direct render: Yes Audio: Device-1: Intel Cannon Lake PCH cAVS vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus ID: 00:1f.3 Sound Server: ALSA v: k5.0.0-32-generic Network: Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel port: 5000 bus ID: 00:14.3 IF: wlo1 state: up mac: <filter> Device-2: Qualcomm Atheros QCA8171 Gigabit Ethernet vendor: Micro-Star MSI driver: alx v: kernel port: 3000 bus ID: 02:00.0 IF: enp2s0 state: down mac: <filter> IF-ID-1: vmnet1 state: unknown speed: N/A duplex: N/A mac: <filter> IF-ID-2: vmnet8 state: unknown speed: N/A duplex: N/A mac: <filter> Drives: Local Storage: total: 1.94 TiB used: 825.49 GiB (41.6%) ID-1: /dev/sda vendor: Kingston model: RBUSNS8180S3128GJ size: 119.24 GiB ID-2: /dev/sdb vendor: Seagate model: ST2000LX001-1RG174 size: 1.82 TiB Partition: ID-1: / size: 111.76 GiB used: 46.19 GiB (41.3%) fs: btrfs dev: /dev/sda3 ID-2: /home size: 1.79 TiB used: 779.29 GiB (42.5%) fs: ext4 dev: /dev/sdb1 ID-3: swap-1 size: 7.01 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda2 Sensors: System Temperatures: cpu: 42.0 C mobo: N/A gpu: nvidia temp: 38 C Fan Speeds (RPM): N/A Info: Processes: 367 Uptime: 58m Memory: 31.26 GiB used: 2.20 GiB (7.0%) Init: systemd runlevel: 5 Compilers: gcc: 7.4.0 Shell: bash v: 4.4.20 inxi: 3.0.32

And now the production machine

[code]
Computer
Processor 8x Intel® Core™ i7-2670QM CPU @ 2.20GHz
Memory 3943MB (2848MB used)
Operating System Deepin 15.11
User Name thedudesbiz (Unknown)
Date/Time Sat 11 Jul 2020 03:27:52 PM PDT

Display
Resolution 1366x768 pixels
OpenGL Renderer Unknown
X11 Vendor The X.Org Foundation

Multimedia
Audio Adapter HDA-Intel - HDA Intel PCH

Input Devices
Lid Switch
Power Button
Power Button
AT Translated Set 2 keyboard

Video Bus
SynPS/2 Synaptics TouchPad
PC Speaker

Toshiba input device
HDA Intel PCH Mic
HDA Intel PCH Headphone
HDA Intel PCH HDMI/DP,pcm 3=
USB 2.0 Camera: USB 2.0 Camera

Printers
No printers found
SCSI Disks
ATA SanDisk SSD PLUS
TSSTcorp CDDVDW TS-L633W
Seagate BUP Slim

Operating System
Version
Kernel Linux 4.15.0-30deepin-generic (x86_64)
Compiled #31 SMP Fri Nov 30 04:29:02 UTC 2018
C Library Unknown
Default C Compiler GNU C Compiler version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)
Distribution Deepin 15.11
Current Session

Computer Name thedudesbiz-PC
User Name thedudesbiz (Unknown)
Home Directory /home/thedudesbiz
Desktop Environment Unknown (Window Manager: KWin)[/code]

If you google “The name org.a11y.Bus was not provided by any .service files” then the first hits will mention this error and offer a solution. Good luck!

So, create a VM on your Deepin system and install the Cinnamon version of Mint 19.3 and see if you can duplicate this directly.

HAHAHAHAHAA~ I FINALLY found what I did WRONG!!! And now all is happy in my business!

So in my Select Queries I use the following:

[code]’ Primary Variable Declaration(s)
Dim recSet As RecordSet

’ Function(s) / Logic…
If (dbJHGCGC.Connect) = True Then
recSet = dbJHGCGC.SQLSelect(“SELECT * FROM tblGiftCert”)
End If[/code]

Works great… BUT in my Update query… that’s where I flubbered… the next snippet of code is what I had written originally…

recSet = JHGCGC.SelectSQL( "SELECT * FROM tblUsedCert WHERE custRecNum='" + strCustId + "'" )

This next snippet is the corrected code…

[code]If (dbJHGCGC.Connect) = True Then
recSet = dbJHGCGC.SelectSQL( “SELECT * FROM tblUsedCert WHERE custRecNum=’” + strCustId + “’” )

End If[/code]

The problem was the original was calling JHGCGC instead of dbJHGCGC… which raises the question, why did it work on the main system? Shouldn’t it have crashed there too?

Could be one was still valid

good long descriptive names for variables might have made that more obvious

the two vary by just 2 characters which is easy to overlook