Bug 353965 - ktimetracker hits addCmcLineOptions() assertion
Summary: ktimetracker hits addCmcLineOptions() assertion
Status: REOPENED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (show other bugs)
Version: Git (master)
Platform: Compiled Sources macOS
: NOR normal
Target Milestone: ---
Assignee: Zoltan Gyarmati
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-16 15:38 UTC by RJVB
Modified: 2019-11-19 03:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2015-10-16 15:38:19 UTC
KTimeTracker (git v4.14.10-14-g58c6ada) has developed a new issue on OS X. It aborts because an ASSERT in KCkdLineArgs::addCmdLineOptions() is hit:

   Q_ASSERT( s->parsed == false ); // You must add _ALL_ cmd line options
                                   // before accessing the arguments!

This was not the case with ktimetracker from KDE PIM 4.13.3 which I ran until recently.

Backtrace:
 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
 0   libsystem_kernel.dylib        	0x00007fff92a46866 __pthread_kill + 10
 1   libsystem_pthread.dylib       	0x00007fff8d2c535c pthread_kill + 92
 2   libsystem_c.dylib             	0x00007fff91a78b1a abort + 125
 3   QtCore                        	0x0000000104a09bdc qt_message_output(QtMsgType, char const*) + 316
 4   QtCore                        	0x0000000104a0afaa qt_message(QtMsgType, char const*, __va_list_tag*) + 506
 5   QtCore                        	0x0000000104a0964f qFatal(char const*, ...) + 159
 6   libkdecore.5.dylib            	0x00000001046098cf KCmdLineArgs::addCmdLineOptions(KCmdLineOptions const&, KLocalizedString const&, QByteArray const&, QByteArray const&) + 2079
 7   libkdeui.5.dylib              	0x0000000103185551 KUniqueApplication::addCmdLineOptions() + 337
 8   libkdeui.5.dylib              	0x0000000103185733 KUniqueApplication::start(QFlags<KUniqueApplication::StartFlag>) + 67
 9   libkdeui.5.dylib              	0x00000001031856e8 KUniqueApplication::start() + 24
 10                                	0x00000001024816aa main + 4538 (main.cpp:127)
 11  libdyld.dylib                 	0x00007fff8ddb45fd start + 1


Reproducible: Always

Steps to Reproduce:
1. State ktimetracker


Actual Results:  
aborts with the message

ASSERT: "s->parsed == false" in file kdelibs4-4.14.git/kdecore/kernel/kcmdlineargs.cpp, line 528



Expected Results:  
app starts correctly

as far as I can tell, no additional CmdLineOptions are injected on OS X.

I have tried removing the unique application check, but the abort remains. When I add an explicit KCmdLineArgs::reset() followed by addCmdLineOptions(options) before the unique app check, another assert is hit instead.

What does allow the application to start correctly is removing all the checks that can set `konsolemode=true`, and moving the `KCmdLineArgs *args` declaration to after the declaration of `KUniqueApplication myApp`.
Comment 1 Andrew Crouthamel 2018-09-04 18:53:15 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I will be closing this bug.