2010-09-24 01:36:04     Issues regarding fopen and binary streams on uclinux

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

2010-09-24 01:36:04     Issues regarding fopen and binary streams on uclinux

Usama Shakeel (PAKISTAN)

Message: 93808   

 

Hello,

I am using GSM modem which works absolutely fine with microcom but there is one thing bothering me alot. i.e. when I open a file (ttyUSB0) in rwb+ mode in Fedora and do the same as mentioned in the code below it does it without any issues. but when I do this in uclinux it gives the following result. Is there any thing I have to enable while compiling uclinux.

 

Result in uClinux 2009:

 

Start :

 

After Device Open:53564468

String Sent: AT

Error : Bad file descriptor

 

but when I open it in wb+ mode it opens and perform task except sending some special characters but when I close the stream fclose the uclinux crashes with lots of messages regarding stack. I have attached almost half the message I could get ..

 

Kindly help what I have to enable to support this mode.

 

Regards

 

Usama

 

Code :

#include <stdio.h>

#include <stdlib.h>

#include <fcntl.h>        /* open */

#include <unistd.h>        /* exit */

#include <sys/ioctl.h>  

#include <errno.h>

    /* ioctl */

#include <sys/types.h>

#include <string.h>

 

int send_mess ();

int main()

{

    printf("Start :\n ");

    send_mess();

    printf("End :\n");

 

        return 0;

  

}

 

 

int send_mess (char output[])

{

    int nbytes = 100;

           char data_r[100];

 

    FILE * serialDev;

    char deviceName[15] = "/dev/ttyUSB0";

 

    serialDev = fopen(deviceName, "rwb+");

    printf("\nAfter Device Open:%d",serialDev);

    if (serialDev <= 0 )

    {

        printf("ERROR : Device Not Attached \n");

        exit(1);

    }

    int datawrite;

    char* dataread;

 

    printf("\nString Sent: AT\n");

    datawrite = fprintf(serialDev,"AT\r\n");

    fflush(serialDev);

    if(datawrite<0)

    {

        printf("Error : %s \n",strerror(errno));

        exit(0);

    }

 

    do {

        dataread =  fgets(data_r, nbytes,serialDev);

      

    } while ( strcmp(data_r, "OK\n") != 0 );

 

    printf("END AT\n");

 

    fclose(serialDev);

        return 0;

 

}

 

message.txt

QuoteReplyEditDelete

 

 

2010-09-24 01:41:16     Re: Issues regarding fopen and binary streams on uclinux

Mike Frysinger (UNITED STATES)

Message: 93809   

 

"rwb+" makes no sense to fopen().  please read the man page.

 

as for the stack issue, please read the documentation:

  docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:debugging_applications#stack_checking

QuoteReplyEditDelete

 

 

2010-09-24 01:58:20     Re: Issues regarding fopen and binary streams on uclinux

Usama Shakeel (PAKISTAN)

Message: 93810   

 

That was again a quick reply..:)

 

 

 

Mike you are right but this was working on system. Even if we leave it aside.

 

when I open it

 

serialDev = fopen(deviceName, "r+");

 

it also crashes. Which is not the case on PC.

 

 

 

Regards

 

Usama

QuoteReplyEditDelete

 

 

2010-09-24 07:40:07     Re: Issues regarding fopen and binary streams on uclinux

Usama Shakeel (PAKISTAN)

Message: 93816   

 

Mike I need help. . I have compiled by

 

bfin-uclinux-gcc -mstack-check-l1 -c application.c

 

bfin-uclinux-gcc -elf2flt application.o -o application

 

and enabled stack in uclinux while compiling it.

 

 

 

but the problem is that when I close the descriptor of opened file it gives the following message. How should I move further .. Or what should be the stack size if I set it through flthdr ..??

 

 

 

WARNING: at drivers/usb/serial/usb-serial.c:313 _serial_write+0x8e/0x90()

Modules linked in:

Hardware Trace:

   0 Target : <0x00004aa0> { _dump_stack + 0x0 }

     Source : <0x0000fde0> { _warn_on_slowpath + 0x44 } CALL pcrel

   1 Target : <0x0000fde0> { _warn_on_slowpath + 0x44 }

     Source : <0x0002aab6> { _print_modules + 0x7a } RTS

   2 Target : <0x0002aab0> { _print_modules + 0x74 }

     Source : <0x000103c6> { _printk + 0x16 } RTS

   3 Target : <0x000103c2> { _printk + 0x12 }

     Source : <0x00010c5e> { _vprintk + 0x132 } RTS

   4 Target : <0x00010c52> { _vprintk + 0x126 }

     Source : <0x00010c44> { _vprintk + 0x118 } IF !CC JUMP

   5 Target : <0x00010c3c> { _vprintk + 0x110 }

     Source : <0x00010d82> { _vprintk + 0x256 } JUMP.S

   6 Target : <0x00010d82> { _vprintk + 0x256 }

     Source : <0x0001023a> { _wake_up_klogd + 0x1a } RTS

   7 Target : <0x00010220> { _wake_up_klogd + 0x0 }

     Source : <0x0001064e> { _release_console_sem + 0x1ae } JUMP.L

   8 Target : <0x00010646> { _release_console_sem + 0x1a6 }

     Source : <0x0001062a> { _release_console_sem + 0x18a } IF !CC JUMP

   9 Target : <0x0001061e> { _release_console_sem + 0x17e }

     Source : <0x000235a2> { _up + 0x3e } RTS

  10 Target : <0x0002359c> { _up + 0x38 }

     Source : <0x0002358e> { _up + 0x2a } IF !CC JUMP

  11 Target : <0x00023564> { _up + 0x0 }

     Source : <0x0001061a> { _release_console_sem + 0x17a } CALL pcrel

  12 Target : <0x00010606> { _release_console_sem + 0x166 }

     Source : <0x000104ee> { _release_console_sem + 0x4e } IF !CC JUMP

  13 Target : <0x000104c2> { _release_console_sem + 0x22 }

     Source : <0x000105e8> { _release_console_sem + 0x148 } IF CC JUMP

  14 Target : <0x000105e0> { _release_console_sem + 0x140 }

     Source : <0x0001019a> { __call_console_drivers + 0x7a } RTS

  15 Target : <0x00010194> { __call_console_drivers + 0x74 }

     Source : <0x00010156> { __call_console_drivers + 0x36 } IF !CC JUMP

