electric-fence

Understanding the output of electric fence and gdb

寵の児 提交于 2020-01-02 02:12:10
问题 When debugging a program that terminates with a segfault, electric fence, in conjunction with gdb, returns this: "ElectricFence Exiting: mprotect() failed: Cannot allocate memory [Thread 0xb0bd4b70 (LWP 5363) exited] Program exited with code 0377. I actually thought electric fence would be more helpful. What does this mean? How can I interpret this piece of information? There doesn't seem to be any stack left that I can look at, or at least bt won't return anything. Any suggestion would be

c++ STL map::operator[] done on an entry being deleted

£可爱£侵袭症+ 提交于 2019-12-23 13:07:24
问题 std::map<int,int> bar; int foo(int key) { bar.erase(key); return 1; } int main() { bar[0] = foo(0); return 0; } This code compiled with GCC 4.8 segs fault when checking memory usage with electric fence. LD_PRELOAD=libefence.so.0.0 ./a.out The problem comes from the fact that the compiler generates a code that starts to allocate a new entry in the map, then executes foo() to get the value to put into bar[0] . While running foo() , the entry gets destroyed and the code finally ends by writing

Understanding the output of electric fence and gdb

♀尐吖头ヾ 提交于 2019-12-05 04:36:11
When debugging a program that terminates with a segfault, electric fence, in conjunction with gdb, returns this: "ElectricFence Exiting: mprotect() failed: Cannot allocate memory [Thread 0xb0bd4b70 (LWP 5363) exited] Program exited with code 0377. I actually thought electric fence would be more helpful. What does this mean? How can I interpret this piece of information? There doesn't seem to be any stack left that I can look at, or at least bt won't return anything. Any suggestion would be really appreciated. Thanks! Curtis P You have probably run out of memory map areas. The default is known

Why electric fence/Valgrind is unable to catch this buffer-overflow issue?

穿精又带淫゛_ 提交于 2019-12-04 14:46:57
问题 I have created a buggy program - buggy.c - this is a buffer-overflow scenario for buffer t. You can see that I am writing more than 5 indexes. It works fine. It never throws me an error. I was wondering, why is it like that? I tried even Valgrind, this also couldn't find this issue. Can you tell me please what is the issue here? void buffer_overflow(void) { int t[5]; int i = 0; for(i = 0; i<=7; i++) { t[i] = i; } /** this will cause buffer overflow **/ printf("Memory_overflow_completed\r\n");

Why electric fence/Valgrind is unable to catch this buffer-overflow issue?

雨燕双飞 提交于 2019-12-03 08:26:55
I have created a buggy program - buggy.c - this is a buffer-overflow scenario for buffer t. You can see that I am writing more than 5 indexes. It works fine. It never throws me an error. I was wondering, why is it like that? I tried even Valgrind, this also couldn't find this issue. Can you tell me please what is the issue here? void buffer_overflow(void) { int t[5]; int i = 0; for(i = 0; i<=7; i++) { t[i] = i; } /** this will cause buffer overflow **/ printf("Memory_overflow_completed\r\n"); } int main(int argc, char **argv) { buffer_overflow(); return 0; } $gcc -g buggy.c -o buggy.out

Heap corruption not detected by Valgrind or Electric Fence. Should I be suspicious? (C++)

女生的网名这么多〃 提交于 2019-11-30 14:30:56
I recently encountered my first battle (solved) with heap corruption. On my linux machine at home the culprit code exits without error using valgrind and electric-fence(with gdb). Yet on the windows machine in our lab, I consistently get the heap corruption related error message from VS described in my referenced post. Is it surprising (or at least uncommon) that valgrind and electric fence wouldn't detect such a problem? Someone else mentioned a possibly similar bug that eluded valgrind in a answer here . What might be some reasons why this problem wouldn't be detected by these tools? Is

Heap corruption not detected by Valgrind or Electric Fence. Should I be suspicious? (C++)

泪湿孤枕 提交于 2019-11-29 20:27:20
问题 I recently encountered my first battle (solved) with heap corruption. On my linux machine at home the culprit code exits without error using valgrind and electric-fence(with gdb). Yet on the windows machine in our lab, I consistently get the heap corruption related error message from VS described in my referenced post. Is it surprising (or at least uncommon) that valgrind and electric fence wouldn't detect such a problem? Someone else mentioned a possibly similar bug that eluded valgrind in a