How to detect the reason of crash?

SketchUp crashes from time to time when using my plugin. How can I track down the reason of crashing?

Do you use rescue clauses in your methods ?

Do you wrap all file IO operations in beginrescueend blocks ?

Do you wrap all geometry creation within model.start_operationmodel.commit_operation blocks ?

meaning that you should code defensively.

Do you know what the last part of your code that ran successfully, before the crash occurred ?

meaning that you can insert temporary puts statements into the code that output to the console whilst debugging.

Does BugSplat trap the crash ?

If so, you can read the logs while they are in the Temp folder before you send them to Trimble.
(They’ll get erased after you send them.)

If not, have you tried to see if Windows Error Reporting logged the crash ?
Check these paths …

"C:\ProgramData\Microsoft\Windows\WER\ReportArchive"
"C:\ProgramData\Microsoft\Windows\WER\ReportQueue"

Any crash reports for SketchUp will have "SketchUp.exe" in the folder name. (These are compressed folders, by the way.)

You most likely have to login to an Admin account in order to open these folders.
or look up the error information the the Windows Event Viewer. (You’ll find it under Windows Administrative Tools if they are installed.)

1 Like

Please check the following forum.

SU has a big problem. Small dimensions cause SU to terminate silently!!! Try not to have edges less than 0.01 inches in your plugin.

1 Like

Hm… Do you have any models or code that reproduce this?

Have you tried tracing your code with logging or a debugger to find out when SU crashes?
And as Dan asked, do you see a BugSplat dialog? (If so, did you submit it?)

Please kindly check the following link.

Just run the following code in your SU and see what will happen.

        s_grp = Sketchup.active_model.active_entities.add_group
        @pt = [0, 0, 0]
        x = 10
        pts = [[1.94894, 1.22513, 0], [0.87372, 0.14991, 0], [0.82338, 0.10577, 0], [0.76772, 0.06857, 0], [0.70768, 0.03896, 0], [0.64428, 0.01744, 0], [0.57862, 0.00438, 0], [0.5118, 0, 0], [0.445, 0.00438, 0], [0.434067, 0.00655667, 0], [0.3794, 0.01744, 0], [0.316, 0.03896, 0], [0.265917, 0.063635, 0], [0.2559, 0.06857, 0], [0.247957, 0.0738843, 0], [0.2003, 0.10577, 0], [0.1571, 0.143604, 0], [0.1499, 0.14991, 0], [0.1058, 0.20024, 0], [0.0686, 0.25591, 0], [0.039, 0.31595, 0], [0.0175, 0.37935, 0], [0.0044, 0.44501, 0], [0, 0.51181, 0], [0, x + 0.5118, 0], [0.0044, x + 0.5786, 0], [0.0175, x + 0.6443, 0], [0.039, x + 0.7077, 0], [0.0686, x + 0.7677, 0], [0.1058, x + 0.8234, 0], [0.1499, x + 0.8737, 0], [0.2003, x + 0.9178, 0], [0.2559, x + 0.955, 0], [0.316, x + 0.9847, 0], [0.3794, x + 1.0062, 0], [0.445, x + 1.0192, 0], [0.5118, x + 1.0236, 0], [x + 0.5118, x + 1.0236, 0], [x + 0.5786, x + 1.0192, 0], [x + 0.6442, x + 1.0062, 0], [x + 0.7076, x + 0.9847, 0], [x + 0.7677, x + 0.955, 0], [x + 0.8233, x + 0.9178, 0], [x + 0.8737, x + 0.8737, 0], [x + 0.9178, x + 0.8234, 0], [x + 0.955, x + 0.7677, 0], [x + 0.9846, x + 0.7077, 0], [x + 1.0061, x + 0.6443, 0], [x + 1.0192, x + 0.5786, 0], [x + 1.0236, x + 0.5118, 0], [x + 1.0236, 0.51181, 0], [x + 1.0192, 0.44501, 0], [x + 1.0061, 0.37935, 0], [x + 0.9846, 0.31595, 0], [x + 0.955, 0.25591, 0], [x + 0.9178, 0.20024, 0], [x + 0.8737, 0.14991, 0], [x + 0.8233, 0.10577, 0], [x + 0.7677, 0.06857, 0], [x + 0.7076, 0.03896, 0], [x + 0.6442, 0.01744, 0], [x + 0.5786, 0.00438, 0], [x + 0.5118, 0, 0], [0.5118, 0, 0], [0.445, 0.00438, 0], [0.434067, 0.00655667, 0], [0.3794, 0.01744, 0], [0.316, 0.03896, 0], [0.265917, 0.063635, 0], [0.2559, 0.06857, 0], [0.247957, 0.0738843, 0], [0.2003, 0.10577, 0], [0.1571, 0.143604, 0], [0.1499, 0.14991, 0], [0.1058, 0.20024, 0], [0.0686, 0.25591, 0], [0.039, 0.31595, 0], [0.0175, 0.37935, 0], [0.0044, 0.44501, 0], [0, 0.51181, 0], [0.00438, 0.57862, 0], [0.01744, 0.64428, 0], [0.03896, 0.70768, 0], [0.06857, 0.76772, 0], [0.10577, 0.82338, 0], [0.14991, 0.87372, 0], [1.22513, 1.94894, 0]]

        ll = 0
        dis = 0
        for i in 0...pts.size
          ll = ll + pts[i].distance(pts[i + 1]) if i != pts.size - 1
        end
        for i in 0...pts.size
          pts[i].z = @pt.z + (0.5 / 2.54) - dis / ll * (1 / 2.54)
          dis = dis + pts[i].distance(pts[i + 1]) if i != pts.size - 1
        end
         p ll
        cp = pts.first
        vector1 = pts[0].vector_to(pts[1])
        edge1 = s_grp.entities.add_circle cp, vector1, (0.5 / 2.54)
        edge1 = s_grp.entities.weld(edge1)
        path1 = s_grp.entities.add_curve pts
        face2 = s_grp.entities.add_face(edge1)
        face2.followme path1

Please keep this thread on topic, and use the linked topic for the “silent terminate - small face” issue.

1 Like

I did it Dan, Thank you for the advice.