LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   2.6.27.35: Application causes linux to crash (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/2-6-27-35-application-causes-linux-to-crash-4175414119/)

zvivered 06-30-2012 03:40 AM

2.6.27.35: Application causes linux to crash
 
Hello,

I'm running vanilla 2.6.27.35 on Pentium-M with busybox 1.14.2

At a specific scenario the application is causing linux to crash.

How can I debug this ?

After the crash, the console is not active any more.

I also tried using ttyS1 as console (RS232) but the kernel messages does not give a clue.

When I tried a smaller kernel I get other messages (I removed unnecessary drivers).

I tried using duma.

On the init phase, there are thousands of dynamic allocations and this is causing the init phase to run forever. The console is active and the CPU usage is almost 100%.

With dmalloc, the init phase does not start and CPU usage is 0%.

What other tools can I use ?

Thanks,
Zvika.

anshuman84 07-04-2012 05:40 AM

Let me get clarity about your issue. If you are getting the issue after running the application then you can use following tools >>>>>>>
1>GDB
2>Valgrind (mainly for memory leak issue as I saw you CPU utilization shooting to 100%)
3>trace (To trace the system calls)

gchen 07-21-2012 07:45 AM

Quote:

Originally Posted by anshuman84 (Post 4718970)
Let me get clarity about your issue. If you are getting the issue after running the application then you can use following tools >>>>>>>
1>GDB
2>Valgrind (mainly for memory leak issue as I saw you CPU utilization shooting to 100%)
3>trace (To trace the system calls)

Firstly, support what anshuman84 said above.

Then, I think, the kernel debugger is necessary, such as KGDB (also need GDB in user mode on remote machine) or KDB (can debug in one machine).

KGDB is integrated into kernel in later version (but maybe not in 2.6.27), and KDB is later than KGDB for being integrated into kernel.

: )



And by the way (maybe not quite relative with this issue)

Reading source code and programming carefully (especially for the relative changes) is still a way for solving this issue, it is the sugestion of Linus Torvalds.

Linus does not suggest using debugger: reading source code and carefully programming are much important than debugging (it is truly reasonable)

: )

zvivered 07-23-2012 09:52 PM

Debugging linux kernel
 
Dear Members,

When I use gdb to debug and application I run gdbserver on the target and gdb on the host.
Debugging is done over ethernet.

How gdb works with kgdb ?

I checked kgdb in the kernel configuration and also compiled the kernel with -g

How should I start debugging the kernel ?

1. Should I run gdb on the host and enter 'continue' ?
2. In case debugging is possible only via RS232, should I copy gdb to the target and run it ?

Thanks,
Zvika

gchen 07-23-2012 11:53 PM

Firstly, sorry for I have no experience for KGDB either.

But I have experience for KDB in local machine and serial port to Notbook.

For kernel debug, I think my experience has effect too.


1) google the home page of KGDB.

2) follow the documents which you find on the home page of KDB to constructing your environments;

3) when enrionments is ok, try some simple test.

If all 3 items you performed, I think, you will know all the answers you asked.

(by the way, if has "-g", the debugger will display the source code, if no "-g", debug still can work, but can not relative with source code)


Hope these information above is helpful for you.

: )


All times are GMT -5. The time now is 12:12 AM.