Giter VIP home page Giter VIP logo

simplecvariablesizevector's Introduction

simplecvariablesizevector's People

Contributors

anders1232 avatar

Stargazers

Marcelo avatar  avatar Pedro Abreu avatar

Watchers

James Cloos avatar Pedro Abreu avatar  avatar

simplecvariablesizevector's Issues

Memory error after the second call to resize

Code to reproduce the example: https://github.com/Anders1232/SimpleSocketProgram/tree/c3bf5329389772360e98217a28a879fa25817877

It happens on both vectors used on the code.

Valgrind output:
==4629== Invalid write of size 2
==4629== at 0x4C2F19B: memcpy@GLIBC_2.2.5 (vg_replace_strmem.c:1017)
==4629== by 0x400F11: VectorAppendCopy (vector.c:46)
==4629== by 0x401319: TcpServer (servidor.c:146)
==4629== by 0x401198: main (servidor.c:79)
==4629== Address 0x53f2b2c is 0 bytes after a block of size 60 alloc'd
==4629== at 0x4C2CDCF: realloc (vg_replace_malloc.c:785)
==4629== by 0x400E2C: Resize (vector.c:24)
==4629== by 0x400E97: VectorAllocateOne (vector.c:36)
==4629== by 0x400ED0: VectorAppendCopy (vector.c:44)
==4629== by 0x401319: TcpServer (servidor.c:146)
==4629== by 0x401198: main (servidor.c:79)
==4629==
==4629== Invalid write of size 8
==4629== at 0x4E3EBEF: pthread_create@@GLIBC_2.2.5 (pthread_create.c:631)
==4629== by 0x40135D: TcpServer (servidor.c:146)
==4629== by 0x401198: main (servidor.c:79)
==4629== Address 0x53f2b88 is 0 bytes after a block of size 24 alloc'd
==4629== at 0x4C2CDCF: realloc (vg_replace_malloc.c:785)
==4629== by 0x400E2C: Resize (vector.c:24)
==4629== by 0x400E97: VectorAllocateOne (vector.c:36)
==4629== by 0x401338: TcpServer (servidor.c:147)
==4629== by 0x401198: main (servidor.c:79)
==4629==
==4629== Thread 2:
==4629== Invalid read of size 8
==4629== at 0x4013FB: ConnectionEstabilished (servidor.c:163)
==4629== by 0x4E3E463: start_thread (pthread_create.c:333)
==4629== Address 0x53f2b2c is 0 bytes after a block of size 60 alloc'd
==4629== at 0x4C2CDCF: realloc (vg_replace_malloc.c:785)
==4629== by 0x400E2C: Resize (vector.c:24)
==4629== by 0x400E97: VectorAllocateOne (vector.c:36)
==4629== by 0x400ED0: VectorAppendCopy (vector.c:44)
==4629== by 0x401319: TcpServer (servidor.c:146)
==4629== by 0x401198: main (servidor.c:79)
==4629==
==4629== Invalid read of size 8
==4629== at 0x401402: ConnectionEstabilished (servidor.c:163)
==4629== by 0x4E3E463: start_thread (pthread_create.c:333)
==4629== Address 0x53f2b34 is 8 bytes after a block of size 60 alloc'd
==4629== at 0x4C2CDCF: realloc (vg_replace_malloc.c:785)
==4629== by 0x400E2C: Resize (vector.c:24)
==4629== by 0x400E97: VectorAllocateOne (vector.c:36)
==4629== by 0x400ED0: VectorAppendCopy (vector.c:44)
==4629== by 0x401319: TcpServer (servidor.c:146)
==4629== by 0x401198: main (servidor.c:79)
==4629==
==4629== Invalid read of size 4
==4629== at 0x40140A: ConnectionEstabilished (servidor.c:163)
==4629== by 0x4E3E463: start_thread (pthread_create.c:333)
==4629== Address 0x53f2b3c is 16 bytes after a block of size 60 alloc'd
==4629== at 0x4C2CDCF: realloc (vg_replace_malloc.c:785)
==4629== by 0x400E2C: Resize (vector.c:24)
==4629== by 0x400E97: VectorAllocateOne (vector.c:36)
==4629== by 0x400ED0: VectorAppendCopy (vector.c:44)
==4629== by 0x401319: TcpServer (servidor.c:146)
==4629== by 0x401198: main (servidor.c:79)
==4629==

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.