Stack info:

SP: [0x03123860] <0x03123860> /* kernel dynamic memory */

FP: (0x03123b78)

Memory from 0x03123860 to 03124000

03123860:[0000fde0]<0000fde4> 03123880  0029d414  00000041  0029d414  00000139  03123880

03123880: 7265735f  5f6c6169  74697277  78302b65  302f6538  00303978  0312389c  7265735f

031238a0: 5f6c6169  74697277  6f725f65  302b6d6f  2f653678  30377830  000b8e00  034d7400

031238c0: 034d7400  03123918 <001205ee> 0362a4d4  03640260  03502c00  00000000  c0410280

031238e0: 0000e141  54333072 <000bc76c> 03640320 <000bc786> 00000001  c1f8c682  00373028

03123900: 00000003  03656c68  0000003f  00000000  00fcc682  1fffe141  001239cc <0011109a>

03123920: 03656840  0362a400  03502c00  00000000  00000001  00000020  0362a4d4  0362a400

03123940: 03656840  0880b836  ce8263fd  b847cc0e  e1450000  ce820fff  ba36ce0f  0a2c0000

03123960:<00126d1a> 03502c00  00000001  031239ac  181c0830  ffb4e12a  5a976018 <00126c8a>

03123980: 03502c00 <000b8e7a> 034d7400  034d7400  00000041  00000010  320a50f3 <000bb730>

031239a0:<000bb730><000bb7a8> 0360fc00  034d7441  034d747c <000bc76c> 03640320  00000001

031239c0: 00000010  00000001  00000002  03640268 <00129668> 03656840  0360fc26  00502c00

031239e0: 034d7400  03507000 <00110370><0011037a> 03656740  0362a400  b2ba0011 <0012994a>

03123a00: 03502c00 <0011dd12><0011e622><0011e622> 03656740  0362a400  0362a4d4  00000000

03123a20: 03123a40 <0011eab2> 03656740  030300c0  00000000  00000001  00000100  0c121c15

03123a40:<0011db82> 00000000  0362a58c <0011ef44> 030300c0  0362a554  0362a57c  0000000f

03123a60: 00000001  0000001f  0000000f  034d7414 <000bf0ac> 0360fc00  034d7400  034d747c

03123a80: 0360fd1c  0000003f  00000000  0362a4d4  00000001  00000000  03123ac0  00000001

03123aa0: 03640268 <001296dc> 036567c0  002d2e38  03502c00  034d7400  03508000  00000022

03123ac0: 002c715c  fffffffe <00004000> 0362a4d4 <0011037a> 036567c0  0362a400  03620c00

03123ae0: 00000000  0362a4d4  0000000c  00000001  0362a4d4 <0011dd12><0011e622> 036567c0

03123b00: 03640260  0362a400  03620000 <0001d1dc> 00000100 <0011eab2> 036567c0  03640260

03123b20: 00000000  00001000  00000100  0000003f  0000ffff  00000000  0362a58c <0011ef44>

03123b40: 03640260  0362a554  0362a57c  0000000e  00000001  0000001f  0000000e <0011dc1a>

03123b60: 00000008  0350a9e0  0000001f  0000000e  00000000  0000000a (00000000)<0002f018>

03123b80:<0011df44> 03640aa0  0362a57c  00000008  0362a588  0362a59c  03123c08 <0011faea>

03123ba0: 0362a400  00000022  03502c00  0000000c  00000001  00000100  0362a4d4  0362a4d4

03123bc0: 00000000  00000000  00000000  03123d38  0312eeac  0362a57c  03123c04 <0000a62a>

03123be0: 00000000  00000000  00000000  03122000  00000010  03640100  03620000  a564a500

03123c00: 00000100  03123c30  00000000 <00110698> 0362a400  00000022  03502c00  0000003f

03123c20: 0000ffff  00000022  00000001  0362a400 <00009c32> 03123c58 <0002d736> 03635440

03123c40: 00000000  00000000  03123c74 <0000b040> 003af040 <0002efd0> 002db090  00000000

03123c60: 00000022  00000000  03634534  002c2418  03122000 <00008dda> 002cfe68  03640800

03123c80: 03634534  03122000  00000000 <000146ae> ffa08318  0000001a  00000000  00000000

03123ca0: fffff29f  03122000  03123d40  ffa08bb4  03656940  00000001  034d7400  00000000

03123cc0:<000c57da> 002d1198  001116d0  02003004  00002000  00000000  03124000  0312a1b6

03123ce0: 001116d0 <001116c0> 0000000c  02003004  0312aecd  0011ccca  0312ae86  0011ccca

03123d00: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

03123d20: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

03123d40: 00000000  00000000  00000000  00000000  03114004  00000008  0312ee2c  00000000

03123d60: 03656940  03640800  03502c00  03122000  036409b8  003190c0  00000001  034d7400

03123d80: 00000000  00000001  002c72e0  00000001  03122000  03620c00  03620c00  003190c0

03123da0: 00000006  00000000  00000021  00000000  00000000  00000000  00000000  00001388

03123dc0:<00129dec><00129daa> 03640804  03640800  00000001  0312ede4  003b61a0  00000000

03123de0:<00127098> 03502c00  034d7400  003b64a0  03502c3c  003b64a0  00000006  03636000

03123e00: 0000000a  034d7498 <000ba7b2> 034d7400  00000000  00000008  0354f20c <00009e2c>

03123e20: 03620014  03620000  03636000  00000000  035512e0  0312d6d0  00000007  00000007

03123e40: 00000000  036343e0  00000000  00000000  03122000 <000be92c> 0000ffff  036200d8

03123e60: 00000007  03636000  00000000 <000ba4fc> 0354e1f8  036f40a0 <000baa2e> 035512e0

03123e80: 003b64a0  035512e0  00000008  0354f20c  00000002  00000001  00000008  0354f20c

03123ea0: 00000002 <00041188> 00000002  00000007  00000007  00000000  00000000  0312ee38

03123ec0:<0003ed5a> 003b64a0  00000006  03129f60  00000000  036e0ec0  0312d6d0  00000007

03123ee0: 0003ef20 <0003ede2> 036e0ec0  003b64a0  ffffe000  00000000  00000000  ffa08880

03123f00: ffa08880  0003ed80  00000000  0312d470  0312ef8c  00000003  00000000  00000001

03123f20: 00000002  0312a1b6  00008000  00002000  00000000  03124000  0312a1b6  0312a1b6

03123f40:<031282ec> ffa08ef8  02001024  0312aecd  0312b411  0312ae86  0312b404  00000000

03123f60: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

03123f80: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

03123fa0: 00000000  00000000  00000000  03114004  0312c360  0312ee2c  0312ee38  0312d470

03123fc0: 03129f50  03129f60  0312d6d7  0312d7d0  00000006  00000000  00000000  00000002

03123fe0: 00000001  00000000  00000007  0312d6d0  00000003  00000003  00000006  00000006

Return addresses in stack:

    address : <0x0000fde0> { _warn_on_slowpath + 0x44 }

    address : <0x0000fde4> { _warn_on_slowpath + 0x48 }

    address : <0x001205ee> { _isp1362_urb_enqueue + 0xf2 }

    address : <0x000bc76c> { _n_tty_receive_buf + 0x300 }

    address : <0x000bc786> { _n_tty_receive_buf + 0x31a }

    address : <0x0011109a> { _usb_hcd_submit_urb + 0x27a }

    address : <0x00126d1a> { _serial_write + 0x8e }

    address : <0x00126c8a> { _serial_write_room + 0x6e }

    address : <0x000b8e7a> { _tty_put_char + 0x26 }

    address : <0x000bb730> { _opost + 0x10 }

    address : <0x000bb730> { _opost + 0x10 }

    address : <0x000bb7a8> { _opost + 0x88 }

    address : <0x000bc76c> { _n_tty_receive_buf + 0x300 }

    address : <0x00129668> { _option_indat_callback + 0x94 }

    address : <0x00110370> { _usb_hcd_giveback_urb + 0x38 }

    address : <0x0011037a> { _usb_hcd_giveback_urb + 0x42 }

    address : <0x0012994a> { _option_outdat_callback + 0x26 }

    address : <0x0011dd12> { _isp1362_read_buffer + 0x16 }

    address : <0x0011e622> { _finish_request + 0x36 }

    address : <0x0011e622> { _finish_request + 0x36 }

    address : <0x0011eab2> { _postproc_ep + 0x156 }

    address : <0x0011db82> { _prepare_ptd + 0x26e }

    address : <0x0011ef44> { _finish_transfers + 0x144 }

    address : <0x000bf0ac> { _flush_to_ldisc + 0xb4 }

    address : <0x001296dc> { _option_indat_callback + 0x108 }

    address : <0x00004000> { _show_regs + 0x32c }

    address : <0x0011037a> { _usb_hcd_giveback_urb + 0x42 }

    address : <0x0011dd12> { _isp1362_read_buffer + 0x16 }

    address : <0x0011e622> { _finish_request + 0x36 }

    address : <0x0001d1dc> { _queue_work_on + 0x54 }

    address : <0x0011eab2> { _postproc_ep + 0x156 }

    address : <0x0011ef44> { _finish_transfers + 0x144 }

    address : <0x0011dc1a> { _isp1362_write_buffer + 0x16 }

   frame  1 : <0x0002f018> { _handle_level_irq + 0x9c }

    address : <0x0011df44> { _isp1362_write_ptd + 0x4c }

    address : <0x0011faea> { _isp1362_irq + 0x72a }

    address : <0x0000a62a> { _update_curr + 0x62 }

    address : <0x00110698> { _usb_hcd_irq + 0x2c }

    address : <0x00009c32> { _dequeue_task + 0x82 }

    address : <0x0002d736> { _handle_IRQ_event + 0x36 }

    address : <0x0000b040> { _pick_next_task_fair + 0x54 }

    address : <0x0002efd0> { _handle_level_irq + 0x54 }

    address : <0x00008dda> { _bfin_demux_gpio_irq + 0x72 }

    address : <0x000146ae> { _irq_enter + 0xa }

    address : <0x000c57da> { _bfin_serial_dma_tx_int + 0x8e }

    address : <0x001116c0> { _usb_kill_urb + 0xc }

    address : <0x00129dec> { _option_close + 0x94 }

    address : <0x00129daa> { _option_close + 0x52 }

    address : <0x00127098> { _serial_close + 0xc0 }

    address : <0x000ba7b2> { _tty_release_dev + 0x106 }

    address : <0x00009e2c> { ___wake_up + 0x18 }

    address : <0x000be92c> { _tty_ldisc_deref + 0x68 }

    address : <0x000ba4fc> { _tty_write + 0x160 }

    address : <0x000baa2e> { _tty_release + 0xa }

    address : <0x00041188> { ___fput + 0x90 }

    address : <0x0003ed5a> { _filp_close + 0x36 }

    address : <0x0003ede2> { _sys_close + 0x62 }

    address : <0x031282ec> [ forum + 0x2ac ]

