5,599,033 Members 31,957 Now Online
XDA Developers Android and Mobile Development Forum

Tutorial: How to properly post a bug

Tip us?
 
Indirect
Old
#1  
Recognized Contributor - OP
Thanks Meter 2940
Posts: 2,317
Join Date: Mar 2011
Location: Florida

 
DONATE TO ME
Default Tutorial: How to properly post a bug

Alright guys, I was on an irc channel when I considered posting this since it's rather important. There has been a lot of disappointing posts all over the forum with people complaining about bugs, while not providing any kind of information for the developers aside from "X doesn't work" or "I get random reboots".

Well, without the proper knowledge, how are we going to fix it? We don't know what kernel you may be running, what version number you're on, or any information that the system spits out to let you know there's an error. So, I decided to start this thread, to hopefully teach newbies how to give us (developers) proper knowledge when complaining about issues.

This thread will have 3 sections, Logcat (App / system debug log.), Dmesg (active kernel output) and last_ksmg (Typically if you get a random reboot or something of that sort {this is the same as dmesg except it gets the info from the last shutdown [like a kernel panic]})


Section 1: Logcat
This log should almost always be included just because it provides more info than just saying something doesn't work. It will essentially tell you which apps are crashing and why and it also gives output of what they're doing. (Your system is running through apps, the dialer, wireless radio's, etc are all ran through apps.) so, if something is general, like a system force close, please just include a logcat.

How to get a logcat:
Well, this is REALLY simple, all you need to do is just get adb up and running (google how to do that, I don't feel like writing a 'how to use adb' tutorial for everyone's phone.) and then type
Code:
adb logcat
then you just right click, select, and paste to the thread. It's really that simple!

Section 2: Dmesg

This is getting into issues such as wifi not working, sleep of death, etc. Basically, things that make us go "OH F***" when we use our devices. Note: You will need adb access for this to work, same as logcat.
What this will do is get us live kernel output so we can know things like "What driver is the kernel loading {or not loading for that matter}" and similar things. This is linux, so kernel output is important if a hardware aspect isn't working right.
How to get a dmesg:
This is simple as well, no matter what operating system you're on (mac, windows, linux) just type
Code:
adb shell dmesg > dmesg.txt
and then it will have written the output to a .txt file in your current directory. Either paste the contents to the thread, or attach it to your post.
You can also get the dmesg by using terminal emulator. Instead though, you dont type adb shell, you need to also include it to somewhere you will be able to save it. Like /sdcard so, the command goes
Code:
dmesg > /sdcard/dmesg.txt
Just get it off your sdcard and get the contents to the developer!

Section 3: last_kmsg
Ok, the last thing is last_kmsg. When android kernels crash, they right to last_kmsg so then you can find out what's going on. This is usually for issues such as random reboots and other various kernel panic symptoms. A kernel panic happens when the kernel tries to do something it can't. It doesn't mean wrong permissions, it could just have errored out on something and died which can cause a few things. Anyway, developers REALLY need this if debugging a kernel because it gives us a viable way to see WHAT it's trying to do instead of trying to guess what it is trying to do
How to get a last_kmsg:
This is super simple and the same on all phones no matter what, what you need is adb up and running (or terminal emulator) and either in adb shell, or terminal emulator just type
Code:
 cat /proc/last_kmsg > /sdcard/last_kmsg.txt
or you can do
Code:
 adb shell cat /proc/last_kmsg > kmsg.txt
and that will write it to your current working directory from cmd.

Hopefully, this way we developers can have our lives be a little bit easier and you can learn more about android.

I'm glad to have written this and devs, feel free to link to this guide as a "bug reporting FAQ"



My Google Plus account
My Twitter
Shiftless evo shift developer
Nook Tablet developer-found root (here)

Quote:
Without developers this place would not be called XDA-Developers but something else, e.g Mobile Phone User Support Services For Ungrateful Nerds.
Developed on the following devices: Evo View, Nook Tablet, Evo Shift, Nexus S 4G (private), Evo 4G (private), Mytouch 4g Slide, Evo LTE, HTC One (In Progress), Moto X
The Following 72 Users Say Thank You to Indirect For This Useful Post: [ Click to Expand ]
 
shabbypenguin
Old
#2  
shabbypenguin's Avatar
Recognized Developer
Thanks Meter 4421
Posts: 4,190
Join Date: May 2010

 
DONATE TO ME
HALP! I BRICKD MY FONE!!1!

I JAILBROKED IT LAST NIGHT AND NOW I NO GET SIGNEL!! PLASE HALP!!!1


but on a more serious note, good tut
If you feel as though my work is worth something, you can alwaysDonate
The Following 2 Users Say Thank You to shabbypenguin For This Useful Post: [ Click to Expand ]
 
Spiralzz
Old
(Last edited by Spiralzz; 17th April 2012 at 05:18 PM.)
#3  
Spiralzz's Avatar
Senior Member
Thanks Meter 324
Posts: 1,134
Join Date: Aug 2011
Location: Islamabad
Thanks dude!!! I was looking for some kind of guide. Only thing I still don't understand is when are we supposed to give dmesg and when do we give the logcat? I understand the last_kmsg is for kernel panics and random reboots, but the rest two are still ambiguous to me... Could you please explain the other two in a simpler way with an easy example for each?... Sorry.. I'm a noob... but am trying to learn these things..
 
Randomwalker
Old
#4  
Senior Member
Thanks Meter 61
Posts: 325
Join Date: Dec 2011
There also is this app called 'Bootlog Uptime' that tries to auto-detect a crash and subsequently exports the log to sdcard.
 
anshumandash
Old
#5  
anshumandash's Avatar
Senior Member
Thanks Meter 416
Posts: 1,294
Join Date: Mar 2011
Location: Bangalore

 
DONATE TO ME
When I get in to cmd in bootloader mode and type adb shell cat /proc/last_kmsg > kmsg.txt, I get a message Error: Device not found. I checked the ADB drivers, the are loading well. Am I doing something wrong?
The Following User Says Thank You to anshumandash For This Useful Post: [ Click to Expand ]
 
Indirect
Old
#6  
Recognized Contributor - OP
Thanks Meter 2940
Posts: 2,317
Join Date: Mar 2011
Location: Florida

 
DONATE TO ME
If you're in boot loader mode, that's not adb.

Sent from my Full Android on Crespo4G using xda premium



My Google Plus account
My Twitter
Shiftless evo shift developer
Nook Tablet developer-found root (here)

Quote:
Without developers this place would not be called XDA-Developers but something else, e.g Mobile Phone User Support Services For Ungrateful Nerds.
Developed on the following devices: Evo View, Nook Tablet, Evo Shift, Nexus S 4G (private), Evo 4G (private), Mytouch 4g Slide, Evo LTE, HTC One (In Progress), Moto X
 
Spiralzz
Old
#7  
Spiralzz's Avatar
Senior Member
Thanks Meter 324
Posts: 1,134
Join Date: Aug 2011
Location: Islamabad
Quote:
Originally Posted by anshumandash View Post
When I get in to cmd in bootloader mode and type adb shell cat /proc/last_kmsg > kmsg.txt, I get a message Error: Device not found. I checked the ADB drivers, the are loading well. Am I doing something wrong?
You need to boot into the ROM, then grab the logs.

Sent from my GT-I9100 using xda app-developers app
Phone: Nexus 4
Android: 4.4.2
ROM: Purity
Build: Latest - KVT49L
Kernel: Franco
Baseband: .84

Phone: Nexus 7 (2013) [flo]
Android: 4.4.2
ROM: Paranoid Android
Build: Beta 4 - KVT49L
Kernel: Franco

Phone: Samsung GT-I9100 | Android: 4.4.2 | ROM: CM11 | Build: Latest | Kernel: Stock
 
DowntownJeffBrown
Old
#8  
DowntownJeffBrown's Avatar
Senior Member
Thanks Meter 3362
Posts: 15,841
Join Date: Oct 2012
Location: Porter Indiana (Chicagoland)
Default Re: Tutorial: How to properly post a bug

Thank you for this

Sent from my Nexus 4 using Xparent BlueTapatalk 2
 
fatpanda0
Old
#9  
fatpanda0's Avatar
Senior Member
Thanks Meter 104
Posts: 279
Join Date: Nov 2012

 
DONATE TO ME
Can someone help me please.

I am from the HTC One S (Ville C2) community. I am testing a new kernel by one of the devs who doesnt have the phone. Now after installing the new kernel the phone is on bootloop. I need to extract the last_kmsg. the only way I can get out of the boot loop to do anything is by pressing the power button and simulate battery out. This it seems erases the last_kmsg cuz when I enter recovery to get it. It either says no such file or sometimes ends up showing me the recovery kernels last_kmsg. I am at a total loss as to how I the last_kmsg file.

There is also no way to install a working boot image as the kernel uses a zip to install files on the phone so we must use recovery to restore to previous state. This leads to the original condition. I tried looking for a solution but cant find it anywhere.
ROM: ViperS 3.0.2 ED || Kernel: Poppy Kernel_v1.1 by Poppy22 || HBOOT: 3.09 || S-off Moonshine by beaups

IF I HAVE HELPED YOU. HIT THANKS.
 
piyush_soni
Old
#10  
Member
Thanks Meter 7
Posts: 61
Join Date: Nov 2012
I tried the above method (via the Terminal Emulator) for finding the last_kmsg (my phone had just rebooted) and it says "/system/bin/sh: cat: /proc/last_kmsg: No such file or directory"

And Indeed, there is no last_kmsg file in my proc folder. Is there something I have to do to create it in the first place?

Thanks!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Samsung EFS Tool Updated to V5, Brings Universal Device Support

You may recall that we’ve talked about XDA Recognized Contributor … more

Say Goodbye to Holo Blue Once and for All

When Google released Android 4.4 KitKat back in October of last year, they changed quite a bit … more

Sony Z Ultra Google Play Edition Receives Bluetooth Certification for Android 4.4.3

You may recall that a few days ago, Sprint jumped the gun … more

Easily Configure Xposed Module Projects in Eclipse

XDA Recognized Developer rovo89‘s innovative and versatile Xposed Framework allows … more