Bug report: SDK Manager 4.0.6 segfaults on Ubuntu 18 on login

I hSteps to reproduce:

I hope somebody at Garmin will read it, this will not fall through the cracks, and it will eventually make it to the developers of the SDK manager. Steps to reproduce:

On Ubuntu 18

apt install libwebkitgtk-1.0-0

Download SDK manager 4.0.6 for Linux

mkdir garmin-sdk

cd garmin-sdk

unzip ~/Downloads/connectiq-sdk-manager-linux.zip # assuming that is where you put it

bin/sdkmanager

agree to the license, then log in to your account

upon successful login, a brief 500 server error message is displayed

In gdb we see this:

gdb bin/sdkmanager

...

(gdb)run

Thread 1 "sdkmanager" received signal SIGSEGV, Segmentation fault.
____longjmp_chk () at ../sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S:130
130     ../sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S: No such file or directory.

(gdb) thread apply all bt

Thread 23 (Thread 0x7fff84f5b700 (LWP 22723)):
#0  0x00007ffff6f5fad3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fffddc9f4dc)
   at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x7fffddc9f488, cond=0x7fffddc9f4b0) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x7fffddc9f4b0, mutex=0x7fffddc9f488) at pthread_cond_wait.c:655
#3  0x00007ffff177cf4b in WTF::ThreadCondition::timedWait(WTF::Mutex&, double) ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#4  0x00007ffff2beae9b in ?? () from /usr/lib/x86_64-linux-gnu/libwebkitgtk-1.0.so.0
#5  0x00007ffff177c95a in ?? () from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#6  0x00007ffff6f596db in start_thread (arg=0x7fff84f5b700) at pthread_create.c:463
#7  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 18 (Thread 0x7fff6b7fe700 (LWP 22718)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff52b7a8a in g_cond_wait_until () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff52445a1 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff5244b5c in g_async_queue_timeout_pop () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff5299d4e in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff52992a5 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff6f596db in start_thread (arg=0x7fff6b7fe700) at pthread_create.c:463
#7  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 14 (Thread 0x7fff86dc0700 (LWP 22714)):
#0  0x00007ffff0282cb9 in __GI___poll (fds=0x110e800, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff52716e9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff52717fc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fff86dc836d in ?? () from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007ffff52992a5 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6f596db in start_thread (arg=0x7fff86dc0700) at pthread_create.c:463
#6  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

  at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x7fffdc8e2fe0, cond=0x7fffdc8e3008) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x7fffdc8e3008, mutex=0x7fffdc8e2fe0) at pthread_cond_wait.c:655
#3  0x00007ffff745a8bc in std::condition_variable::wait(std::unique_lock<std::mutex>&) ()
  from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff1492eeb in JSC::GCThread::waitForNextPhase() ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#5  0x00007ffff1492fd8 in JSC::GCThread::gcThreadMain() ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#6  0x00007ffff177c95a in ?? () from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#7  0x00007ffff6f596db in start_thread (arg=0x7fff877fe700) at pthread_create.c:463
#8  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 12 (Thread 0x7fff87fff700 (LWP 22712)):
#0  0x00007ffff6f5fad3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fffdc8e3034)
   at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x7fffdc8e2fe0, cond=0x7fffdc8e3008) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x7fffdc8e3008, mutex=0x7fffdc8e2fe0) at pthread_cond_wait.c:655
#3  0x00007ffff745a8bc in std::condition_variable::wait(std::unique_lock<std::mutex>&) ()
  from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff1492eeb in JSC::GCThread::waitForNextPhase() ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#5  0x00007ffff1492fd8 in JSC::GCThread::gcThreadMain() ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#6  0x00007ffff177c95a in ?? () from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#7  0x00007ffff6f596db in start_thread (arg=0x7fff87fff700) at pthread_create.c:463
#8  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 11 (Thread 0x7fff8ce80700 (LWP 22711)):
#0  0x00007ffff6f5fad3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fffdc8e3034)
   at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x7fffdc8e2fe0, cond=0x7fffdc8e3008) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x7fffdc8e3008, mutex=0x7fffdc8e2fe0) at pthread_cond_wait.c:655
#3  0x00007ffff745a8bc in std::condition_variable::wait(std::unique_lock<std::mutex>&) ()

  from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff1492eeb in JSC::GCThread::waitForNextPhase() ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#5  0x00007ffff1492fd8 in JSC::GCThread::gcThreadMain() ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#6  0x00007ffff177c95a in ?? () from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#7  0x00007ffff6f596db in start_thread (arg=0x7fff8ce80700) at pthread_create.c:463
#8  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 10 (Thread 0x7fff8d681700 (LWP 22710)):
#0  0x00007ffff6f60065 in futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fff8d680b30,  
   expected=0, futex_word=0x7fffdc8d927c) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  __pthread_cond_wait_common (abstime=0x7fff8d680b30, mutex=0x7fffdc8d9228, cond=0x7fffdc8d9250)
   at pthread_cond_wait.c:539