---[ end trace 1979529e0cca9675 ]---

------------[ cut here ]------------

WARNING: at drivers/usb/serial/usb-serial.c:326 _serial_write_room+0x6e/0x70()

Modules linked in:

Hardware Trace:

   0 Target : <0x00004aa0> { _dump_stack + 0x0 }

     Source : <0x0000fde0> { _warn_on_slowpath + 0x44 } CALL pcrel

   1 Target : <0x0000fde0> { _warn_on_slowpath + 0x44 }

     Source : <0x0002aab6> { _print_modules + 0x7a } RTS

   2 Target : <0x0002aab0> { _print_modules + 0x74 }

     Source : <0x000103c6> { _printk + 0x16 } RTS

   3 Target : <0x000103c2> { _printk + 0x12 }

     Source : <0x00010c5e> { _vprintk + 0x132 } RTS

   4 Target : <0x00010c52> { _vprintk + 0x126 }

     Source : <0x00010c44> { _vprintk + 0x118 } IF !CC JUMP

   5 Target : <0x00010c3c> { _vprintk + 0x110 }

     Source : <0x00010d82> { _vprintk + 0x256 } JUMP.S

   6 Target : <0x00010d82> { _vprintk + 0x256 }

     Source : <0x0001023a> { _wake_up_klogd + 0x1a } RTS

   7 Target : <0x0001023a> { _wake_up_klogd + 0x1a }

     Source : <0x0001022c> { _wake_up_klogd + 0xc } IF !CC JUMP

   8 Target : <0x00010220> { _wake_up_klogd + 0x0 }

     Source : <0x0001064e> { _release_console_sem + 0x1ae } JUMP.L

   9 Target : <0x00010646> { _release_console_sem + 0x1a6 }

     Source : <0x0001062a> { _release_console_sem + 0x18a } IF !CC JUMP

  10 Target : <0x0001061e> { _release_console_sem + 0x17e }

     Source : <0x000235a2> { _up + 0x3e } RTS

  11 Target : <0x0002359c> { _up + 0x38 }

     Source : <0x0002358e> { _up + 0x2a } IF !CC JUMP

  12 Target : <0x00023564> { _up + 0x0 }

     Source : <0x0001061a> { _release_console_sem + 0x17a } CALL pcrel

  13 Target : <0x00010606> { _release_console_sem + 0x166 }

     Source : <0x000104ee> { _release_console_sem + 0x4e } IF !CC JUMP

  14 Target : <0x000104c2> { _release_console_sem + 0x22 }

     Source : <0x000105e8> { _release_console_sem + 0x148 } IF CC JUMP

  15 Target : <0x000105e0> { _release_console_sem + 0x140 }

     Source : <0x0001019a> { __call_console_drivers + 0x7a } RTS

Stack info:

SP: [0x034f19a0] <0x034f19a0> /* kernel dynamic memory */

FP: (0x034f1ad4)

Memory from 0x034f19a0 to 034f2000

034f19a0:[0000fde0]<0000fde4> 034f19c0  0029d414  4000e121  0029d414  00000146  034f19c0

034f19c0: 7265735f  5f6c6169  74697277  6f725f65  302b6d6f  2f653678  30377830  6462b000

034f19e0: 05a3e419  e300326b  48006903  304e180d  6481a0f0  e300325d  0c007ff1  325d1805

034f1a00: e3ff6000  a1301b83  01276ca6  00100485  e80005ec  32390004  008de51a  0055e418

034f1a20: e419326b  93100056  e3003047  e52a68e1  e4280007  325d0057  e3ff9154  00001c43

034f1a40: 10093028  e42f325d  3007056b  e3ff302f  642d1c89  68075f27  30079127  325d6179

034f1a60: 1dcae3ff  180c0c00  325d3007  667ee300  1c220c00  9120325d  fffff3ff  01312d00

034f1a80: 00000400  00000006 <0015538e> 00000000  003d0900  00000000  034f1ac0 <0000a6b2>

034f1aa0:<00126c8a> 03502c00  00000041  00000010  034f1adc <0002ddb2> 002dad84  0000ffff

034f1ac0:<000bb730> 034d7400  034d7400  034f1af8  001ffc00 (00000000)<000bc76c> 03640320

034f1ae0: 00000001  00000010  ffffefce  01312d00  00000400  00000006  000fce9a  0360fc27

034f1b00: 003d0900  00000000  fffff7ff  01312d00  00000400  00000006  001ffc00  00000000

034f1b20: 003d0900  00000000  034f1b50 <0000a6b2> 00000000 <03634a0c> 00000000  00000000

034f1b40: 034f1b6c <0002ddb2> 002dad84  0000ffff  00000100 <0000dd0e> 00000000 <03634a0c>

034f1b60: 034f1b8c <0000a62a> 00000000  00000000  00000000  00000001 <000c5ab6> 002bd65c

034f1b80: 034f0000  a5a1ae00  003d08fb  034f1bb8  034d7414 <000bf0ac> 0360fc00  034d7400

034f1ba0: 034d747c  0360fd1c  0000003f  00000000  0362a4d4  00000001  034f1be8  034f1be8

034f1bc0: 00000001  03640268 <001296dc> 036568c0  002d2e38  03502c00  034d7400  03506000

034f1be0: 00000001  00000000  034f1c00 <00009c74> 002c2418 <0011037a> 036568c0  0362a400

034f1c00: 03620c00  00000000  0362a4d4  000044d0  11228c00  003d08f0 <0011dd12><0011e622>

034f1c20: 036568c0  03640260  0362a400  00000000 <0011db82> 000003ff <0011eab2> 036568c0

034f1c40: 03640260  00000000  00001000  00000100 <0011df82> 03640260  00000000  0362a58c

034f1c60:<0011ef44> 03640260  0362a554  0362a57c  0000000e  00000001  0000001f  0000000e

034f1c80: 00000000  034f1ca8 <0011037a> 00000000  0362a57c <0011e42c> 03640260  0362a51c

034f1ca0: 0362a4d4  00000000  00000000  00000000  0362a4d4  0362a588  0362a59c  034f1d2c

034f1cc0:<0011faea> 0362a400  00000022  0000002c  0000000c  00000001  00000100  0362a4d4

034f1ce0: 0362a4d4  00000000 <0014b090> ffffff94  034f1dcc  00000000  00000000  000004d0

034f1d00: 00000041  0302ec60  00000000 <00017cd6> ffffffff  034f1d14  00000100  00000000

034f1d20: 0362a64c  00000100  0362a60c  002d8694 <00110698> 0362a400  00000022  0000002c

034f1d40: 0000003f  0000ffff  00000022  000003ff  0362a400  034f1d50  00000000 <0002d736>

034f1d60: 03635440  00000000  00000000 <0002f018> 002db090  00000022 <0002efd0> 002db090

034f1d80: 00000000  00000022  00000000  00000005  034f1e9c  000003e3 <00008dda> 002cfe68

034f1da0: 002c2cb0  00000000  00000041  002d8694 <000146ae> ffa08318  0000001a  00000000

034f1dc0: 030de58b  034f1d5c  034f1dcc  00000000  ffa08bb4  002c2cb0  00000030  0000014b

034f1de0: 00000000  034f1e10 <0000a62a> 00010ec2  02002000  00002000  00000000  03124000

034f1e00: 0312a1b6  00010ec2 <00010ed6> 0000000c  02002000  0312aecd  0011ccca  0312ae86

034f1e20: 0011ccca  00000000  00000000  00000938  00000000  003d08fb  00000000  00000000

034f1e40: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

034f1e60: 00000000  00000000  00000000  00000000  00000000  03114004  00000008  030e6eac

034f1e80: 002d8694  002c2cb0  002c2cb0  0000002c  002c44c9  00001789  002d8d30  00000030

034f1ea0: 0000014b  030de58b  000003ff  030de58a  0000978a  00000000  0000ffff  0000ffff

034f1ec0: 002d8d30  00000006  00000000 <00040e04> 003b6aa0  00000000  036349e0  0002006c

034f1ee0: 034f1ee0  034f1ee0  030e6eb8  ffa08880  00011120  00000067  0000002c  00000000

034f1f00: ffffe000  00000000  00000002  030de29c  0000002c  030de4db  030de440  00000002

034f1f20: 00000000  03081dec  00008000  00002000  00000000  034f2000  03081dec  03081dec

034f1f40:<030a8c72> ffa08ef8  02001024  0308b1ad  0308c347  0308b1ac  0308c346  00000000

034f1f60: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

034f1f80: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

034f1fa0: 00000000  00000000  00000000  030dceac  030e6de0  030e6eac  030e6eb8  00000000

034f1fc0: 030de29c  0000002c  030de440  030de444  00000067  030de440  030de440  00000000

034f1fe0: 00000002  030de440  000003ff  030de440  00000002  00000002  00000067  00000006

