×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    44

    Midlet crashes with Buffer overflow

    Sometimes on the Nokia 6230 the midlet crashes with the message:

    Buffer overflow in getStringContentsSafely()

    Does anyone know what this message means or when this method is called?

  2. #2
    Registered User
    Join Date
    Jul 2003
    Location
    Finland, Tampere
    Posts
    1,113
    Look like a bug in Nokia implementation

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    3
    I get this consistently when trying to open connections in one thread and doing other things in other threads.

    It seems to occur during the connection opening phase.

    Using 6230

    Anyone know a fix?

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    1
    I have the same problem on a 6310i, does anyone already has an answer?

  5. #5
    Registered User
    Join Date
    Mar 2005
    Posts
    9

    Re: Midlet crashes with Buffer overflow

    Hello,

    I have the same problem when trying to make an Http connection. Error messages are:

    Buffer overflow in getStringContentsSafely()

    Warning. Traffic View: Listing of TCP/UDP Sent traffic is set to off (see Filters)

    Warning. Traffic View: Listing of TCP/UDP Received traffic is set to off (see Filters)


    Does anyone have a solution ?

    Thank you very much

    Jerome

  6. #6
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: Midlet crashes with Buffer overflow

    Can we see the code?

    Daniel

  7. #7
    Registered User
    Join Date
    May 2006
    Posts
    2

    Re: Midlet crashes with Buffer overflow

    I had this problem. In my case it was due to one of the HTTP headers being too large.

    Code:
    httpConnection.setRequestProperty("customHeader", bigString);
    where bigString was about 1K.

    John Vaudin

  8. #8
    Registered User
    Join Date
    Nov 2006
    Posts
    1

    Re: Midlet crashes with Buffer overflow

    I, too, get the TCP/UDP error messages, were you able to find a fix for it?

    Thanks!
    Glenn

  9. #9
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    62

    Re: Midlet crashes with Buffer overflow

    Hi all,
    When started my application after accessing the net work,
    same error is getting me also "buffer overflow in get string contents safely () " is displaying when selected the details of this error.
    if any idea plz share .


    regards
    rakesh

  10. #10
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Midlet crashes with Buffer overflow

    @rakesh,
    Have you checked the HTTP headers as mentioned in the previous post by John?

    Regards
    Gopal

    __________________
    MobiQuil.com
    An initiative by Developers for Developers.
    http://www.mobiquil.com - Alpha - Launched.

  11. #11
    Regular Contributor
    Join Date
    Dec 2005
    Posts
    62

    Re: Midlet crashes with Buffer overflow

    hi all,
    anyone got any idea about getStringContentsSafely()

    if have plz share urgent.


    regards
    rakesh

  12. #12
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Midlet crashes with Buffer overflow

    berrysxxx Posted

    " get this consistently when trying to open connections in one thread and doing other things in other threads."

    if you have two threads running simulateneouly then you have to be a little careful. First of all problem the way i see it is, if you are using resources in one thread and then you use the same resources in another thread then problem may come when any one thread is trying to access a resource which hasnt been released by other thread. in this case exception do occur like overflow buffer or internal error. so what u can do manage your threads you can set piorities or make sure that if one thread is still using some resource which is being required by another thread then first thread should wait.

    if you are not using any threads whatsoever then check your http headers.
    Regards
    Nouman

  13. #13
    Registered User
    Join Date
    Apr 2007
    Posts
    19

    Re: Midlet crashes with Buffer overflow

    Hi,

    i get the Buffer overflow in getStringContentsSafely()
    with my Nokia 6230i, the same code runs fine with Sony k320i
    and in the emulator.

    How can i track this down, is there any workaround available?

    Thanks
    Marcel

  14. #14
    Registered User
    Join Date
    Jan 2006
    Location
    Argentina
    Posts
    24

    Re: Midlet crashes with Buffer overflow

    Hi everyone

    I have the exact same problem and it really seems it's due to a large chunk of bytes being sent by the client on one of the HTTP headers.

    I'll try to handle it by chopping down the headers or something. I'll let you know!

    [...]

    Yes it was clearly solved by placing the data I needed to send over the network in several http headers. Apparently series 40 implementation has some static buffer that is overrun around 512 bytes.
    It would be wise to make several tests as to see how many headers can be placed there. Anyway most data should be sent over HTTP POST, but that's exactly what I wanted to avoid, because some servers (IIS for instance) could answer with some HTTP 100 Continue responses which is not handled by the phone's native implementation and I don't want to do it myself. Anyone has solved this yet?

    Regards,
    Mario
    Last edited by mariozorz; 2008-02-25 at 04:19.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×