473,881 Members | 1,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Valgrind says "Invalid read of size 4". What's the problem?


Valgrind says

==11604== Invalid read of size 4
==11604== at 0x8048ABB: main (foo.cc:36)
==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
==11604==
==11604== Invalid read of size 4
==11604== at 0x8048ABE: main (foo.cc:36)
==11604== Address 0x1B924158 is 0 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )

When this program is run with the command

valgrind --tool=memcheck --leak-check=yes -v ./foo

The complete valgrind output is at the end of this message.

This is not the real program but only the smallest possible
program that shows the error. The real program crashes
with segmentation fault.

=============== ==============
//Compile command: g++ -g -Wall -O0 foo.cc -o foo

#include <vector>
#include <iostream>
#include <cstdlib>

using namespace std;

struct Foo {
double x;
Foo() : x (0) {}
Foo (const double a) : x (a) {}
};
struct Bar {
vector<Foo> foo;
Bar (const Foo &f)
{
foo.push_back (f);
}
};
int main()
{
vector<Bar> bar;

const size_t N = 10;

for (size_t i = 0; i < N; i++) {
bar.push_back (Bar(Foo(i)));
for (size_t j = 0; j < bar.size()-1; j++) {
const Foo &f = bar[j].foo.back();
bar[j].foo.push_back (Foo(j));
cout << f.x << endl; // Line 36.
}
}

return 0;
}
=============== ==============
==11604== Memcheck, a memory error detector for x86-linux.
==11604== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==11604== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==11604== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==11604== Valgrind library directory: /usr/local/lib/valgrind
==11604== Command line
==11604== ./foo
==11604== Startup, with flags:
==11604== --tool=memcheck
==11604== --leak-check=yes
==11604== -v
==11604== Contents of /proc/version:
==11604== Linux version 2.6.10-1.760_FC3smp (bh*******@bugs .build.redhat.c om) (gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)) #1 SMP Wed Feb 2 00:29:03 EST 2005
==11604== Reading syms from /home/hvaisane/foo (0x8048000)
==11604== Reading syms from /lib/ld-2.3.4.so (0x1B8E4000)
==11604== object doesn't have any debug info
==11604== Reading syms from /usr/local/lib/valgrind/stage2 (0xB0000000)
==11604== Reading syms from /lib/ld-2.3.4.so (0xB1000000)
==11604== object doesn't have any debug info
==11604== Reading syms from /usr/local/lib/valgrind/vgskin_memcheck .so (0xB7C91000)
==11604== Reading syms from /lib/tls/libc-2.3.4.so (0xB7EBA000)
==11604== object doesn't have any debug info
==11604== Reading syms from /lib/libdl-2.3.4.so (0xB7FE4000)
==11604== object doesn't have any debug info
==11604== Reading suppressions file: /usr/local/lib/valgrind/default.supp
==11604== REDIRECT soname:libc.so. 6(__GI___errno_ location) to soname:libpthre ad.so.0(__errno _location)
==11604== REDIRECT soname:libc.so. 6(__errno_locat ion) to soname:libpthre ad.so.0(__errno _location)
==11604== REDIRECT soname:libc.so. 6(__GI___h_errn o_location) to soname:libpthre ad.so.0(__h_err no_location)
==11604== REDIRECT soname:libc.so. 6(__h_errno_loc ation) to soname:libpthre ad.so.0(__h_err no_location)
==11604== REDIRECT soname:libc.so. 6(__GI___res_st ate) to soname:libpthre ad.so.0(__res_s tate)
==11604== REDIRECT soname:libc.so. 6(__res_state) to soname:libpthre ad.so.0(__res_s tate)
==11604== REDIRECT soname:libc.so. 6(stpcpy) to *vgpreload_memc heck.so*(stpcpy )
==11604== REDIRECT soname:libc.so. 6(strnlen) to *vgpreload_memc heck.so*(strnle n)
==11604== REDIRECT soname:ld-linux.so.2(stpc py) to *vgpreload_memc heck.so*(stpcpy )
==11604== REDIRECT soname:ld-linux.so.2(strc hr) to *vgpreload_memc heck.so*(strchr )
==11604==
==11604== Reading syms from /usr/local/lib/valgrind/vg_inject.so (0x1B8FE000)
==11604== Reading syms from /usr/local/lib/valgrind/vgpreload_memch eck.so (0x1B901000)
==11604== TRANSLATE: 0x1B8F5AE0 redirected to 0x1B90420C
==11604== Reading syms from /usr/lib/libstdc++.so.6. 0.3 (0xCAC000)
==11604== object doesn't have a symbol table
==11604== object doesn't have any debug info
==11604== Reading syms from /lib/tls/libm-2.3.4.so (0xAA6000)
==11604== object doesn't have any debug info
==11604== Reading syms from /lib/libgcc_s-3.4.2-20041018.so.1 (0xCA2000)
==11604== object doesn't have a symbol table
==11604== object doesn't have any debug info
==11604== Reading syms from /lib/tls/libc-2.3.4.so (0x97A000)
==11604== object doesn't have any debug info
==11604== TRANSLATE: 0xD4D930 redirected to 0x1B904B7B
==11604== TRANSLATE: 0xD4C424 redirected to 0x1B9050CE
==11604== Invalid read of size 4
==11604== at 0x8048ABB: main (foo.cc:36)
==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
==11604==
==11604== Invalid read of size 4
==11604== at 0x8048ABE: main (foo.cc:36)
==11604== Address 0x1B924158 is 0 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
==11604== TRANSLATE: 0x1B8E47A0 redirected to 0x52BFF040
0
0
1
0
1
2
0
1
2
3
0
1
2
3
4
0
1
2
3
4
5
0
1
2
3
4
5
6
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
8
==11604== TRANSLATE: 0x9DBA70 redirected to 0x1B904F30
==11604==
==11604== ERROR SUMMARY: 56 errors from 2 contexts (suppressed: 15 from 1)
==11604==
==11604== 28 errors in context 1 of 2:
==11604== Invalid read of size 4
==11604== at 0x8048ABE: main (foo.cc:36)
==11604== Address 0x1B924158 is 0 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
==11604==
==11604== 28 errors in context 2 of 2:
==11604== Invalid read of size 4
==11604== at 0x8048ABB: main (foo.cc:36)
==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
--11604--
--11604-- supp: 15 dl_relocate_obj ect/dl_main
==11604==
==11604== IN SUMMARY: 56 errors from 2 contexts (suppressed: 15 from 1)
==11604==
==11604== malloc/free: in use at exit: 0 bytes in 0 blocks.
==11604== malloc/free: 68 allocs, 68 frees, 2196 bytes allocated.
==11604==
==11604== No malloc'd blocks -- no leaks are possible.
--11604-- TT/TC: 0 tc sectors discarded.
--11604-- 3507 tt_fast misses.
--11604-- translate: new 3329 (61827 -> 812144; ratio 131:10)
--11604-- discard 1 (23 -> 320; ratio 139:10).
--11604-- chainings: 2258 chainings, 2 unchainings.
--11604-- dispatch: 250000 jumps (bb entries); of them 39279 (15%) unchained.
--11604-- 166/3937 major/minor sched events.
--11604-- reg-alloc: 787 t-req-spill, 150297+6325 orig+spill uis,
--11604-- 18341 total-reg-rank
--11604-- sanity: 167 cheap, 7 expensive checks.
--11604-- ccalls: 15511 C calls, 55% saves+restores avoided (50450 bytes)
--11604-- 20825 args, avg 0.87 setup instrs each (5226 bytes)
--11604-- 0% clear the stack (46404 bytes)
--11604-- 5874 retvals, 32% of reg-reg movs avoided (3644 bytes)

