I have a WebApplication running on unix built with Xojo 2015r2… It is experiencing random segfaults when accessing an ODBC database. It works perfectly fine 100% of the time if I comment out the ODBC connection. It also works probably 50-75% of the time WITH the ODBC connection. But 25% of the time it just crashes with no warning. I have tried running it as root, on different ports, with and without the ODBC… This app has several features to it and none of them have EVER caused a segfault until I try to do an INSERT on a ODBC database.
Here is what I get:
Apr 24 09:44:07 brenrh01 kernel: myAPP: segfault at f4254ff8 ip 00000000f7736b6b sp 00000000f4254ffc error 6 in libpthread-2.17.so[f772e000+16000]
I am not sure what is causing the error. Because the INSERT is causing an issue, maybe try to perform an INSERT in another way.
One type of insert…
[code]Dim row As New DatabaseRecord
// ID will be updated automatically
row.Column(“Name”) = “Penguins”
row.Column(“Coach”) = “Bob Roberts”
row.Column(“City”) = “Boston”
If App.DB.Error Then
MsgBox("DB Error: " + App.DB.ErrorMessage)
Another type of insert…
[code]Dim db as ODBCDatabase
db = new ODBCDatabase
… more code…
db.SQLExecute(“INSERT INTO Team (Name, Coach, City) VALUES (‘Penguins’, ‘Bob Roberts’, ‘Boston’)”)[/code]
Not sure if it will help, but its worth a try.
Thanks @Eugene Dakin for your response.
I have tried several things and the only way I found to prevent the segfault 100% of the time is to move the this function into a helper (console) app and run it in a shell from the main app. There is a small delay, but it never fails. Plus, this is probably better application design anyway - so I am going to build out the remaining modules the same way. Seems to work flawlessly now.