Return addresses in stack:

    address : <0x0000fde0> { _warn_on_slowpath + 0x44 }

    address : <0x0000fde4> { _warn_on_slowpath + 0x48 }

    address : <0x0015538e> { _ptype_seq_show + 0xee }

    address : <0x0000a6b2> { _sched_slice + 0x42 }

    address : <0x00126c8a> { _serial_write_room + 0x6e }

    address : <0x0002ddb2> { ___enable_irq + 0x4e }

    address : <0x000bb730> { _opost + 0x10 }

   frame  1 : <0x000bc76c> { _n_tty_receive_buf + 0x300 }

    address : <0x0000a6b2> { _sched_slice + 0x42 }

    address : <0x03634a0c> /* kernel dynamic memory */

    address : <0x0002ddb2> { ___enable_irq + 0x4e }

    address : <0x0000dd0e> { _task_tick_fair + 0x3e }

    address : <0x03634a0c> /* kernel dynamic memory */

    address : <0x0000a62a> { _update_curr + 0x62 }

    address : <0x000c5ab6> { _bfin_serial_rx_dma_timeout + 0xce }

    address : <0x000bf0ac> { _flush_to_ldisc + 0xb4 }

    address : <0x001296dc> { _option_indat_callback + 0x108 }

    address : <0x00009c74> { _activate_task + 0x34 }

    address : <0x0011037a> { _usb_hcd_giveback_urb + 0x42 }

    address : <0x0011dd12> { _isp1362_read_buffer + 0x16 }

    address : <0x0011e622> { _finish_request + 0x36 }

    address : <0x0011db82> { _prepare_ptd + 0x26e }

    address : <0x0011eab2> { _postproc_ep + 0x156 }

    address : <0x0011df82> { _submit_req + 0x1e }

    address : <0x0011ef44> { _finish_transfers + 0x144 }

    address : <0x0011037a> { _usb_hcd_giveback_urb + 0x42 }

    address : <0x0011e42c> { _start_atl_transfers + 0x60 }

    address : <0x0011faea> { _isp1362_irq + 0x72a }

    address : <0x0014b090> { _sock_alloc_send_skb + 0x1e4 }

    address : <0x00017cd6> { _update_process_times + 0x1e }

    address : <0x00110698> { _usb_hcd_irq + 0x2c }

    address : <0x0002d736> { _handle_IRQ_event + 0x36 }

    address : <0x0002f018> { _handle_level_irq + 0x9c }

    address : <0x0002efd0> { _handle_level_irq + 0x54 }

    address : <0x00008dda> { _bfin_demux_gpio_irq + 0x72 }

    address : <0x000146ae> { _irq_enter + 0xa }

    address : <0x0000a62a> { _update_curr + 0x62 }

    address : <0x00010ed6> { _do_syslog + 0xce }

    address : <0x00040e04> { _sys_write + 0x30 }

    address : <0x030a8c72> [ klogd + 0x28c32 ]

---[ end trace 1979529e0cca9675 ]---

------------[ cut here ]------------

WARNING: at drivers/usb/serial/usb-serial.c:313 _serial_write+0x8e/0x90()

Modules linked in:

Hardware Trace:

   0 Target : <0x00004aa0> { _dump_stack + 0x0 }

     Source : <0x0000fde0> { _warn_on_slowpath + 0x44 } CALL pcrel

   1 Target : <0x0000fde0> { _warn_on_slowpath + 0x44 }

     Source : <0x0002aab6> { _print_modules + 0x7a } RTS

   2 Target : <0x0002aab0> { _print_modules + 0x74 }

     Source : <0x000103c6> { _printk + 0x16 } RTS

   3 Target : <0x000103c2> { _printk + 0x12 }

     Source : <0x00010c5e> { _vprintk + 0x132 } RTS

   4 Target : <0x00010c52> { _vprintk + 0x126 }

     Source : <0x00010c44> { _vprintk + 0x118 } IF !CC JUMP

   5 Target : <0x00010c3c> { _vprintk + 0x110 }

     Source : <0x00010d82> { _vprintk + 0x256 } JUMP.S

   6 Target : <0x00010d82> { _vprintk + 0x256 }

     Source : <0x0001023a> { _wake_up_klogd + 0x1a } RTS

   7 Target : <0x0001023a> { _wake_up_klogd + 0x1a }

     Source : <0x0001022c> { _wake_up_klogd + 0xc } IF !CC JUMP

   8 Target : <0x00010220> { _wake_up_klogd + 0x0 }

     Source : <0x0001064e> { _release_console_sem + 0x1ae } JUMP.L

   9 Target : <0x00010646> { _release_console_sem + 0x1a6 }

     Source : <0x0001062a> { _release_console_sem + 0x18a } IF !CC JUMP

  10 Target : <0x0001061e> { _release_console_sem + 0x17e }

     Source : <0x000235a2> { _up + 0x3e } RTS

  11 Target : <0x0002359c> { _up + 0x38 }

     Source : <0x0002358e> { _up + 0x2a } IF !CC JUMP

  12 Target : <0x00023564> { _up + 0x0 }

     Source : <0x0001061a> { _release_console_sem + 0x17a } CALL pcrel

  13 Target : <0x00010606> { _release_console_sem + 0x166 }

     Source : <0x000104ee> { _release_console_sem + 0x4e } IF !CC JUMP

  14 Target : <0x000104c2> { _release_console_sem + 0x22 }

     Source : <0x000105e8> { _release_console_sem + 0x148 } IF CC JUMP

  15 Target : <0x000105e0> { _release_console_sem + 0x140 }

     Source : <0x0001019a> { __call_console_drivers + 0x7a } RTS

Stack info:

SP: [0x034f1984] <0x034f1984> /* kernel dynamic memory */