#2  __pthread_cond_timedwait (cond=0x7fffdc8d9250, mutex=0x7fffdc8d9228, abstime=0x7fff8d680b30)
   at pthread_cond_wait.c:667
#3  0x00007ffff1491938 in JSC::BlockAllocator::waitForDuration(std::chrono::duration<long, std::ratio<1l, 1000l> >)
() from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#4  0x00007ffff14919f8 in JSC::BlockAllocator::blockFreeingThreadMain() ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#5  0x00007ffff177c95a in ?? () from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#6  0x00007ffff6f596db in start_thread (arg=0x7fff8d681700) at pthread_create.c:463
#7  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 9 (Thread 0x7fffdc876700 (LWP 22709)):
#0  0x00007ffff6f5fad3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fffdc881cec)
   at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x7fffdc881c98, cond=0x7fffdc881cc0) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x7fffdc881cc0, mutex=0x7fffdc881c98) at pthread_cond_wait.c:655
#3  0x00007ffff28a446b in ?? () from /usr/lib/x86_64-linux-gnu/libwebkitgtk-1.0.so.0
#4  0x00007ffff28a605d in ?? () from /usr/lib/x86_64-linux-gnu/libwebkitgtk-1.0.so.0
#5  0x00007ffff177c95a in ?? () from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#6  0x00007ffff6f596db in start_thread (arg=0x7fffdc876700) at pthread_create.c:463
#7  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 8 (Thread 0x7fffdd179700 (LWP 22708)):
#0  0x00007ffff02527a0 in __GI___nanosleep (requested_time=requested_time@entry=0x7fffdd178b70,  
   remaining=remaining@entry=0x7fffdd178b70) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
#1  0x00007ffff025267a in __sleep (seconds=0) at ../sysdeps/posix/sleep.c:55
#2  0x00007ffff1762314 in WTF::TCMalloc_PageHeap::scavengerThread() ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#3  0x00007ffff1762399 in WTF::TCMalloc_PageHeap::runScavengerThread(void*) ()
  from /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0
#4  0x00007ffff6f596db in start_thread (arg=0x7fffdd179700) at pthread_create.c:463
#5  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 5 (Thread 0x7fffdfa02700 (LWP 22705)):
#0  0x00007ffff0282cb9 in __GI___poll (fds=0xeee560, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff52716e9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff5271a82 in g_main_loop_run () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff560b2d6 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007ffff52992a5 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6f596db in start_thread (arg=0x7fffdfa02700) at pthread_create.c:463
#6  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7fffe0203700 (LWP 22704)):
#0  0x00007ffff0282cb9 in __GI___poll (fds=0x7fffd801a050, nfds=2, timeout=-1)
   at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007ffff52716e9 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff52717fc in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff5271841 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff52992a5 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff6f596db in start_thread (arg=0x7fffe0203700) at pthread_create.c:463
#6  0x00007ffff028f71f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ffff7f8af00 (LWP 22697)):
#0  ____longjmp_chk () at ../sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S:130
#1  0x67fa6a8b124b7f41 in ?? ()
Backtrace stopped: Cannot access memory at address 0x6bf0ec8493d3f0ee


So clearly we are dealing with some kind of memory overrun/corruption. I hope you can fix the bug. I would also like to offer some feedback on how to avoid such problems as I believe this is the result of some poor decision making in the area of choosing the tools to do the job:

- Why in the world would you write a tool to download the the SDK in C++? A GUI tool in C++ - in addition to adding the extra development time has a problem of being dependent on many libraries. In this particular case, the number is 122. Those libraries change from distro to distro intoducting all kinds of instability. I would recommend that you write it in a scripting language like Python using either QT or GTK bindings.

- It would be very helpful if the GUI tool was a wrapper around a  command-line utility with well-documented interface. This way if GUI blows up, at least there is a command-line workaround to get the job done.

- Any reason the SDK manager could not be open-source? If it was, I would have sent you the fix for this already.

- How much testing did this go through before you released it? Ubuntu 18 is not that rare of system, should have been tested.