Jul 23 '05 #1
2 22858
hv******@cc.joe nsuu.fi wrote:
Valgrind says

==11604== Invalid read of size 4
==11604== at 0x8048ABB: main (foo.cc:36)
==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
==11604==
==11604== Invalid read of size 4
==11604== at 0x8048ABE: main (foo.cc:36)
==11604== Address 0x1B924158 is 0 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )

When this program is run with the command

valgrind --tool=memcheck --leak-check=yes -v ./foo

The complete valgrind output is at the end of this message.

This is not the real program but only the smallest possible
program that shows the error. The real program crashes
with segmentation fault.

=============== ==============
//Compile command: g++ -g -Wall -O0 foo.cc -o foo

#include <vector>
#include <iostream>
#include <cstdlib>

using namespace std;

struct Foo {
double x;
Foo() : x (0) {}
Foo (const double a) : x (a) {}
};
struct Bar {
vector<Foo> foo;
Bar (const Foo &f)
{
foo.push_back (f);
}
};
int main()
{
vector<Bar> bar;

const size_t N = 10;

for (size_t i = 0; i < N; i++) {
bar.push_back (Bar(Foo(i)));
for (size_t j = 0; j < bar.size()-1; j++) {
const Foo &f = bar[j].foo.back();
bar[j].foo.push_back (Foo(j));
cout << f.x << endl; // Line 36.
}
}

return 0;
}
=============== ==============
==11604== Memcheck, a memory error detector for x86-linux.
==11604== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==11604== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==11604== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==11604== Valgrind library directory: /usr/local/lib/valgrind
==11604== Command line
==11604== ./foo
==11604== Startup, with flags:
==11604== --tool=memcheck
==11604== --leak-check=yes
==11604== -v
==11604== Contents of /proc/version:
==11604== Linux version 2.6.10-1.760_FC3smp (bh*******@bugs .build.redhat.c om) (gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)) #1 SMP Wed Feb 2 00:29:03 EST 2005
==11604== Reading syms from /home/hvaisane/foo (0x8048000)
==11604== Reading syms from /lib/ld-2.3.4.so (0x1B8E4000)
==11604== object doesn't have any debug info
==11604== Reading syms from /usr/local/lib/valgrind/stage2 (0xB0000000)
==11604== Reading syms from /lib/ld-2.3.4.so (0xB1000000)
==11604== object doesn't have any debug info
==11604== Reading syms from /usr/local/lib/valgrind/vgskin_memcheck .so (0xB7C91000)
==11604== Reading syms from /lib/tls/libc-2.3.4.so (0xB7EBA000)
==11604== object doesn't have any debug info
==11604== Reading syms from /lib/libdl-2.3.4.so (0xB7FE4000)
==11604== object doesn't have any debug info
==11604== Reading suppressions file: /usr/local/lib/valgrind/default.supp
==11604== REDIRECT soname:libc.so. 6(__GI___errno_ location) to soname:libpthre ad.so.0(__errno _location)
==11604== REDIRECT soname:libc.so. 6(__errno_locat ion) to soname:libpthre ad.so.0(__errno _location)
==11604== REDIRECT soname:libc.so. 6(__GI___h_errn o_location) to soname:libpthre ad.so.0(__h_err no_location)
==11604== REDIRECT soname:libc.so. 6(__h_errno_loc ation) to soname:libpthre ad.so.0(__h_err no_location)
==11604== REDIRECT soname:libc.so. 6(__GI___res_st ate) to soname:libpthre ad.so.0(__res_s tate)
==11604== REDIRECT soname:libc.so. 6(__res_state) to soname:libpthre ad.so.0(__res_s tate)
==11604== REDIRECT soname:libc.so. 6(stpcpy) to *vgpreload_memc heck.so*(stpcpy )
==11604== REDIRECT soname:libc.so. 6(strnlen) to *vgpreload_memc heck.so*(strnle n)
==11604== REDIRECT soname:ld-linux.so.2(stpc py) to *vgpreload_memc heck.so*(stpcpy )
==11604== REDIRECT soname:ld-linux.so.2(strc hr) to *vgpreload_memc heck.so*(strchr )
==11604==
==11604== Reading syms from /usr/local/lib/valgrind/vg_inject.so (0x1B8FE000)
==11604== Reading syms from /usr/local/lib/valgrind/vgpreload_memch eck.so (0x1B901000)
==11604== TRANSLATE: 0x1B8F5AE0 redirected to 0x1B90420C
==11604== Reading syms from /usr/lib/libstdc++.so.6. 0.3 (0xCAC000)
==11604== object doesn't have a symbol table
==11604== object doesn't have any debug info
==11604== Reading syms from /lib/tls/libm-2.3.4.so (0xAA6000)
==11604== object doesn't have any debug info
==11604== Reading syms from /lib/libgcc_s-3.4.2-20041018.so.1 (0xCA2000)
==11604== object doesn't have a symbol table
==11604== object doesn't have any debug info
==11604== Reading syms from /lib/tls/libc-2.3.4.so (0x97A000)
==11604== object doesn't have any debug info
==11604== TRANSLATE: 0xD4D930 redirected to 0x1B904B7B
==11604== TRANSLATE: 0xD4C424 redirected to 0x1B9050CE
==11604== Invalid read of size 4
==11604== at 0x8048ABB: main (foo.cc:36)
==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
==11604==
==11604== Invalid read of size 4
==11604== at 0x8048ABE: main (foo.cc:36)
==11604== Address 0x1B924158 is 0 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
==11604== TRANSLATE: 0x1B8E47A0 redirected to 0x52BFF040
0
0
1
0
1
2
0
1
2
3
0
1
2
3
4
0
1
2
3
4
5
0
1
2
3
4
5
6
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
8
==11604== TRANSLATE: 0x9DBA70 redirected to 0x1B904F30
==11604==
==11604== ERROR SUMMARY: 56 errors from 2 contexts (suppressed: 15 from 1)
==11604==
==11604== 28 errors in context 1 of 2:
==11604== Invalid read of size 4
==11604== at 0x8048ABE: main (foo.cc:36)
==11604== Address 0x1B924158 is 0 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
==11604==
==11604== 28 errors in context 2 of 2:
==11604== Invalid read of size 4
==11604== at 0x8048ABB: main (foo.cc:36)
==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd
==11604== at 0x1B90514F: operator delete(void*) (vg_replace_mal loc.c:156)
==11604== by 0x804A1BA: __gnu_cxx::new_ allocator<Foo>: :deallocate(Foo *, unsigned) (new_allocator. h:86)
==11604== by 0x8049C08: std::_Vector_ba se<Foo, std::allocator< Foo> >::_M_deallocat e(Foo*, unsigned) (stl_vector.h:1 17)
==11604== by 0x80492A0: std::vector<Foo , std::allocator< Foo> >::_M_insert_au x(__gnu_cxx::__ normal_iterator <Foo*, std::vector<Foo , std::allocator< Foo> > >, Foo const&) (vector.tcc:264 )
--11604--
--11604-- supp: 15 dl_relocate_obj ect/dl_main
==11604==
==11604== IN SUMMARY: 56 errors from 2 contexts (suppressed: 15 from 1)
==11604==
==11604== malloc/free: in use at exit: 0 bytes in 0 blocks.
==11604== malloc/free: 68 allocs, 68 frees, 2196 bytes allocated.
==11604==
==11604== No malloc'd blocks -- no leaks are possible.
--11604-- TT/TC: 0 tc sectors discarded.
--11604-- 3507 tt_fast misses.
--11604-- translate: new 3329 (61827 -> 812144; ratio 131:10)
--11604-- discard 1 (23 -> 320; ratio 139:10).
--11604-- chainings: 2258 chainings, 2 unchainings.
--11604-- dispatch: 250000 jumps (bb entries); of them 39279 (15%) unchained.
--11604-- 166/3937 major/minor sched events.
--11604-- reg-alloc: 787 t-req-spill, 150297+6325 orig+spill uis,
--11604-- 18341 total-reg-rank
--11604-- sanity: 167 cheap, 7 expensive checks.
--11604-- ccalls: 15511 C calls, 55% saves+restores avoided (50450 bytes)
--11604-- 20825 args, avg 0.87 setup instrs each (5226 bytes)
--11604-- 0% clear the stack (46404 bytes)
--11604-- 5874 retvals, 32% of reg-reg movs avoided (3644 bytes)