FP: (0x034f1ad4)

Memory from 0x034f1980 to 034f2000

034f1980: 0000008e [0000fde0]<0000fde4> 034f19a4  0029d414  00000041  0029d414  00000139

034f19a0: 034f19a4  7265735f  5f6c6169  74697277  78302b65  302f6538  00303978  034f19c0

034f19c0: 7265735f  5f6c6169  74697277  6f725f65  302b6d6f  2f653678  30377830  6462b000

034f19e0: 05a3e419  e300326b  48006903  304e180d  6481a0f0  e300325d  0c007ff1  325d1805

034f1a00: e3ff6000  a1301b83  01276ca6  00100485  e80005ec  32390004  008de51a  0055e418

034f1a20: 0019326b  93100056  e3003047  e52a68e1  e4280007  325d0057  e3ff9154  00001c43

034f1a40: 10093028  e42f325d  3007056b  e3ff302f  642d1c89  68075f27  30079127  325d6179

034f1a60: 1dcae3ff  180c0c00  325d3007  667ee300  1c220c00  9120325d  fffff3ff  01312d00

034f1a80: 00000400 <00126d1a> 03502c00  00000001  034f1ad0  00000000  034f1ac0 <0000a6b2>

034f1aa0:<00126c8a> 03502c00 <000b8e7a> 034d7400  034d7400  00000041  00000010  0000ffff

034f1ac0:<000bb730><000bb730><000bb7a8> 034f1af8  001ffc41 (00000000)<000bc76c> 03640320

034f1ae0: 00000001  00000010  ffffefce  01312d00  00000400  00000006  000fce9a  0360fc27

034f1b00: 003d0900  00000000  fffff7ff  01312d00  00000400  00000006  001ffc00  00000000

034f1b20: 003d0900  00000000  034f1b50 <0000a6b2> 00000000 <03634a0c> 00000000  00000000

034f1b40: 034f1b6c <0002ddb2> 002dad84  0000ffff  00000100 <0000dd0e> 00000000 <03634a0c>

034f1b60: 034f1b8c <0000a62a> 00000000  00000000  00000000  00000001 <000c5ab6> 002bd65c

034f1b80: 034f0000  a5a1ae00  003d08fb  034f1bb8  034d7414 <000bf0ac> 0360fc00  034d7400

034f1ba0: 034d747c  0360fd1c  0000003f  00000000  0362a4d4  00000001  034f1be8  034f1be8

034f1bc0: 00000001  03640268 <001296dc> 036568c0  002d2e38  03502c00  034d7400  03506000

034f1be0: 00000001  00000000  034f1c00 <00009c74> 002c2418 <0011037a> 036568c0  0362a400

034f1c00: 03620c00  00000000  0362a4d4  000044d0  11228c00  003d08f0 <0011dd12><0011e622>

034f1c20: 036568c0  03640260  0362a400  00000000 <0011db82> 000003ff <0011eab2> 036568c0

034f1c40: 03640260  00000000  00001000  00000100 <0011df82> 03640260  00000000  0362a58c

034f1c60:<0011ef44> 03640260  0362a554  0362a57c  0000000e  00000001  0000001f  0000000e

034f1c80: 00000000  034f1ca8 <0011037a> 00000000  0362a57c <0011e42c> 03640260  0362a51c

034f1ca0: 0362a4d4  00000000  00000000  00000000  0362a4d4  0362a588  0362a59c  034f1d2c

034f1cc0:<0011faea> 0362a400  00000022  0000002c  0000000c  00000001  00000100  0362a4d4

034f1ce0: 0362a4d4  00000000 <0014b090> ffffff94  034f1dcc  00000000  00000000  000004d0

034f1d00: 00000041  0302ec60  00000000 <00017cd6> ffffffff  034f1d14  00000100  00000000

034f1d20: 0362a64c  00000100  0362a60c  002d8694 <00110698> 0362a400  00000022  0000002c

034f1d40: 0000003f  0000ffff  00000022  000003ff  0362a400  034f1d50  00000000 <0002d736>

034f1d60: 03635440  00000000  00000000 <0002f018> 002db090  00000022 <0002efd0> 002db090

034f1d80: 00000000  00000022  00000000  00000005  034f1e9c  000003e3 <00008dda> 002cfe68

034f1da0: 002c2cb0  00000000  00000041  002d8694 <000146ae> ffa08318  0000001a  00000000

034f1dc0: 030de58b  034f1d5c  034f1dcc  00000000  ffa08bb4  002c2cb0  00000030  0000014b

034f1de0: 00000000  034f1e10 <0000a62a> 00010ec2  02002000  00002000  00000000  03124000

034f1e00: 0312a1b6  00010ec2 <00010ed6> 0000000c  02002000  0312aecd  0011ccca  0312ae86

034f1e20: 0011ccca  00000000  00000000  00000938  00000000  003d08fb  00000000  00000000

034f1e40: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

034f1e60: 00000000  00000000  00000000  00000000  00000000  03114004  00000008  030e6eac

034f1e80: 002d8694  002c2cb0  002c2cb0  0000002c  002c44c9  00001789  002d8d30  00000030

034f1ea0: 0000014b  030de58b  000003ff  030de58a  0000978a  00000000  0000ffff  0000ffff

034f1ec0: 002d8d30  00000006  00000000 <00040e04> 003b6aa0  00000000  036349e0  0002006c

