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

Add checks for identifiers #159

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zeule
Copy link

@zeule zeule commented Jun 20, 2024

Adds an option and test for identifier tokens.

Closes #56.

@zeule zeule force-pushed the feature/check-identifiers branch from 451f7b6 to 16dd93f Compare June 20, 2024 07:57
@zeule zeule force-pushed the feature/check-identifiers branch from 16dd93f to 9182022 Compare June 20, 2024 12:47
In preparation to add CheckIndentifiers, this mode needs to be removed.
@zeule zeule force-pushed the feature/check-identifiers branch from 9182022 to 06bf506 Compare June 20, 2024 12:49
@zeule zeule marked this pull request as ready for review June 20, 2024 12:49
@zeule
Copy link
Author

zeule commented Jun 28, 2024

With some projects it crashes on loading:

ASSERT: "m_isLocked" in file /usr/include/qt6/QtCore/qmutex.h, line 249

#0  0x00007ffa9e6cf47c in ??? () at /usr/lib64/libc.so.6
#1  0x00007ffa9e6786b6 in raise () at /usr/lib64/libc.so.6
#2  0x00007ffa9e6608ba in abort () at /usr/lib64/libc.so.6
#3  0x00007ffa9ecc1f56 in qAbort() () at /usr/lib64/libQt6Core.so.6
#4  0x00007ffa9ef82990 in qt_message(QtMsgType, QMessageLogContext const&, char const*, __va_list_tag*) () at /usr/lib64/libQt6Core.so.6
#5  0x00007ffa9ecc2b3d in QMessageLogger::fatal(char const*, ...) const () at /usr/lib64/libQt6Core.so.6
#6  0x00007ffa9ecbd7b3 in qt_assert(char const*, char const*, int) () at /usr/lib64/libQt6Core.so.6
#7  0x00007ffa65d0a1fa in QMutexLocker<QMutex>::unlock (this=0x7ffc2e168870) at /usr/include/qt6/QtCore/qmutex.h:249
#8  0x00007ffa65d2a78d in SpellChecker::SpellCheckerCore::futureFinished (this=0x565272740890) at /home/eugene/develop/src/alien/SpellChecker-Plugin/src/spellcheckercore.cpp:443
#9  0x00007ffa65d270ae in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (SpellChecker::SpellCheckerCore::*)()>::call(void (SpellChecker::SpellCheckerCore::*)(), SpellChecker::SpellCheckerCore*, void**)
    (f=(void (SpellChecker::SpellCheckerCore::*)(class SpellChecker::SpellCheckerCore * const)) 0x7ffa65d2a450 <SpellChecker::SpellCheckerCore::futureFinished()>, o=0x565272740890, arg=0x5652759ecf98) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:145
#10 0x00007ffa65d26178 in QtPrivate::FunctionPointer<void (SpellChecker::SpellCheckerCore::*)()>::call<QtPrivate::List<>, void>(void (SpellChecker::SpellCheckerCore::*)(), SpellChecker::SpellCheckerCore*, void**)
    (f=(void (SpellChecker::SpellCheckerCore::*)(class SpellChecker::SpellCheckerCore * const)) 0x7ffa65d2a450 <SpellChecker::SpellCheckerCore::futureFinished()>, o=0x565272740890, arg=0x5652759ecf98) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:182
#11 0x00007ffa65d254f1 in QtPrivate::QCallableObject<void (SpellChecker::SpellCheckerCore::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
    (which=1, this_=0x565275a425c0, r=0x565272740890, a=0x5652759ecf98, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:553
#12 0x00007ffa9ee8b25b in QObject::event(QEvent*) () at /usr/lib64/libQt6Core.so.6
#13 0x00007ffaa012d679 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt6Widgets.so.6
#14 0x00007ffa9ef04c98 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt6Core.so.6
#15 0x00007ffa9ef2a7ae in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib64/libQt6Core.so.6
#16 0x00007ffa9ecc8a77 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /usr/lib64/libQt6Core.so.6
#17 0x00007ffa9db0e6fb in g_main_dispatch () at /usr/lib64/libglib-2.0.so.0
#18 0x00007ffa9db11a67 in g_main_context_iterate_unlocked.isra () at /usr/lib64/libglib-2.0.so.0
#19 0x00007ffa9db120c0 in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#20 0x00007ffa9ecc6c23 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt6Core.so.6
#21 0x00007ffa9ef2f47a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt6Core.so.6
#22 0x00007ffa9ef2f615 in QCoreApplication::exec() () at /usr/lib64/libQt6Core.so.6
#23 0x000056523ff3581c in main ()

@CJCombrink
Copy link
Owner

Does it also crash on the same projects with the main branch?

@zeule
Copy link
Author

zeule commented Jun 28, 2024

No, it does not. But there are not many comments in the project that makes it crash.

@zeule
Copy link
Author

zeule commented Jun 28, 2024

Looked into the code to find and I don't understand the logic there. Here is the simplified fragment:

QMutexLocker locker( &d->futureMutex );
...
if (/*condition*/) { // (1)
  ...
  locker.unlock(); // (2)
  ...
}
locker.unlock() // (3)

Why is it manually unlocked at (3)? At (2)? And of course now it it obvious why is assert triggered when the condition at (1) is true. I'd remove both manual unlock() calls?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to check names of variables, functions,...
2 participants