2010-10-08 22:39:50     pppd crash when authorizing in BF547

Document created by Aaronwu Employee on Aug 23, 2013
Version 1Show Document
  • View in full screen mode

2010-10-08 22:39:50     pppd crash when authorizing in BF547

Ray Zheng (CHINA)

Message: 94347   

 

I want my BF547 board to dial in a windows XP RAS server using modems. the whole kernel and application configuration is the same as the URL:  docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:ppp,but everytime I run the pppd command, it crashs. the debug message is as follows:

 

root:/usr/sbin> pppd call isp

Serial connection established.

using channel 7

Using interface ppp0

Connect: ppp0 <--> /dev/ttyBF0

Warning - secret file /etc/ppp/pap-secrets has world and/or group access

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x8798ca10> <pcomp> <accomp>]

rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MS-v2> <magic 0x4339122f> <pcomp> <accomp> <callback CBCP> <mrru 1614> <endpoint [local:fc.ed.e3.04.60.f4.44.ab.85.59.86.ce.f6.3e.0a.a0.00.00.00.00]> < 17 04 00 08>]

sent [LCP ConfRej id=0x0 <callback CBCP> <mrru 1614> < 17 04 00 08>]

rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x8798ca10> <pcomp> <accomp>]

rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <auth chap MS-v2> <magic 0x4339122f> <pcomp> <accomp> <endpoint [local:fc.ed.e3.04.60.f4.44.ab.85.59.86.ce.f6.3e.0a.a0.00.00.00.00]>]

sent [LCP ConfAck id=0x1 <asyncmap 0x0> <auth chap MS-v2> <magic 0x4339122f> <pcomp> <accomp> <endpoint [local:fc.ed.e3.04.60.f4.44.ab.85.59.86.ce.f6.3e.0a.a0.00.00.00.00]>]

rcv - Attempted misaligned data memory or data cache access.

Defered Exception context

CURRENT PROCESS:

COMM=pppd PID=415

TEXT = 0x02100040-0x0212a560        DATA = 0x0212a564-0x02137e34

BSS = 0x02137e34-0x02194c14  USER-STACK = 0x02195f6c

 

return address: [0x00080400]; contents of:

0x000803e0:  c682  80c2  5608  b090  322d  acea  a096  0c06

0x000803f0:  a057  15cd  e530  0017  ac42  0c42  180b  0000

0x00080400: [a111] a128  0981  1802  231e  3047  304a  e3ff

0x00080410:  facd  e531  0017  b04d  2d40  e4a0  0005  e4a1

 

SEQUENCER STATUS:        Not tainted

SEQSTAT: 00060024  IPEND: 0030  SYSCFG: 0006

  HWERRCAUSE: 0x18

  EXCAUSE   : 0x24

RETE: <0x00000000> /* Maybe null pointer? */

RETN: <0x0225a000> /* unknown address */

RETX: <0x00080400> { _jffs2_get_inode_nodes + 0x634 }

RETS: <0x00080400> { _jffs2_get_inode_nodes + 0x634 }

PC  : <0x00080400> { _jffs2_get_inode_nodes + 0x634 }

DCPLB_FAULT_ADDR: <0x05b58ebc> /* unknown address */

ICPLB_FAULT_ADDR: <0x00080400> { _jffs2_get_inode_nodes + 0x634 }

 

PROCESSOR STATE:

R0 : 02194b28    R1 : 00000000    R2 : 00000000    R3 : 00000000

R4 : 002c002e    R5 : 004e414e    R6 : 006e616e    R7 : 00464e49

P0 : ffffffff    P1 : 02137b75    P2 : 05b58ead    P3 : 00666e69

P4 : 00001814    P5 : 100c0804    FP : 00435455    SP : 02259f24

LB0: 021243df    LT0: 021243cc    LC0: fffffffc

LB1: 021234ad    LT1: 021234ac    LC1: 00000000

B0 : 02195d88    L0 : 00000000    M0 : 00000000    I0 : 02194b78

B1 : 00000000    L1 : 00000000    M1 : 00000000    I1 : 02137b44

B2 : 00000000    L2 : 00000000    M2 : 00000000    I2 : 86475101

B3 : 00000000    L3 : 00000000    M3 : 00000000    I3 : 0000d6fd

A0.w: 00000003   A0.x: 00000000   A1.w: 00000003   A1.x: 00000000

USP : 0212cac4  ASTAT: 02001005

 

