By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 1005

Summary: [Regression] DrKonqi fails to create backtraces
Product: TDE Reporter: Darrell <darrella>
Component: tdebaseAssignee: Timothy Pearson <kb9vqf>
Status: RESOLVED FIXED    
Severity: blocker CC: bugwatch, darrella
Priority: P1    
Version: R14.0.0 [Trinity]   
Hardware: Other   
OS: Other   
Compiler Version: TDE Version String:
Application Version: Application Name:

Description Darrell 2012-05-21 13:21:47 CDT
Despite building packages with the debugging symbols, DrKonqi will not create a backtrace. The result:

"This backtrace appears to be of no use.
This is probably because your packages are built in a way which prevents creation of proper backtraces, or the stack frame was seriously corrupted in the crash."

Running crashtest (from konsole) is the simplest way to trigger DrKonqi. That test results in the same message and no backtrace. The crashtest program was created specifically to test DrKonqi.

My build scripts all use --enable-debug=full for automake and -ggdb for cmake. The build logs show that the packages are compiling with those flags and the increased package sizes are further evidence.

The following method does create a backtrace:

gdb -- arg konqueror
run
bt

The following test reveals the Trinity debugging symbols are available:

Start a TDE process, noting the PID
Run gdb
attach <pid>
Comment 1 Darrell 2012-06-07 21:58:20 CDT
Modifying the report to a regression for easier identification.
Comment 2 Timothy Pearson 2012-06-07 23:54:07 CDT
Issue trace to this commit:
http://git.trinitydesktop.org/cgit/tdelibs/commit/tdecore/kcrash.cpp?id=77f4891c222583c8deffc34732ccf325bac9e11b

Not sure what "build warning" was fixed with that commit, as no warnings were shown when I compiled the fixed file.  I suppose a gcc glitch may have incorrectly shown a warning at some point.

Fixed in GIT hash 0dcda4b.

Thanks for reporting!
Comment 3 Darrell 2012-06-09 11:15:44 CDT
Am I doing something wrong? Running crashtest from konsole here results in no backtrace. Dr. Konqi opens but no backtrace. Does crashtest work on your system?
Comment 4 Timothy Pearson 2012-06-09 13:42:26 CDT
Have you rebuilt and reinstalled tdelibs?  crashtest works here with the patch from GIT.
Comment 5 Darrell 2012-06-09 21:31:46 CDT
Yes, rebuilt. Just to be sure, I rebuilt tdelibs and tdebase again in the last hour and verified tdelibs in my local GIT sources had the patch.

Running crashtest invokes Dr. Konqi but there is no backtrace. Just the same "This backtrace appears to be of no use...."

Package sizes are huge, therefore I presume the debugging symbols are being built and no stripped correctly. My build logs all show debugging enabled as well.

When I run crashtest in 3.5.10 I see the following:

[Thread debugging using libthread_db enabled]
[KCrash handler]
#5  0xb714d160 in KCmdLineArgs::arg(int) const () from /usr/lib/libkdecore.so.4
#6  0x08048f1e in ?? ()
#7  0x080490f9 in ?? ()
#8  0xb60b1b86 in __libc_start_main () from /lib/libc.so.6
#9  0x08048e11 in ?? ()
Comment 6 Darrell 2012-06-11 12:30:21 CDT
I befuddled by this. I'm building with debug support. Yet Dr. Konqi does not produce a backtrace when I run crashtest (works fine in 3.5.10). How do I methodically troubleshoot this?
Comment 7 Timothy Pearson 2012-06-11 12:49:29 CDT
One thing I can think of is that ptrace on my Ubuntu systems requires sudo access, so I am always prompted for sudo access before the backtrace is generated.  I wonder if the code that handles non-sudo backtraces is broken somehow.
Comment 8 Darrell 2012-06-11 14:24:28 CDT
Ah. Makes sense. The stock Slackware does not install ptrace. Let me run an experimental build by reversing the patch from GIT hash ad1a7141.
Comment 9 Darrell 2012-06-11 14:52:32 CDT
Bingo! Good thinking!

