flathub / com.flashforge.FlashPrint

https://flathub.org/apps/details/com.flashforge.FlashPrint
2 stars 5 forks source link

FlashPrint crashes when VPN is on #17

Open hadess opened 2 years ago

hadess commented 2 years ago

FlashPrint 5.2.0 crashes when opening the Connect Machine dialogue.

It didn't crash when --unshare=network is passed (though you can't connect to any machines obviously), or when the VPN is disabled.

ifconfig output for that VPN:

tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1360
        inet 10.39.192.186  netmask 255.255.240.0  destination 10.39.192.186
        inet6 fd10:39:192:1::10b9  prefixlen 64  scopeid 0x0<global>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)
        RX packets 2034  bytes 397629 (388.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3041  bytes 184571 (180.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The valgrind output is useless:

==33== Invalid read of size 2
==33==    at 0x7B2B80: ??? (in /app/extra/share/FlashPrint5/FlashPrint)
==33==    by 0x4C7D07: ??? (in /app/extra/share/FlashPrint5/FlashPrint)
==33==    by 0x596F2E7: QThreadPrivate::start(void*) (qthread_unix.cpp:342)
==33==    by 0x5F3C5E1: start_thread (pthread_create.c:479)
==33==    by 0x61BD472: clone (clone.S:95)
==33==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==33== 
==33== 
==33== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==33==  Access not within mapped region at address 0x0
==33==    at 0x7B2B80: ??? (in /app/extra/share/FlashPrint5/FlashPrint)
==33==    by 0x4C7D07: ??? (in /app/extra/share/FlashPrint5/FlashPrint)
==33==    by 0x596F2E7: QThreadPrivate::start(void*) (qthread_unix.cpp:342)
==33==    by 0x5F3C5E1: start_thread (pthread_create.c:479)
==33==    by 0x61BD472: clone (clone.S:95)
==33==  If you believe this happened as a result of a stack
==33==  overflow in your program's main thread (unlikely but
==33==  possible), you can try to increase the size of the
==33==  main thread stack using the --main-stacksize= flag.
==33==  The main thread stack size used in this run was 8388608.
derivator commented 2 years ago

I have reported this to Flashforge customer support. The problem is that Flashprint dereferences ifa_addr, which may be NULL for tun devices.

hadess commented 2 years ago

I have reported this to Flashforge customer support.

Thanks, much appreciated.

tuxflo commented 8 months ago

I'm facing the same issue and want to add, that it is not enough to "just disable" VPN. If someone is using tailscale the device tailscale0 still exists if you are running sudo tailscale down and flashprint keeps crashing when searching for printers. Only if the link is completely removed, so that ip -c a doesn't show the device anymore, then the search dialog is able to start.

rocha commented 7 months ago

@tuxflo is there an easy way of temporarily disabling the tailscale link?

tuxflo commented 7 months ago

It is possible to delete it using sudo ip link delete tailscale0 after doing sudo tailscale down but I have no idea how to bring it up again.

rocha commented 7 months ago

@tuxflo Thanks!

ecations commented 6 months ago

This issue still exists with the latest Ubuntu (23) installation and Proton VPN.

0sleep commented 4 months ago

This issue STILL exists. It's not that difficult to guard against dereferencing a null pointer. if (ifa->ifa_addr == NULL) continue; family = ifa->ifa_addr->sa_family; (see https://github.com/eProsima/Fast-DDS/issues/37 )

hadess commented 4 months ago

This issue STILL exists. It's not that difficult to guard against dereferencing a null pointer.

You should tell Flashforge, there's nothing we can do here, as we're just repackaging their binaries.