Hardware Trace:

   0 Target : <0x00004944> { _trap_c + 0x0 }

     Source : <0xffa006ec> { _exception_to_level5 + 0xb4 }

   1 Target : <0xffa00638> { _exception_to_level5 + 0x0 }

     Source : <0xffa00590> { _ex_trap_c + 0x5c }

   2 Target : <0xffa00534> { _ex_trap_c + 0x0 }

     Source : <0xffa0078c> { _trap + 0x28 }

   3 Target : <0xffa00764> { _trap + 0x0 }

     Source : <0x02121e06> [ pppd + 0x21dc6 ]

   4 Target : <0x02121dfe> [ pppd + 0x21dbe ]

     Source : <0x02121cb6> [ pppd + 0x21c76 ]

   5 Target : <0x02121ca6> [ pppd + 0x21c66 ]

     Source : <0x021243e8> [ pppd + 0x243a8 ]

   6 Target : <0x021243e0> [ pppd + 0x243a0 ]

     Source : <0x021243dc> [ pppd + 0x2439c ]

   7 Target : <0x021243bc> [ pppd + 0x2437c ]

     Source : <0x021243b4> [ pppd + 0x24374 ]

   8 Target : <0x02124378> [ pppd + 0x24338 ]

     Source : <0x02121ca2> [ pppd + 0x21c62 ]

   9 Target : <0x02121c9a> [ pppd + 0x21c5a ]

     Source : <0x02121c92> [ pppd + 0x21c52 ]

  10 Target : <0x02121c7c> [ pppd + 0x21c3c ]

     Source : <0x02126a80> [ pppd + 0x26a40 ]

  11 Target : <0x02126a46> [ pppd + 0x26a06 ]

     Source : <0x02126a60> [ pppd + 0x26a20 ]

  12 Target : <0x02126a46> [ pppd + 0x26a06 ]

     Source : <0x02126a60> [ pppd + 0x26a20 ]

  13 Target : <0x02126a46> [ pppd + 0x26a06 ]

     Source : <0x02126a60> [ pppd + 0x26a20 ]

  14 Target : <0x02126a46> [ pppd + 0x26a06 ]

     Source : <0x02126a60> [ pppd + 0x26a20 ]

  15 Target : <0x02126a46> [ pppd + 0x26a06 ]

     Source : <0x02126a60> [ pppd + 0x26a20 ]

Stack from 02259f04:

        00010a2c ffa006f0 00188568 00188568 0018855c 00000003 02194604 02120e36

        00080400 00000030 00060024 00000000 0225a000 00080400 00080400 00080400

        02194b28 02001005 021234ad 021243df 021234ac 021243cc 00000000 fffffffc

        00000003 00000000 00000003 00000000 00000000 00000000 00000000 02195d88

        00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

        0000d6fd 86475101 02137b44 02194b78 0212cac4 00435455 100c0804 00001814

 

Call Trace:

 

d [CHAP Challenge id=0x0 <11c30a63d0de112900a72c4b92301e03>, name = "PC-201005310948"]

Fatal signal 7

 

Thanks for you help in advance!

TranslateQuoteReplyEditDelete

 

 

2010-10-09 01:36:07     Re: pppd crash when authorizing in BF547

Mike Frysinger (UNITED STATES)

Message: 94348   

 

please review the documentation:

  docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:analyzing_traces#unaligned_data_access

QuoteReplyEditDelete

 

 

2010-10-11 02:46:32     Re: pppd crash when authorizing in BF547

Vlad Orlov (RUSSIAN FEDERATION)

Message: 94390   

 

Ray, does it always show misaligned data access as the reason of crash? Or do other kinds of exceptions show up?

QuoteReplyEditDelete

 

 

2010-10-11 05:55:09     Re: pppd crash when authorizing in BF547

Ray Zheng (CHINA)

Message: 94402   

 

yes, when I make some modifications(just some printf code) ,compile and run the application, the exception changed, this time it shows "Defered Exception context". According the method of analyzing traces, I find nothing useful clues. So I have to use raw method(that is use printf code) to find the source, luckily I find it. the problem is from get_secret function in auth.c where the size of  a buffer named secbuf is too large, I change it from 1024 to 100 and the exception disappear.

TranslateQuoteReplyEditDelete

 

 

2010-10-11 12:50:28     Re: pppd crash when authorizing in BF547

Vlad Orlov (RUSSIAN FEDERATION)

Message: 94408   

 

Just as I suspected... Looks like a stack overflow.

Try the following:

 

1. Add -mstack-check-l1 to COPTS in user/pppd/Makefile.

 

2. Rebuild and run pppd. It should crash with "stack overflow" exception now (no more random exceptions). Try different options to achieve this behavior.

 

3. Now, if the app really crashes with stack overflow, you just need to increase the stack size. For example, set "FLTFLAGS += -s 8192" before running make. Or use other methods from   docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:debugging_applications

 

4. If the stack wasn't the cause... well, bad luck, will have to try something else.

 

5. And never ever ever do something like you did to that poor local buffer.

 

btw, the default stack size is 4096. If doubling it doesn't help, increase it even more. For example, sqlite's Makefile sets the stack size to 32000.

When everything becomes stable, you can remove -mstack-check-l1.

Attachments

    Outcomes