glibc detected in ubuntu

i am new to OF please suggest some proper way of solving these messages code is running fine but these messages are creating problem and please suggest any particular URL for complete beginners
HEADER FILE

  
#pragma once  
  
#include "ofMain.h"  
  
class testApp : public ofBaseApp{  
  
	public:  
		void setup();  
		void update();  
		void draw();  
  
		void keyPressed  (int key);  
		void keyReleased(int key);  
		void mouseMoved(int x, int y );  
		void mouseDragged(int x, int y, int button);  
		void mousePressed(int x, int y, int button);  
		void mouseReleased(int x, int y, int button);  
		void windowResized(int w, int h);  
		void dragEvent(ofDragInfo dragInfo);  
		void gotMessage(ofMessage msg);  
		char eventstring[255];		  
		ofTrueTypeFont myFont;  
		int a;  
		int m;  
  
		int i;		  
		  
};  

CPP FILE

  
#include "testApp.h"  
  
//--------------------------------------------------------------  
void testApp::setup(){  
  
	ofBackground(50,50,50);  
	myFont.loadFont("arial.ttf", 48, true, true);  
	  
	  
	  
}  
  
//--------------------------------------------------------------  
void testApp::update(){  
	  
  
}  
  
//--------------------------------------------------------------  
void testApp::draw(){  
	  
  
	if(a==1)  
	{  
	ofSetColor(255,0,0);      
	ofRect(20,20,100,100);  
	}  
	ofSetColor(0,255,0);  
	myFont.drawString("I am here",mouseX,mouseY);  
	if(m==1)  
	{  
	ofSetColor(255,0,0);  
	ofCircle(mouseX,mouseY,30);  
	}  
  
}  
  
//--------------------------------------------------------------  
void testApp::keyPressed(int key){  
  
	a=1;  
}  
  
//--------------------------------------------------------------  
void testApp::keyReleased(int key){  
  
	a=0;  
}  
  
//--------------------------------------------------------------  
void testApp::mouseMoved(int x, int y ){  
	  
}  
  
