Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#68413 closed defect (fixed)

x2goclient - segfault - how to debug?

Reported by: ashterenli Owned by: Ionic (Mihai Moldovan)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: x2goclient

Description

% xcodebuild -version
Xcode 15.0
Build version 15A240d

After rebuilding all ports following update to Sonoma 14.0, I get:

% x2goclient 
x2go-INFO-1> "Starting X2Go Client 4.1.2.2..."
x2go-WARNING-1> English language requested, not loading translator.
x2go-WARNING-1> English language requested, not loading translator.
zsh: segmentation fault  x2goclient

Can anybody reproduce?

How to debug this?

Attachments (2)

Portfile (2.3 KB) - added by kencu (Ken) 13 months ago.
qt5 move WIP Portfile - incomplete but gets to the build
main.log (842.8 KB) - added by kencu (Ken) 13 months ago.
build error qt5 with bind issue

Download all attachments as: .zip

Change History (14)

comment:1 Changed 13 months ago by jmroot (Joshua Root)

Owner: set to Ionic
Port: x2goclient added
Status: newassigned

There should be a crash log in ~/Library/Logs/DiagnosticReports/ or /Library/Logs/DiagnosticReports/, and you may also be able to see them in the Console app.

comment:2 Changed 13 months ago by ashterenli

Thank you for the hint.

This is what I get:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               x2goclient [57237]
Path:                  /opt/local/bin/x2goclient
Identifier:            x2goclient
Version:               4.1 (4.1.2.2)
Code Type:             X86-64 (Translated)
Parent Process:        zsh [48549]
Responsible:           Terminal [7371]
User ID:               501

Date/Time:             2023-10-11 09:41:10.7634 +0100
OS Version:            macOS 14.0 (23A344)
Report Version:        12
Anonymous UUID:        282BD436-262C-0769-7364-8BB7499AB01B

Sleep/Wake UUID:       74534A1A-43A8-4D97-B865-C83ECFD9E0B5

Time Awake Since Boot: 280000 seconds
Time Since Wake:       2993 seconds

System Integrity Protection: enabled

Notes:
PC register does not match crashing frame (0x0 vs 0x10CE3CF5D)

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x000000000000000c
Exception Codes:       0x0000000000000001, 0x000000000000000c

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [57237]

VM Region Info: 0xc is not in any region.  Bytes before following region: 140723160432628
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      mapped file              7ffca9fd4000-7ffccf6f4000 [599.1M] r-x/r-x SM=COW  ...t_id=46781fc1

Error Formulating Crash Report:
PC register does not match crashing frame (0x0 vs 0x10CE3CF5D)

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   QtGui                         	       0x10ce3cf5d QWidgetPrivate::setStyle_helper(QStyle*, bool, bool) + 493
1   QtGui                         	       0x10ce3d19a QWidget::setStyle(QStyle*) + 314
2   x2goclient                    	       0x10248d588 ONMainWindow::initPassDlg() + 200
3   x2goclient                    	       0x102486236 ONMainWindow::ONMainWindow(QWidget*) + 9030
4   x2goclient                    	       0x102540014 x2goMain + 740
5   x2goclient                    	       0x1025665b9 main + 1337
6   dyld                          	       0x2027f53a6 start + 1942

Thread 1:: com.apple.rosetta.exceptionserver
0   runtime                       	    0x7ff7ffc3d2b4 0x7ff7ffc39000 + 17076

Thread 2:
0   runtime                       	    0x7ff7ffc5b94c 0x7ff7ffc39000 + 141644

Thread 3:
0   runtime                       	    0x7ff7ffc5b94c 0x7ff7ffc39000 + 141644