Reversing the patch from GIT hash ad1a7141 now produces a backtrace with crashtest and Dr. Konqi.
Comment 10 Timothy Pearson 2012-06-11 16:31:30 CDT
When TDE fails to generate a backtrace, do you see the tdesu prompt, or does it just fail silently?
Comment 11 Darrell 2012-06-11 17:00:45 CDT
There is no tdesu prompt. Note: On Slackware there should not be a tdesu prompt, therefore what I see in that respect is good.
Comment 12 Timothy Pearson 2012-06-11 17:13:04 CDT
(In reply to comment #11)
> There is no tdesu prompt. Note: On Slackware there should not be a tdesu
> prompt, therefore what I see in that respect is good.

So tdesu is not installed on your system?
Comment 13 Darrell 2012-06-11 17:28:44 CDT
Yes, tdesu is installed.

What I meant in my previous reply is that on Slackware, forcing users to use tdesu to produce a backtrace will be ill received. Slackware users expect to just produce a backtrace, just like the 3.5.10 days, and just like I can now do again by reversing the patch from GIT hash ad1a7141. I suspect users of other non sudo distros expect likewise. That was the point I was trying to make. :-)
Comment 14 Timothy Pearson 2012-06-11 17:45:09 CDT
(In reply to comment #13)
> Yes, tdesu is installed.
> 
> What I meant in my previous reply is that on Slackware, forcing users to use
> tdesu to produce a backtrace will be ill received. Slackware users expect to
> just produce a backtrace, just like the 3.5.10 days, and just like I can now do
> again by reversing the patch from GIT hash ad1a7141. I suspect users of other
> non sudo distros expect likewise. That was the point I was trying to make. :-)

I understand this. :-)  I am trying to figure out why/where drkonqui is failing, hence my questions.

Backtrace generation will likely require tdesu at some point in the future as more distributions and organizations adopt a stricter kernel/process security policy.  Ubuntu has already done this; the KDE 3.5.10 DrKonqui fails to generate backtraces on Ubuntu as a result.

I'll see what can be done to detect less-secure installations/distributions and bypass tdesu for them, but I don't know how to do this at the moment.
Comment 15 Darrell 2012-06-11 18:01:23 CDT
Okay.

I looked, but the code is too complicated for me to figure out. I wonder if this removed snippet is the culprit:

-  TQString str = m_krashconf->debuggerBatch();
-  m_krashconf->expandString(str, true, m_temp->name());

I could try restoring only those lines. I just hate these rebuilds. So much time to test simple changes....
Comment 16 Darrell 2012-06-11 18:17:30 CDT
Just thinking out loud: would a build option help? Such as -DWITH_DRKONQUI_SUDO? When set to ON the patch is applied and when set to OFF the old 3.5.10 code is used. Then add some ifdef statements....
Comment 17 Timothy Pearson 2012-06-11 20:52:01 CDT
(In reply to comment #15)
> Okay.
> 
> I looked, but the code is too complicated for me to figure out. I wonder if
> this removed snippet is the culprit:
> 
> -  TQString str = m_krashconf->debuggerBatch();
> -  m_krashconf->expandString(str, true, m_temp->name());
> 
> I could try restoring only those lines. I just hate these rebuilds. So much
> time to test simple changes....

Those lines are still present, just in a different location; see http://git.trinitydesktop.org/cgit/tdebase/tree/drkonqi/backtrace.cpp

I'm a bit befuddled by this; drkonqui should immediately attempt to execute the gdb batch command via tdesu.  Is there any possibility that tdesu execution is being blocked (tdesu is not on your $PATH, etc.)?
Comment 18 Timothy Pearson 2012-06-11 20:58:14 CDT
Hmm, it suddenly started failing here.  I'll see if I can track down the problem.
Comment 19 Timothy Pearson 2012-06-11 21:16:55 CDT
Apparently the tdesu arguments were not 100% compatible with the tdesudo arguments, so when I was testing with tdesudo it worked, whereas it failed with tdesu.

This has been fixed in GIT hash 59ee4f6.
Comment 20 Darrell 2012-06-11 21:58:09 CDT
I rebuilt and tested without the reversed patch. I can obtain a backtrace --- but only after being prompted to enter root's password. That won't go over well with users of non sudo distros. There has to be a way to not go through tdesu.... regardless of what Mr. Shuttleworth envisions for world peace and domination. :-)
Comment 21 Timothy Pearson 2012-06-12 02:01:07 CDT
(In reply to comment #20)
> I rebuilt and tested without the reversed patch. I can obtain a backtrace ---
> but only after being prompted to enter root's password. That won't go over well
> with users of non sudo distros. There has to be a way to not go through
> tdesu.... regardless of what Mr. Shuttleworth envisions for world peace and
> domination. :-)

OK, at least we know that works properly. :-)

I have committed a patch to GIT in hash 3046157 which looks at the yama ptrace setting in /proc/sys to determine if root access will be needed to generate the backtrace.  Backtrace generation will therefore fail if non-root ptrace has been disabled via some other method, but systems configured/patched that way should be rare enough in the wild as to be of little concern.
Comment 22 Darrell 2012-06-12 15:07:14 CDT
Latest patch is working here with no tdesu requirement.

All is well. Thank you and great work!