Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting seg fault from valgrind #83

Open
I-Am-D-B opened this issue May 5, 2023 · 4 comments
Open

Getting seg fault from valgrind #83

I-Am-D-B opened this issue May 5, 2023 · 4 comments
Labels
13.0 bug Something isn't working duplicate This issue or pull request already exists

Comments

@I-Am-D-B
Copy link

I-Am-D-B commented May 5, 2023

doug:code doug$ /usr/local/Cellar/valgrind/HEAD-73c9e41/bin/valgrind --smc-check=stack --tool=callgrind --instr-atstart=no --callgrind-out-file=/Users/doug/Qt/Examples/Qt-5.15.2/gui/build-analogclock-Desktop_Qt_5_15_2_clang_64bit-Debug/analogclock.app/Contents/MacOS/callgrind.out.f107 --dsymutil=yes /Users/doug/Qt/Examples/Qt-5.15.2/gui/build-analogclock-Desktop_Qt_5_15_2_clang_64bit-Debug/analogclock.app/Contents/MacOS/analogclock
==39218== Callgrind, a call-graph generating cache profiler
==39218== Copyright (C) 2002-2017, and GNU GPL'd, by Josef Weidendorfer et al.
==39218== Using Valgrind-3.21.0.GIT-lbmacos and LibVEX; rerun with -h for copyright info
==39218== Command: /Users/doug/Qt/Examples/Qt-5.15.2/gui/build-analogclock-Desktop_Qt_5_15_2_clang_64bit-Debug/analogclock.app/Contents/MacOS/analogclock
==39218==
==39218== For interactive control, run 'callgrind_control -h'.
--39218-- UNKNOWN mach_msg2 unhandled MACH64_MSG_VECTOR option
--39218-- UNKNOWN mach_msg2 unhandled MACH64_MSG_VECTOR option (repeated 2 times)
UNKNOWN workq_ops option 1024
==39218==
==39218== Process terminating with default action of signal 11 (SIGSEGV)
==39218== Access not within mapped region at address 0x3C0
==39218== at 0x7FF8109336BE: _dispatch_worker_thread2 (in /usr/lib/system/libdispatch.dylib)
==39218== by 0x7FF810AC0C0E: ???
==39218== by 0x7FF810ABFBBE: ???
==39218== If you believe this happened as a result of a stack
==39218== overflow in your program's main thread (unlikely but
==39218== possible), you can try to increase the size of the
==39218== main thread stack using the --main-stacksize= flag.
==39218== The main thread stack size used in this run was 8388608.
==39218==
==39218== Events : Ir
==39218== Collected : 0
==39218==
==39218== I refs: 0
Segmentation fault: 11

I brew installed valgrind-macos with:

brew install --HEAD LouisBrunner/valgrind/valgrind

and pointed QtCreator at it. I'm getting this error on one of their toy demo programs (analogclock). I also get it when I run valgrind on the command line:

'/usr/local/Cellar/valgrind/HEAD-73c9e41/bin/valgrind --smc-check=stack --tool=callgrind --instr-atstart=no --callgrind-out-file=/Users/doug/Qt/Examples/Qt-5.15.2/gui/build-analogclock-Desktop_Qt_5_15_2_clang_64bit-Debug/analogclock.app/Contents/MacOS/callgrind.out.f107 --dsymutil=yes /Users/doug/Qt/Examples/Qt-5.15.2/gui/build-analogclock-Desktop_Qt_5_15_2_clang_64bit-Debug/analogclock.app/Contents/MacOS/analogclock'

This is the first time I've tried to use valgrind/callgrind, but I also just updated to Ventura 13.3.1 (22E261) and XCode 14.3 (14E222b). Am I doing something wrong, or is there some sort of compatibilty issue that hasn't been caught up with?

@I-Am-D-B
Copy link
Author

I-Am-D-B commented May 6, 2023

Slight correction -- this is Ventura 13.3.1 (a), the "Rapid Security Response" update.

Also, looks like the kernel version xnu-8796.101.5~3 doesn't have source out.

$ uname -v
Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64

@LouisBrunner
Copy link
Owner

Hi @I-Am-D-B,

Thanks for the report, note that most UI executables don't work due to wqthread being unsupported for a few years (#4). I am not sure if that's the case for Qt however.

Is there any way you could make a minimal reproducible example so I can try it out?

@I-Am-D-B
Copy link
Author

I-Am-D-B commented May 6, 2023

Hmm, not sure how to give you a minimal example for a Qt program. Thus far I've been doing everything in this project since I came onto it in Qt Creator.

On another note, tried to build the wqthread_fix branch and getting a seg fault (bam out of the gate) from autom4te...

Sigh.

Lemme see if I can figure out how to break it the same way in a way I can communicate.

@LouisBrunner
Copy link
Owner

Hmm, not sure how to give you a minimal example for a Qt program. Thus far I've been doing everything in this project since I came onto it in Qt Creator.

Just a small app, for example showing a QMainWindow with a label inside, without using any of Qt fancy abstractions and UI generation. It would help me if I want to build it locally and try to see what the issue is.

On another note, tried to build the wqthread_fix branch and getting a seg fault (bam out of the gate) from autom4te...

Yeah, that branch is very outdated (it's been a few years since I last tried to fix it).

@LouisBrunner LouisBrunner added bug Something isn't working duplicate This issue or pull request already exists 13.0 labels Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
13.0 bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants