[Gambas-user] Problems with OpenSuSE 11 and gcc 4.3

Steven Lobbezoo steven at ...1652...
Wed Jul 30 11:22:07 CEST 2008


Le mercredi 30 juillet 2008 à 10:59 +0200, Benoit Minisini a écrit :

> On mercredi 30 juillet 2008, Steven Lobbezoo wrote:
> > Le mercredi 30 juillet 2008 à 09:00 +0200, Benoit Minisini a écrit :
> > > On mardi 29 juillet 2008, Benoit Minisini wrote:
> > > > On mardi 29 juillet 2008, Steven Lobbezoo wrote:
> > > > > No, if I do that i test the 'executable' directly and there is no
> > > > > error. The error is only if I start the app under the ide (run
> > > > > button)
> > > > >
> > > > > Steven
> > > >
> > > >From what you told, I understood that the IDE crashes, so you must
> > >
> > > run 'valgrind... gbx2 -p' inside the IDE directory.
> > >
> > > But if the crash comes from your project, you must run valgrind inside
> > > the project directory.
> > >
> > > And if the crash comes from your project, but only while debugging it,
> > > run valgrind inside the IDE project directory, but add the
> > > option '--trace-children=yes' to let valgrind follow both the IDE and
> > > your project!
> > >
> > > Tell me if I was not clear.
> > >
> > > Regards,
> >
> > I'm afraid, I donnot understand :
> > if I run valgrind in the gambas (ide) directory I get this :
> > steven at ...1948...:~/2.0/app/src/gambas2> valgrind --tool=memcheck
> > --trace-children=yes --num-callers=50 gambas2.gambas
> > ==6281== Memcheck, a memory error detector.
> > ==6281== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
> > ==6281== Using LibVEX rev 1804, a library for dynamic binary
> > translation.
> > ==6281== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
> > ==6281== Using valgrind-3.3.0, a dynamic binary instrumentation
> > framework.
> > ==6281== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
> > ==6281== For more details, rerun with: -v
> > ==6281==
> > ==6281== Memcheck, a memory error detector.
> > ==6281== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
> > ==6281== Using LibVEX rev 1804, a library for dynamic binary
> > translation.
> > ==6281== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
> > ==6281== Using valgrind-3.3.0, a dynamic binary instrumentation
> > framework.
> > ==6281== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
> > ==6281== For more details, rerun with: -v
> > ==6281==
> > ==6281== Memcheck, a memory error detector.
> > ==6281== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
> > ==6281== Using LibVEX rev 1804, a library for dynamic binary
> > translation.
> > ==6281== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
> > ==6281== Using valgrind-3.3.0, a dynamic binary instrumentation
> > framework.
> > ==6281== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
> > ==6281== For more details, rerun with: -v
> > ==6281==
> > ERROR: #2: Cannot load class 'Project': Unable to load class file
> > ==6281==
> > ==6281== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 34 from 2)
> > ==6281== malloc/free: in use at exit: 137,731 bytes in 3,533 blocks.
> > ==6281== malloc/free: 25,016 allocs, 21,483 frees, 1,792,181 bytes
> > allocated.
> > ==6281== For counts of detected errors, rerun with: -v
> > ==6281== searching for pointers to 3,533 not-freed blocks.
> > ==6281== checked 447,828 bytes.
> > ==6281==
> > ==6281== LEAK SUMMARY:
> > ==6281==    definitely lost: 21,225 bytes in 158 blocks.
> > ==6281==      possibly lost: 0 bytes in 0 blocks.
> > ==6281==    still reachable: 116,506 bytes in 3,375 blocks.
> > ==6281==         suppressed: 0 bytes in 0 blocks.
> > ==6281== Rerun with --leak-check=full to see details of leaked memory.
> > steven at ...1948...:~/2.0/app/src/gambas2>
> >
> > However, if I do gambas2.gambas from the command line in that directory,
> > i get the ide, all correct.
> >
> > If I run valgrind inside my project directory (after removing the
> > test.gambas compiled file)
> > it runs my project, but without the ide.
> > So, exactly in which directory should i run valgrind ?
> > And what should i run gambas2, gbx ?????
> >
> > Thanks,
> > Steven
> >
> 
> gambas2.gambas is not an executable, it is a script interpreted by the gambas 
> interpreter, which is the gbx2 program.
> 
> valgrind cannot follow a script - Well it should be able to do that, but 
> apparently this is not the case.
> 
> Fortunately, the gbx2 program can be run standalone, provided that you run it 
> directly inside the project directory (and if of course you have compile the 
> project first).
> 
> So you must:
> 
> 1) Go to the IDE project directory.
> 
> $ cd <gambas IDE project directory>
> 
> 2) Compile the project.
> 
> $ gbc2 -agt
> 
> 3) Run the interpreter inside valgrind, by asking him to follow child 
> processes, so that the project you are going to run in the IDE is trace too.
> 
> $ valgrind --tool=memcheck --trace-children=yes --num-callers=50 gbx2 -p
> 
> For information, 'gambas2.gambas' is just an uncompressed archive (like 
> what 'tar' makes) of your compiled project (without the sources). And gbx2 
> can be run on it the same way it can be run inside the project directory. You 
> just have to use the '-x' option.
> 
> If you look at the beginning of the gambas2.gambas file, you will see the name 
> of the interpreter that will run the file: '/usr/bin/env gbr2'. 'gbr2' is 
> just a symbolic link to 'gbx2', and '/usr/bin/env' just searches it through 
> the directories specified in your PATH environmental variable. This trick was 
> needed because you cannot use '/usr/bin/env gbx2 -x'. This is a Unix 
> limitation.
> 
> I hope things are clearer now. :-)
> 
> Regards,
> 


As clear as glas ;-) , but .....
I don't want to contradict you, but it does not work like that.
If I do exactly as you said, it's not the ide that is launched !
It's the program directly, and that works just fine.
I need to start the ide, select my project and run it in the ide.
I don't get the chance to do that, since 


> valgrind --tool=memcheck --trace-children=yes --num-callers=50 gbx2 -p
> 

just starts my little test program.

Regards,
Steven




More information about the User mailing list