Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Release build seg faults at vector push_back

Release build seg faults at vector push_back

Scheduled Pinned Locked Moved ATL / WTL / STL
helpcsharpc++graphicsdebugging
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rana74
    wrote on last edited by
    #1

    i'm currently experiencing a strange problem under vc++ .NET 7.0. i hope someone has a hint for me, i'm kind of lost atm. i'm using a vector of object instances in my code. using the release build,I get a runtime error intermittently while adding to the vector using push_back. When i use the debug build. i can add as much elements as i want without any problems . Is there any special setting to be done for reease build? It is is simple as EMEventContainer instance("key","value"); this_vector.push_back(instance); But it does not work properly in release build.

    L V Z 3 Replies Last reply
    0
    • R rana74

      i'm currently experiencing a strange problem under vc++ .NET 7.0. i hope someone has a hint for me, i'm kind of lost atm. i'm using a vector of object instances in my code. using the release build,I get a runtime error intermittently while adding to the vector using push_back. When i use the debug build. i can add as much elements as i want without any problems . Is there any special setting to be done for reease build? It is is simple as EMEventContainer instance("key","value"); this_vector.push_back(instance); But it does not work properly in release build.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      rana74 wrote:

      Is there any special setting to be done for reease build?

      No. You have a bug.

      "Alot of the people on this forum are incredibly stupid, thinking that the internet is real"
      Score: 1.0 in the Soap Box

      led mike

      1 Reply Last reply
      0
      • R rana74

        i'm currently experiencing a strange problem under vc++ .NET 7.0. i hope someone has a hint for me, i'm kind of lost atm. i'm using a vector of object instances in my code. using the release build,I get a runtime error intermittently while adding to the vector using push_back. When i use the debug build. i can add as much elements as i want without any problems . Is there any special setting to be done for reease build? It is is simple as EMEventContainer instance("key","value"); this_vector.push_back(instance); But it does not work properly in release build.

        V Offline
        V Offline
        valikac
        wrote on last edited by
        #3

        post copy constructor of EMEventContainer dynamic allocations inside EMEventContainer? Kuphryn

        1 Reply Last reply
        0
        • R rana74

          i'm currently experiencing a strange problem under vc++ .NET 7.0. i hope someone has a hint for me, i'm kind of lost atm. i'm using a vector of object instances in my code. using the release build,I get a runtime error intermittently while adding to the vector using push_back. When i use the debug build. i can add as much elements as i want without any problems . Is there any special setting to be done for reease build? It is is simple as EMEventContainer instance("key","value"); this_vector.push_back(instance); But it does not work properly in release build.

          Z Offline
          Z Offline
          Zac Howland
          wrote on last edited by
          #4

          This is usually a sign that you have some memory issues elsewhere in your code. Debug builds allocate extra space before and after sections of memory to help indicate if you have any buffer overrun issues. Release builds don't have that, so if you do have such a problem, you will corrupt memory rather quickly. Things to look for are the constructor of the EMEventContainer object, its copy constructor, its copy assignment operator, any heap allocations within that class, and if you are using multiple threads, any unprotected accesses to an STL container.

          If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups