coolzhao / Geo-SAM

A QGIS plugin tool using Segment Anything Model (SAM) to accelerate segmenting or delineating landforms in geospatial raster images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on QGIS 3.36 in ubuntu 20.04

YanCheng-go opened this issue · comments

I was trying the plugin on QGIS 3.36 in ubuntu 20.04. The image encoder worked, but the software crashed whenever I clicked the segmentation tool.

Same issue here:

  • qgis version: 3.34
  • Ubuntu 22.04.4
  • GeoSAM: on the latest commit of this Github 847db2a

Steps to reproduce: Open QGIS, press Segmentation Tool, select generated Encodings, Press "Load" -> Crash.

QGIS Log:

QGIS died on signal 11Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No thread selected
No stack.
gdb returned 256
[1]    71179 IOT instruction (core dumped)  qgis

I launched pdb and checked at which line of code it would crash:

self.index = Index(interleaved=False, properties=Property(dimension=3))

This does not make much sense to me honestly because this simply creates an index. Running this line of code outside of qgis does not create a crash or exception.

Hi @cmosig ,

Thank you for the troubleshooting. This should be a bug of QGIS. I have reproduced this bug in the Python Console in QGIS 3.34 and 3.36. Running the following code directly will cause QGIS to crash.

from rtree.index import Index, Property
index = Index(interleaved=False, properties=Property(dimension=3))

I will submit an issue to QGIS. Since GeoSAM and torchgeo heavily relay on rtree, it is recommended to find a way to install a version prior to 3.34 before QGIS fixes this bug.

Thanks, this worked instantly!

@Fanchengyan Thanks! It also worked for me on Ubuntu 20.02 and QGIS3.36 installed through flatpak. Just need to downgrade rtree with the following line:

flatpak run --devel --command=pip3 org.qgis.qgis install rtree==0.9.4