//--------------------------------------------------------------  
void testApp::mouseDragged(int x, int y, int button){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mousePressed(int x, int y, int button){  
  
	m=1;  
}  
  
//--------------------------------------------------------------  
void testApp::mouseReleased(int x, int y, int button){  
  
	m=0;  
}  
  
//--------------------------------------------------------------  
void testApp::windowResized(int w, int h){  
  
}  
  
//--------------------------------------------------------------  
void testApp::gotMessage(ofMessage msg){  
  
}  
  
//--------------------------------------------------------------  
void testApp::dragEvent(ofDragInfo dragInfo){   
  
}  
  
  

MESSAGE in terminal in Ubuntu 11.10

  
*** glibc detected *** ./myTestProject: free(): invalid pointer: 0x08a98a20 ***  
======= Backtrace: =========  
/lib/i386-linux-gnu/libc.so.6(+0x6ebc2)[0x727bc2]  
/lib/i386-linux-gnu/libc.so.6(+0x6f862)[0x728862]  
/lib/i386-linux-gnu/libc.so.6(cfree+0x6d)[0x72b94d]  
/usr/lib/i386-linux-gnu/dri/libdricore.so(_mesa_delete_program+0x7e)[0x7159fae]  
/usr/lib/i386-linux-gnu/dri/i915_dri.so(+0x2c7dc)[0x84227dc]  
/usr/lib/i386-linux-gnu/dri/libdricore.so(_mesa_reference_program+0x5d)[0x715a05d]  
/usr/lib/i386-linux-gnu/dri/libdricore.so(+0x13e6cf)[0x71606cf]  
/usr/lib/i386-linux-gnu/dri/libdricore.so(_mesa_delete_program_cache+0x2c)[0x71607bc]  
/usr/lib/i386-linux-gnu/dri/libdricore.so(_mesa_free_program_data+0x6c)[0x715a17c]  
/usr/lib/i386-linux-gnu/dri/libdricore.so(_mesa_free_context_data+0x155)[0x705f955]  
/usr/lib/i386-linux-gnu/dri/i915_dri.so(intelDestroyContext+0xd9)[0x842cd49]  
/usr/lib/i386-linux-gnu/dri/i915_dri.so(+0xfb47)[0x8405b47]  
/usr/lib/i386-linux-gnu/mesa/libGL.so.1(+0x3bd61)[0xbb6d61]  
/usr/lib/i386-linux-gnu/mesa/libGL.so.1(+0x15a90)[0xb90a90]  
/usr/lib/i386-linux-gnu/mesa/libGL.so.1(+0x15b0f)[0xb90b0f]  
/usr/lib/i386-linux-gnu/libX11.so.6(XCloseDisplay+0xa3)[0xc79143]  
/usr/lib/libglut.so.3(fgDeinitialize+0x213)[0x696693]  
/usr/lib/libglut.so.3(glutMainLoopEvent+0xa1c)[0x6998ec]  
/usr/lib/libglut.so.3(glutMainLoop+0x35)[0x699935]  
./myTestProject[0x805733b]  
./myTestProject[0x8055510]  
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x6d2113]  
======= Memory map: ========  
00110000-00160000 r-xp 00000000 07:00 48407      /usr/lib/libmpg123.so.0.25.1  
00160000-00161000 r--p 00050000 07:00 48407      /usr/lib/libmpg123.so.0.25.1  
00161000-00163000 rw-p 00051000 07:00 48407      /usr/lib/libmpg123.so.0.25.1  
00163000-00173000 rw-p 00000000 00:00 0   
00173000-0018f000 r-xp 00000000 07:00 407165     /lib/i386-linux-gnu/libgcc_s.so.1  
0018f000-00190000 r--p 0001b000 07:00 407165     /lib/i386-linux-gnu/libgcc_s.so.1  
00190000-00191000 rw-p 0001c000 07:00 407165     /lib/i386-linux-gnu/libgcc_s.so.1  
00191000-00193000 r-xp 00000000 07:00 2212       /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0  
00193000-00194000 r--p 00001000 07:00 2212       /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0  
00194000-00195000 rw-p 00002000 07:00 2212       /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0  
00195000-00197000 r-xp 00000000 07:00 2752       /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0  
00197000-00198000 r--p 00001000 07:00 2752       /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0  
00198000-00199000 rw-p 00002000 07:00 2752       /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0  
00199000-0019a000 rwxp 00000000 00:00 0   
0019c000-0019d000 r-xp 00000000 00:00 0          [vdso]  
0019d000-0020d000 r-xp 00000000 07:00 3640       /usr/lib/i386-linux-gnu/libGLU.so.1.3.071100  
0020d000-0020e000 r--p 0006f000 07:00 3640       /usr/lib/i386-linux-gnu/libGLU.so.1.3.071100  
0020e000-0020f000 rw-p 00070000 07:00 3640       /usr/lib/i386-linux-gnu/libGLU.so.1.3.071100  
0020f000-002a3000 r-xp 00000000 07:00 48108      /usr/lib/libopenal.so.1.13.0  
002a3000-002a4000 r--p 00094000 07:00 48108      /usr/lib/libopenal.so.1.13.0  
002a4000-002a5000 rw-p 00095000 07:00 48108      /usr/lib/libopenal.so.1.13.0  
002a5000-0055c000 r-xp 00000000 07:00 48242      /usr/lib/libfreeimage-3.13.1.so  
0055c000-00563000 r--p 002b6000 07:00 48242      /usr/lib/libfreeimage-3.13.1.so  
00563000-0056b000 rw-p 002bd000 07:00 48242      /usr/lib/libfreeimage-3.13.1.so  
0056b000-00649000 r-xp 00000000 07:00 503        /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16  
00649000-0064a000 ---p 000de000 07:00 503        /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16  
0064a000-0064e000 r--p 000de000 07:00 503        /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16  
0064e000-0064f000 rw-p 000e2000 07:00 503        /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16  
0064f000-00656000 rw-p 00000000 00:00 0   
00656000-0067e000 r-xp 00000000 07:00 412076     /lib/i386-linux-gnu/libpng12.so.0.46.0  
0067e000-0067f000 r--p 00027000 07:00 412076     /lib/i386-linux-gnu/libpng12.so.0.46.0  
0067f000-00680000 rw-p 00028000 07:00 412076     /lib/i386-linux-gnu/libpng12.so.0.46.0  
00680000-00682000 r-xp 00000000 07:00 2204       /usr/lib/i386-linux-gnu/libXau.so.6.0.0  
00682000-00683000 r--p 00001000 07:00 2204       /usr/lib/i386-linux-gnu/libXau.so.6.0.0  
00683000-00684000 rw-p 00002000 07:00 2204       /usr/lib/i386-linux-gnu/libXau.so.6.0.0  
00684000-006b4000 r-xp 00000000 07:00 3798       /usr/lib/libglut.so.3.9.0  
006b4000-006b6000 r--p 0002f000 07:00 3798       /usr/lib/libglut.so.3.9.0  
006b6000-006b9000 rw-p 00031000 07:00 3798       /usr/lib/libglut.so.3.9.0  
006b9000-0082f000 r-xp 00000000 07:00 407157     /lib/i386-linux-gnu/libc-2.13.so  
0082f000-00831000 r--p 00176000 07:00 407157     /lib/i386-linux-gnu/libc-2.13.so  
00831000-00832000 rw-p 00178000 07:00 407157     /lib/i386-linux-gnu/libc-2.13.so  
00832000-00835000 rw-p 00000000 00:00 0   
00835000-00867000 r-xp 00000000 07:00 233        /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4  
00867000-00868000 ---p 00032000 07:00 233        /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4  
00868000-00869000 r--p 00032000 07:00 233        /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4  
00869000-0086a000 rw-p 00033000 07:00 233        /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4  
0086a000-00872000 r-xp 00000000 07:00 2210       /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0  
00872000-00873000 r--p 00007000 07:00 2210       /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0  
00873000-00874000 rw-p 00008000 07:00 2210       /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0  
00874000-00891000 r-xp 00000000 07:00 2208       /usr/lib/i386-linux-gnu/libxcb.so.1.1.0  
00891000-00892000 r--p 0001c000 07:00 2208       /usr/lib/i386-linux-gnu/libxcb.so.1.1.0  
00892000-00893000 rw-p 0001d000 07:00 2208       /usr/lib/i386-linux-gnu/libxcb.so.1.1.0  
00893000-008a6000 r-xp 00000000 07:00 390390     /lib/i386-linux-gnu/libz.so.1.2.3.4  
008a6000-008a7000 r--p 00012000 07:00 390390     /lib/i386-linux-gnu/libz.so.1.2.3.4  
008a7000-008a8000 rw-p 00013000 07:00 390390     /lib/i386-linux-gnu/libz.so.1.2.3.4  
008a8000-008ab000 r-xp 00000000 07:00 407265     /lib/i386-linux-gnu/libdl-2.13.so  
008ab000-008ac000 r--p 00002000 07:00 407265     /lib/i386-linux-gnu/libdl-2.13.so  
008ac000-008ad000 rw-p 00003000 07:00 407265     /lib/i386-linux-gnu/libdl-2.13.so  
008ad000-00918000 r-xp 00000000 07:00 2653       /usr/lib/i386-linux-gnu/libsndfile.so.1.0.24  
00918000-00919000 r--p 0006b000 07:00 2653       /usr/lib/i386-linux-gnu/libsndfile.so.1.0.24  
00919000-0091a000 rw-p 0006c000 07:00 2653       /usr/lib/i386-linux-gnu/libsndfile.so.1.0.24  
0091a000-0091e000 rw-p 00000000 00:00 0   
0091e000-0099c000 r-xp 00000000 07:00 1260       /usr/lib/i386-linux-gnu/libpixman-1.so.0.22.2  
0099c000-009a0000 r--p 0007d000 07:00 1260       /usr/lib/i386-linux-gnu/libpixman-1.so.0.22.2  
009a0000-009a1000 rw-p 00081000 07:00 1260       /usr/lib/i386-linux-gnu/libpixman-1.so.0.22.2  
009a1000-009b0000 r-xp 00000000 07:00 2764       /usr/lib/i386-linux-gnu/libglapi.so.0.0.0Aborted  
  

some one please reply :frowning:

i am getting these glibc detected errors and segmentation fault frequently can any one please help and i have posted another one too with name glibc detected in ubuntu please reply in that too please

  
#include "testApp.h"  
  
//--------------------------------------------------------------  
void testApp::setup(){  
	  
	ofHideCursor();	  
	//ofBackground(50,50,50);  
	myFont.loadFont("arial.ttf", 48, true, true);	  
	myImage.loadImage("images/p.jpg");	  
  
}  
  
//--------------------------------------------------------------  
void testApp::update(){  
	  
ofBackground(255);  
}  
  
//--------------------------------------------------------------  
void testApp::draw(){  
	  
	  
	ofSetColor(255);  
	myImage.draw(60,70);  
	  
	  
	if(a==1)  
	{  
	ofSetColor(255,0,0);      
	ofRect(20,20,100,100);  
	}  
	  
	  
	ofSetColor(0,255,0);  
	ofDrawBitmapString("I am here",mouseX,mouseY);  
	  
	ofSetColor(255,0,0);  
	ofLine(800,100,mouseX,mouseY);  
	  
	ofSetColor(0,255,0);  
	ofBezier(50,100,150,1000,350,600,mouseX,mouseY);  
	  
	ofSetColor(0,0,255);  
	ofSetPolyMode(OF_POLY_WINDING_NONZERO);  
	  
	ofBeginShape();  
		ofVertex(200,30);  
  		ofVertex(500,30);  
		ofVertex(mouseX,mouseY);  
	ofEndShape();  
}  
  
//--------------------------------------------------------------  
void testApp::keyPressed(int key){  
  
	a=1;  
}  
  
//--------------------------------------------------------------  
void testApp::keyReleased(int key){  
  
	a=0;  
}  
  
//--------------------------------------------------------------  
void testApp::mouseMoved(int x, int y ){  
	  
}  
  
//--------------------------------------------------------------  
void testApp::mouseDragged(int x, int y, int button){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mousePressed(int x, int y, int button){  
  
//	m=1;  
}  
  
//--------------------------------------------------------------  
void testApp::mouseReleased(int x, int y, int button){  
  
//	m=0;  
}  
  
//--------------------------------------------------------------  
void testApp::windowResized(int w, int h){  
  
}  
  
//--------------------------------------------------------------  
void testApp::gotMessage(ofMessage msg){  
  
}  
  
//--------------------------------------------------------------  
void testApp::dragEvent(ofDragInfo dragInfo){   
  
}  
  
  

  
OF: OF_LOG_ERROR: trying to delete a non indexed texture, something weird is happening. Deleting anyway  
*** glibc detected *** ./myTestProject: double free or corruption (!prev): 0x08a75828 ***  
Segmentation fault  
  

not to put too fine a point on it, but as outlined in the guidelines, you are asked not to doublepost. it would be better to add additional information to the existing thread. I’m going to merge the two threads.

If nobody answers, it’s probably because nobody has an answer, or people haven’t seen your question yet - your query is only a day old.

a stacktrace like that is not really very human readable. from the little i can see it seems to be happening when you close your application? what version are you using github or the one from the downloads section? it could be some problem in the destruction of objects inside OF since your code seems fine

i am using of 007 from the downloaded section and yes after closing the apps those messages are being prompted

i was running the app in terminal its showing these things but when i used it in codeblocks ide it ran perfectly fine any guesses on it

This is just a though but since you’re on Linux, you should be able to run valgrind out of CodeBlocks after installing it, arturo has instructions here: http://forum.openframeworks.cc/t/memory-check-with-valgrind/1072/0

More info: http://valgrind.org/docs/manual/quick-start.html#quick-start.mcrun

Giving it a run in mem::check mode might track down what’s going on as your application exits b/c my guess is that something (probably a texture) is getting deleted twice somehow. Also, this is only happening in debug by any chance?

thanks for the replies
i tried the valgrind memcheck in terminal its showing the messages but how to do the memcheck using codeblocks
and as i am very new to this can you please suggest me how to start solving those memory leaks
i am getting such prompts in terminal while i run vlgrind --leak-check=yes ./myTestProject

  
   
==12832== LEAK SUMMARY:  
==12832==    definitely lost: 316 bytes in 5 blocks  
==12832==    indirectly lost: 2,346 bytes in 12 blocks  
==12832==      possibly lost: 0 bytes in 0 blocks  
==12832==    still reachable: 9,967 bytes in 43 blocks  
==12832==         suppressed: 0 bytes in 0 blocks  
==12832== Reachable blocks (those to which a pointer was found) are not shown.  
==12832== To see them, rerun with: --leak-check=full --show-reachable=yes  
==12832==   
==12832== For counts of detected and suppressed errors, rerun with: -v  
==12832== ERROR SUMMARY: 33 errors from 33 contexts (suppressed: 112 from 11)  
  

inside codeblocks you can try debugging your application to see where it’s crashing in the console you can do the same using gdb. but if it’s only crashing when closing the application i won’t worry about it

thanks for the reply again
i had again this problem i ran a code in terminal it didnt work saying segmentation fault and it ran perfectly fine in codeblocks any particular reason to these

it could be that you are using the release version in console and the debug version in codeblocks (or the opposite) the only way to know why a segmentation fault is happenning is to debug the application

i had no idea about that i tried to run the code in codeblocks in release mode and now its showing error as in terminal
so does it mean there are flaws in the code or should i be running the code in debug mode

  
#include "testApp.h"  
  
//--------------------------------------------------------------  
void testApp::setup(){  
	  
    myImage.loadImage("images/bikers.jpg");  
  
}  
  
//--------------------------------------------------------------  
void testApp::update(){  
	ofBackground(255,20,20);  
  
}  
  
//--------------------------------------------------------------  
void testApp::draw(){  
  
	ofSetColor(255);  
	myImage.draw(20,20);  
}  
  
  
//--------------------------------------------------------------  
void testApp::keyPressed(int key){  
  
}  
  
//--------------------------------------------------------------  
void testApp::keyReleased(int key){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mouseMoved(int x, int y ){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mouseDragged(int x, int y, int button){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mousePressed(int x, int y, int button){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mouseReleased(int x, int y, int button){  
  
}  
  
//--------------------------------------------------------------  
void testApp::windowResized(int w, int h){  
  
}  
  
//--------------------------------------------------------------  
void testApp::gotMessage(ofMessage msg){  
  
}  
  
//--------------------------------------------------------------  
void testApp::dragEvent(ofDragInfo dragInfo){  
  
}  
  

in release mode its not running i am stuck here for a day please guide me

i finally got the problem whenever creating a new project using the python scripts its including the ofMain.h in both main.cpp and testApp.h so having that header once solves all the segmentation fault and glibc

:slight_smile:
thanks for all your support :slight_smile:

mmh, i think the problem can be related with a bug in 007 with latest versions of gcc. are you using ubuntu 11.10? if so there’s a problem with the makefile where it doesn’t detect the dependencies properly and you need to:

make clean

and then make again or in codeblocks rebuild the whole project if you change a .h file. this is fixed in github, if you don’t want to download the whole repository you can just get the makefile from scripts/linux/template and substitute it in your download

yes i am using ubuntu 11.10 and i did make clean and make it worked perfectly fine with no changes in header and all

thanks a ton arturo you are a saviour

and i just needed to ask can you provide me the lnk of how to use the github repositories i mean checking out the whole version
and some tutorials links if you can
thanks again

you can find some info on the OF git workflow and links to general documentation about git here:

https://github.com/openframeworks/openFrameworks/wiki/openFrameworks-git-workflow

hey i was trying the geometry shader example of OF 007 downloaded from the download section i tried the make clean and all it didn’t work i used the gdb debugger to get these

  
Program received signal SIGSEGV, Segmentation fault.  
0x00000000 in ?? ()  
(gdb) where  
#0  0x00000000 in ?? ()  
#1  0x08078ae3 in ofShader::setGeometryInputType(unsigned int) ()  
#2  0x0805658e in testApp::setup() ()  
#3  0x0808b165 in ofNotifySetup() ()  
#4  0x08059c21 in ofAppGlutWindow::runAppViaInfiniteLoop(ofBaseApp*) ()  
#5  0x0805aa77 in ofRunApp(ofBaseApp*) ()  
#6  0x08055ee0 in main ()  
  

any specific solution to the example itself

Are you sure your card supports geometry shaders? Some older cards or drivers don’t.