you create in line 34 an alias to a location, which is not valid anymore
in line 36, because you modify bar[j].foo in line 35.
Jul 23 '05 #2
"Thomas Maier-Komor" <ma******@lpr .e-technik.no-spam.tu-muenchen.de>
wrote...
hv******@cc.joe nsuu.fi wrote:
Valgrind says
[...]

you create in line 34 an alias to a location, which is not valid anymore
in line 36, because you modify bar[j].foo in line 35.


I am just curious: did you have to quote two hundred lines just to add
your two?
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1890
by: Nicola George | last post by:
Hi all, I hope someone can help me as I'm going a bit metal with this problem. I have a project in ASP.NET, within this project I have Crystal Report called Catalogue. On an asp page I have a report viewer control (vwrReportViewer) and a report document control (reportDocument1). On the load of the page I have the following code. reportDocument1 = GetCatalogueSampleReport(DBConnectionString(this.Session),
0
1356
by: covadnews | last post by:
Hi, I upgraded from .NET to .NET 2003 (w/ Framework 1.1.4233). Now my ASP.NET Web Application dies trying to connect to SQL Server with an error "Invalid PInvoke metadata format". I have framework 1.1 installed on this system, but VS says my server (localhost) is running 1.0???? How do I convince IIS (on Win XP PRO) to use Dot Net Framework 1.1? That may be my whole problem, I don't know.
27
31512
by: Deephay | last post by:
Greetings all, I have a program that used the realloc() function to change the allocated size of a buffer, the program works with some arguments, but with some other arguments, it will show me the error message like: *** glibc detected *** realloc(): invalid next size: 0x0804c3a8 *** and then I inserted a perror("realloc") to see what happend, it says that:
5
3438
by: Stewart | last post by:
Hi there, I would like to calculate a person's age in years (between 2 dates). I am using the following function for this calculation (source: http://www.mvps.org/access/datetime/date0001.htm) _________________________________________ Function Age(DateOfBirth, DateToday) As Integer ' Returns the Age in years between 2 dates
12
3073
by: JHNielson | last post by:
I have a simple question, but I can't seem to find the answer. I have this code to count the number of records that pass through a set of processes: It counts how many records go through INPUT, VALIDATED, ERRORS This is the code to get the numbers: Function Val_Message()
0
1925
by: Systemino | last post by:
Hallo, I have a site developed on ASP.NET 2.0. It stay on my notebook and it works with a ORACLE database (ver. 9.0). It's all right!! Then I reached my definite site version on IIS 6.0 in other server (with S.O. Windows 2003). The server has the framework 2.0 .NET and the oracle client. Now when I try to connect on the same database I get error: "Invalid operation. Connection Closed".
25
20602
by: tekctrl | last post by:
Anyone: I have a simple MSAccess DB which was created from an old ASCII flatfile. It works fine except for something that just started happening. I'll enter info in a record, save the record, and try to move to another record and get an Access error "Record is too large". The record is only half filled, with many empty fields. If I remove the added data or delete some older data, then it saves ok and works fine again. Whenever I'm...
1
2818
by: eBob.com | last post by:
I have some code which is trying to determine where text will wrap in a custom text box (which Inherits from Control). It determines the number of characters which will fit in the first line, but then encounters an exception when it calls MeasureCharacterRanges to see if the next character, i.e. the one destined to become the first character of the second line, will fit. The message says only "Invalid parameter" - it does not say which...
11
2533
by: markryde | last post by:
Hello, Followed here is a simplified code example of something which I try to implement; in essence , I want to assign a value to a return value of a method is C. I know, of course, that in this example I can get this by newskb->iph = iphdr (this also appears in a commented line in the example below) ; but I want to achieve the same where the left side is : ip_hdr(newskb). Alas, if I try this , I get a compilation error about line 25....
0
9776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10812
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10399
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7952
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7108
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.