034f1ee0: 034f1ee0  034f1ee0  030e6eb8  ffa08880  00011120  00000067  0000002c  00000000

034f1f00: ffffe000  00000000  00000002  030de29c  0000002c  030de4db  030de440  00000002

034f1f20: 00000000  03081dec  00008000  00002000  00000000  034f2000  03081dec  03081dec

034f1f40:<030a8c72> ffa08ef8  02001024  0308b1ad  0308c347  0308b1ac  0308c346  00000000

034f1f60: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

034f1f80: 00000000  00000000  00000000  00000000  00000000  00000000  00000000  00000000

034f1fa0: 00000000  00000000  00000000  030dceac  030e6de0  030e6eac  030e6eb8  00000000

034f1fc0: 030de29c  0000002c  030de440  030de444  00000067  030de440  030de440  00000000

034f1fe0: 00000002  030de440  000003ff  030de440  00000002  00000002  00000067  00000006

Return addresses in stack:

    address : <0x0000fde0> { _warn_on_slowpath + 0x44 }

    address : <0x0000fde4> { _warn_on_slowpath + 0x48 }

    address : <0x00126d1a> { _serial_write + 0x8e }

    address : <0x0000a6b2> { _sched_slice + 0x42 }

    address : <0x00126c8a> { _serial_write_room + 0x6e }

    address : <0x000b8e7a> { _tty_put_char + 0x26 }

    address : <0x000bb730> { _opost + 0x10 }

    address : <0x000bb730> { _opost + 0x10 }

    address : <0x000bb7a8> { _opost + 0x88 }

   frame  1 : <0x000bc76c> { _n_tty_receive_buf + 0x300 }

    address : <0x0000a6b2> { _sched_slice + 0x42 }

    address : <0x03634a0c> /* kernel dynamic memory */

    address : <0x0002ddb2> { ___enable_irq + 0x4e }

    address : <0x0000dd0e> { _task_tick_fair + 0x3e }

    address : <0x03634a0c> /* kernel dynamic memory */

    address : <0x0000a62a> { _update_curr + 0x62 }

    address : <0x000c5ab6> { _bfin_serial_rx_dma_timeout + 0xce }

    address : <0x000bf0ac> { _flush_to_ldisc + 0xb4 }

    address : <0x001296dc> { _option_indat_callback + 0x108 }

    address : <0x00009c74> { _activate_task + 0x34 }

    address : <0x0011037a> { _usb_hcd_giveback_urb + 0x42 }

    address : <0x0011dd12> { _isp1362_read_buffer + 0x16 }

    address : <0x0011e622> { _finish_request + 0x36 }

    address : <0x0011db82> { _prepare_ptd + 0x26e }

    address : <0x0011eab2> { _postproc_ep + 0x156 }

    address : <0x0011df82> { _submit_req + 0x1e }

    address : <0x0011ef44> { _finish_transfers + 0x144 }

    address : <0x0011037a> { _usb_hcd_giveback_urb + 0x42 }

    address : <0x0011e42c> { _start_atl_transfers + 0x60 }

    address : <0x0011faea> { _isp1362_irq + 0x72a }

    address : <0x0014b090> { _sock_alloc_send_skb + 0x1e4 }

    address : <0x00017cd6> { _update_process_times + 0x1e }

    address : <0x00110698> { _usb_hcd_irq + 0x2c }

    address : <0x0002d736> { _handle_IRQ_event + 0x36 }

    address : <0x0002f018> { _handle_level_irq + 0x9c }

    address : <0x0002efd0> { _handle_level_irq + 0x54 }

    address : <0x00008dda> { _bfin_demux_gpio_irq + 0x72 }

    address : <0x000146ae> { _irq_enter + 0xa }

    address : <0x0000a62a> { _update_curr + 0x62 }

    address : <0x00010ed6> { _do_syslog + 0xce }

    address : <0x00040e04> { _sys_write + 0x30 }

    address : <0x030a8c72> [ klogd + 0x28c32 ]

---[ end trace 1979529e0cca9675 ]---

QuoteReplyEditDelete

 

 

2010-09-24 11:18:01     Re: Issues regarding fopen and binary streams on uclinux

Mike Frysinger (UNITED STATES)

Message: 93822   

 

look at the message.  it quite clearly states where the warning is coming from, and it isnt the application:

WARNING: at drivers/usb/serial/usb-serial.c:326 _serial_write_room+0x6e/0x70()

QuoteReplyEditDelete

 

 

2010-09-27 01:35:24     Re: Issues regarding fopen and binary streams on uclinux

Usama Shakeel (PAKISTAN)

Message: 93866   

 

Thanx for the reply Mike,

 

 

 

Mike I can see that its usb-serial causing the warning. But I am unable to interpret this warning. Is my application having lesser stack size or what ..?

 

I tried having it run by bigger stack size as well. but the result was same. If the program with this warning is run twice, it causes Linux to crash. I dont know the details of this stuff. If you could be kind enough to let me know what are the possible problems which can cause such kind of behaviour...

 

 

 

Regards

 

Usama Bin Shakeel

QuoteReplyEditDelete

 

 

2010-09-27 02:34:23     Re: Issues regarding fopen and binary streams on uclinux

Mike Frysinger (UNITED STATES)

Message: 93867   

 

look at the source code in question to find out why it is warning

QuoteReplyEditDelete

Attachments

Outcomes