All in all, this type of experience is a big turn-off to a skilled engineer that is considering working for Garmin. A crash like this with no workaround short of changing the OS makes a skilled engineer do some thorough debugging which reveals not so thorough technical decisions behind the product. You cannot hide  it with closed source. And who would want to work on a team that produced this? I hope this forum exists because you sincerely desire to hear from the users rather than to just say you have a forum, and somebody at Garmin will do something to improve this situation.

 

  • Also on Ubuntu 20.04 LT3 I get the segmentation fault after logging in, on my main PC. Strangely enough on my laptop, which I have upgraded a few days ago from Ubuntu 20.04 LT1 to Ubuntu 20.04 LT3, this error doesn't occur.

    For both installs I have added libwebkitgtk-1.0-0 after adding deb cz.archive.ubuntu.com/ubuntu bionic main universe to sources.list

    By the way, I see another bug filed with the same error: forums.garmin.com/.../bug-sdk-manager-4-0-6-segfaults-on-ubuntu-18-while-logging-in

  • I also tested it on 20.04 Linode instance using SSH tunnel for X to Ubuntu 18. Also had to add the extra source like yours to get libwebkitgtk-1.0-0 with the same results. This begs the question that I hope someone at Garmin can answer. What was the QA process before this release? Obviously someone dropped the ball big time. I really hope we can have someone honestly admit they messed up and state a plan going forward in the future on this to do a better job supporting Linux.

  • Somewhere, I forget where, it says what version of Linux is qualified to work with CIQ.  Yes, the version is old, but with the number of Garmin CIQ folks (there aren't many), their time is best spent with Windows and Apple  Try using a windows emulator.

  • This is probably the case for older versions, but with 4.0.6 on Ubuntu 16 we get this:

    bin/sdkmanager: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_4' not found (required by bin/sdkmanag
    er)
    bin/sdkmanager: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by bin/sdkmanager)
    bin/sdkmanager: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by bin/sdkman
    ager)

    so the supplied binary is linked against something newer than Ubuntu 16. But it crashes on login on Ubuntu 18. 

  • I understand being short on developers. What I do not understand is acting like you care about working with the community, but not actually working with it. If they do not have the resources to maintain functional Linux CIQ tools, just open the source, and make it community supported. Instead what they do is move to a new version that does not work while removing the download links for the old versions that did work. If anybody from Garmin is listening, I would be happy to have a meeting with your management and share my ideas of how to make the Linux support better and earn respect of the Linux community.

  • So I thought maybe I could trick the system and get the old sdk manager to work. I found a saved older version and ran it. It was "smart" enough to upgrade itself to - guess what - the new version that crashes :-)  Who needs to watch comedy shows when you can just try to install Garmin Connect IQ SDK manager :-)

    But seriously speaking, as far as this product goes, I am starting to see a persistent pattern of fundamentally bad design decisions on the technical side. On the community interaction side, I see a pattern of users reporting problems, and the company largely ignoring them. There must be at least a few people inside Garmin that are not happy with those patterns and would like to change them. If you get to read this message, please tell us what we as users can do to give you some ammunition to make this change happen. Can we write something that you can take to a meeting with some important decision makers?

  • But seriously speaking, as far as this product goes, I am starting to see a persistent pattern of fundamentally bad design decisions on the technical side.

    Can't argue with you there. I feel like the fairly recent choice of this forum platform itself is a microcosm of all these issues: it's got bugs, quirks, poor usability on mobile. poor usability for long threads, poor usability overall, it still (*) has issues rejecting posts containing certain code, etc. -- I'm guessing many of the problems with the forums will never be solved. Garmin didn't write this platform, but they chose it.

    (*) I say "still" because the previous platform had a similar problem, although to be fair it was much worse.

    Meanwhile most companies which still have community forums are using something modern like Discourse or NodeBB (neither of which are perfect, but they're miles ahead of this platform.)

    It makes me sad because I'm actually a Garmin fan - but they have a really bad rep for software. Others will point to the outdated design and poor usability of Garmin Connect, for example. It's too bad bc Garmin Connect gives me all the data I want (especially the web app), but not in a way that's at all fun to use. (A great counterexample, IMO, is the Stryd app -- there's a ton of data and functionality, but the design is miles ahead of GC.)

    On a positive note, recently they've shifted from Eclipse to VS Code, and introduced type checking to Monkey C. I don't know if that will be enough to attract devs to the platform. Another complaint I see elsewhere (like Reddit) is that most of the apps in the store are amateur / hobbyist efforts. Nobody I run with cares about Connect IQ apps (other than preloaded apps like Spotify, and maybe the occasional watchface here and there.)

  • I use an awful workaround now; I copy the contents of the .Garmin directory of my home directory on my laptop to the same directory on my PC (excluding the 2 files that are already in there). Not pretty but it does the job and everything works

  • I filed that one after this post was originally marked as spam. I had to appeal it to make it go through. Can you do

    ldd bin/sdkmanager | grep gtk | awk '{print $3}' | xargs ls -l

    on your laptop where it works, and paste the output here?

    On my system where it segfaults the output is:

    lrwxrwxrwx 1 root root 27 Jun  5 20:18 /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 -> libgtk-x11-2.0.so.0.2400.32
    lrwxrwxrwx 1 root root 35 Nov  7  2017 /usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-1.0.so.0 -> libjavascriptcoregtk-1.0.so.0.16.19
    lrwxrwxrwx 1 root root 27 Nov  7  2017 /usr/lib/x86_64-linux-gnu/libwebkitgtk-1.0.so.0 -> libwebkitgtk-1.0.so.0.22.17