Thread 4:
0   runtime                       	    0x7ff7ffc5b94c 0x7ff7ffc39000 + 141644


Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000600001c051c0  rcx: 0x0000000000000000  rdx: 0x0000000000000000
  rdi: 0x00006000009206e0  rsi: 0x00006000009206e0  rbp: 0x0000000308d531b0  rsp: 0x0000000308d53140
   r8: 0x0000000000000003   r9: 0x0000000000000174  r10: 0x0000000000000020  r11: 0x000060000093ae40
  r12: 0x0000000000000000  r13: 0x00007fabf8f4a410  r14: 0x0000000000000000  r15: 0x0000000000000000
  rip: <unavailable>       rfl: 0x0000000000000247
 tmp0: 0x000000010ce3cf58 tmp1: 0x000000010ce3cf58 tmp2: 0x000000010d9399c4


Binary Images:
       0x2027ef000 -        0x20288efff dyld (*) <1289b60a-4980-342d-b1a4-250bbee392f1> /usr/lib/dyld
       0x10b09d000 -        0x10b0acfff libobjc-trampolines.dylib (*) <71d6744a-feb5-33e6-be9b-3a2258cf6f23> /usr/lib/libobjc-trampolines.dylib
       0x10af28000 -        0x10af3ffff com.apple.security.csparser (3.0) <ae6cfd3f-05af-39ec-8a56-bee9abacb0f5> /System/Library/Frameworks/Security.framework/Versions/A/PlugIns/csparser.bundle/Contents/MacOS/csparser
       0x10ba9d000 -        0x10bdacfff libcrypto.3.dylib (*) <0aba7d7e-6ef5-3479-bb1e-2d6218280b1d> /opt/local/libexec/*/libcrypto.3.dylib
       0x10b458000 -        0x10b4b3fff libssl.3.dylib (*) <37c9fab9-9127-346f-8805-bedbb14e86e4> /opt/local/libexec/*/libssl.3.dylib
       0x10b237000 -        0x10b24afff libz.1.3.dylib (*) <cb2be9b6-0169-383e-8b09-95f61ab77539> /opt/local/lib/libz.1.3.dylib
       0x10b594000 -        0x10b5dffff libssh.4.9.5.dylib (*) <80c43d72-d359-37ec-9786-f5bd28303a09> /opt/local/lib/libssh.4.9.5.dylib
       0x10b341000 -        0x10b37cfff QtSvg (*) <1c91034e-841f-38af-b231-150e9bc32d14> /opt/local/libexec/*/QtSvg.framework/Versions/4/QtSvg
       0x10cd6a000 -        0x10d54dfff QtGui (*) <35f5ece1-28ba-3a2d-a0f2-73a7a770c270> /opt/local/libexec/*/QtGui.framework/Versions/4/QtGui
       0x10c2c7000 -        0x10c50afff QtCore (*) <0429bc1b-f221-30fc-9b48-1598fe7d6f70> /opt/local/libexec/*/QtCore.framework/Versions/4/QtCore
       0x10c8a6000 -        0x10c989fff QtNetwork (*) <f4745732-6a46-327a-9703-c16e85255021> /opt/local/libexec/*/QtNetwork.framework/Versions/4/QtNetwork
       0x10b71d000 -        0x10b750fff libgssapi_krb5.2.2.dylib (*) <c5799b0a-c913-38fb-b853-ca1f688ffce1> /opt/local/lib/libgssapi_krb5.2.2.dylib
       0x10cb7e000 -        0x10cbfdfff libkrb5.3.3.dylib (*) <a4c241a6-922b-30f5-b8dd-b638ef81d7be> /opt/local/lib/libkrb5.3.3.dylib
       0x10b201000 -        0x10b20cfff libk5crypto.3.1.dylib (*) <f8a343f4-2331-33cb-bb56-1be64ea3187a> /opt/local/lib/libk5crypto.3.1.dylib
       0x10b28d000 -        0x10b290fff libcom_err.1.1.dylib (*) <a0ed7a94-a1f9-3453-bb5c-b464ebde05b7> /opt/local/lib/libcom_err.1.1.dylib
       0x10b2d2000 -        0x10b2d9fff libkrb5support.1.1.dylib (*) <53eff890-08f7-3bb6-b007-bc3fb1a9926b> /opt/local/lib/libkrb5support.1.1.dylib
       0x10b2a6000 -        0x10b2b1fff libintl.8.dylib (*) <79b4d4e3-ee29-37fe-9f2c-52e2352b3339> /opt/local/lib/libintl.8.dylib
       0x10e3d3000 -        0x10e4d6fff libiconv.2.dylib (*) <b9d201c0-9016-3263-a13f-b53932a23e2c> /opt/local/lib/libiconv.2.dylib
       0x10b7d2000 -        0x10b7f5fff libpng16.16.dylib (*) <96cad464-a66b-3f6c-a668-0b88ecc37532> /opt/local/lib/libpng16.16.dylib
    0x7ff7ffc39000 -     0x7ff7ffc68fff runtime (*) <31538c50-034b-3469-ae9f-0fffbd6f4de1> /usr/libexec/rosetta/runtime
       0x10a8b2000 -        0x10a905fff libRosettaRuntime (*) <29e3f175-b88d-3239-bd82-326cde98f820> /Library/Apple/*/libRosettaRuntime
       0x10245d000 -        0x10267cfff x2goclient (4.1) <6c9b526d-be29-3d12-8d26-c913d6e5793f> /Applications/MacPorts/x2goclient.app/Contents/MacOS/x2goclient
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=500.2M resident=0K(0%) swapped_out_or_unallocated=500.2M(100%)
Writable regions: Total=971.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=971.6M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                   256K        1 
ColorSync                          212K       25 
CoreGraphics                         8K        2 
Foundation                          16K        1 
Kernel Alloc Once                    8K        1 
MALLOC                           809.2M       29 
MALLOC guard page                  192K       12 
Rosetta Arena                     4096K        2 
Rosetta Generic                    972K      240 
Rosetta IndirectBranch             256K        1 
Rosetta JIT                      128.0M        1 
Rosetta Return Stack                80K        8 
Rosetta Thread Context              80K        8 
STACK GUARD                         12K        3 
Stack                             9772K        4 
Stack Guard                       56.0M        1 
VM_ALLOCATE                       11.3M       21 
VM_ALLOCATE (reserved)              40K        7         reserved VM address space (unallocated)
__CTF                               824        1 
__DATA                            18.4M      368 
__DATA_CONST                      19.1M      234 
__DATA_DIRTY                       808K      110 
__FONT_DATA                        2352        1 
__LINKEDIT                       182.5M       27 
__OBJC_RO                         70.5M        1 
__OBJC_RW                         2151K        2 
__TEXT                           317.7M      391 
dyld private memory                260K        2 
mapped file                        7.3G      582 
shared memory                      804K       15 
unshared pmap                     7840K        4 
===========                     =======  ======= 
TOTAL                              8.9G     2105 
TOTAL, minus reserved VM space     8.9G     2105 


comment:3 Changed 13 months ago by kencu (Ken)

looks like Ionic is still active on this project upstream, but on debian now.

There’s a new version out, for one thing.

There’s also a qt5 version, that should be used on newer macos systems that support it.

https://code.x2go.org/gitweb?p=x2goclient.git;a=summary

comment:4 Changed 13 months ago by Ionic (Mihai Moldovan)

Yeah, X2Go Client still using Qt 4 isn't... what it should be doing on macOS. On newer systems, Qt 4 itself won't work anyway.

Getting everything ready for Qt 5 is a huge project, though (mostly due to the way we bundle binary builds), I probably should just update the Portfile to use Qt 5, but my macOS machine is old, I haven't updated it in 3 years, it's still on 10.9, meh.

There were talks about a potential customer sponsoring all the work/time required to get the macOS stuff back into good quality, but so far that has only been talk for next year.

comment:5 Changed 13 months ago by kencu (Ken)

I am working on the qt5 move now.

The build is failing with this (arm64 mac, sonoma, Xcode 15):

src/sshprocess.cpp:143:71: error: invalid operands to binary expression ('__bind<unsigned int &, sockaddr *, unsigned long>' and 'int')
    if (bind(serverSocket,(struct sockaddr*) &address,sizeof(address))!=0)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ~
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qchar.h:69:30: note: candidate function not viable: no known conversion from '__bind<unsigned int &, sockaddr *, unsigned long>' to 'QLatin1Char' for 1st argument
Q_DECL_CONSTEXPR inline bool operator!=(QLatin1Char lhs, char rhs) noexcept { return lhs.toLatin1() != rhs; }
                             ^
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qchar.h:651:30: note: candidate function not viable: no known conversion from '__bind<unsigned int &, sockaddr *, unsigned long>' to 'QChar' for 1st argument
Q_DECL_CONSTEXPR inline bool operator!=(QChar lhs, std::nullptr_t) noexcept { return !operator==(lhs, nullptr); }
                             ^
/opt/local/libexec/qt5/lib/QtCore.framework/Headers/qbytearray.h:692:13: note: candidate function not viable: no known conversion from '__bind<unsigned int &, sockaddr *, unsigned long>' to 'const QByteArray' for 1st argument

any ideas about that one? You're the C++ guru around here!

comment:6 Changed 13 months ago by kencu (Ken)

(qt4 is still working on MacPorts as x86_64 on systems right up to Sonoma, by the way -- under Rosetta on arm macs... magical!)

comment:7 Changed 13 months ago by kencu (Ken)

I have these qt5 ports installed so far:

% port -v installed | grep qt5
  qt5-qtbase @5.15.11_0+openssl (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-10-11T10:19:53-0700'
  qt5-qtdeclarative @5.15.11_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-10-11T11:06:42-0700'
  qt5-qtsvg @5.15.11_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-10-11T10:25:37-0700'
  qt5-qttools @5.15.11_0 (active) requested_variants='' platform='darwin 23' archs='arm64' date='2023-10-11T11:08:33-0700'

and I'll attach the WIP portfile (heavily cleaned up) and the main.log in case you're curious.

Changed 13 months ago by kencu (Ken)

Attachment: Portfile added

qt5 move WIP Portfile - incomplete but gets to the build

Changed 13 months ago by kencu (Ken)

Attachment: main.log added

build error qt5 with bind issue

comment:8 Changed 13 months ago by Ionic (Mihai Moldovan)

Ugh, no, I don't want stuff to be built in the top-level directory, that's what the client_build dir is for. Otherwise, the top-level Makefile is getting overwritten, which is exactly what this is trying to avoid.

For the error: two approaches:

  • Try patching the src/sshprocess.cpp file and changing bind to ::bind on this line (only).
  • Alternatively, we might (additionally) need #include <sys/socket.h> in the non-Windows-section on line 29, but it would be really weird if netinet/tcp.h wouldn't also include sys/socket.h.

comment:9 in reply to:  8 Changed 13 months ago by kencu (Ken)

Replying to Ionic:

Ugh, no, I don't want stuff to be built in the top-level directory, that's what the client_build dir is for. Otherwise, the top-level Makefile is getting overwritten, which is exactly what this is trying to avoid.

The qmake5 PortGroup works differently than qmake (4) worked. The cache file is not found with your old build method without surgery that I was avoiding to get to the build...

--->  Configuring x2goclient
Error: Failed to configure x2goclient: couldn't open "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_aqua_x2goclient/x2goclient/work/x2goclient-4.1.2.3/client_build/.qmake.cache": no such file or directory
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_aqua_x2goclient/x2goclient/main.log for details.

For the error: two approaches:

  • Try patching the src/sshprocess.cpp file and changing bind to ::bind on this line (only).

That worked, thanks!

comment:10 Changed 13 months ago by kencu (Ken)

Anyone interested can try this qt5 version I put together

https://github.com/macports/macports-ports/pull/20916

it builds and opens and doesn't segfault, on arm64 Sonoma at least. I have no way to actually test the use of it though.

comment:11 Changed 13 months ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In 13e224b73e2e0b6c256ac650e750004e0cfb19af/macports-ports (master):

x2goclient: update to 4.1.2.3 and qt5

closes: #68413

comment:12 Changed 13 months ago by ashterenli

That was super fast. I confirm x2goclient works now. Many thanks!

Note: See TracTickets for help on using tickets.