User forums > Help

Run Button in C::B different than Running From OS

(1/2) > >>

Sqeaky:
I am aware of a few of the differences of running an application from inside an IDE vs double clicking on the executable, things like the working directory and information that is passed to the application about where to find dynamic libraries (.DLLs and .SOs). However, I am getting some really odd behavior when I run an application I am working on from inside Code::Blocks

When I try to run it from the OS I double click it and the OS asks me what to do to Run it or Display it (I am using ubuntu 10.10 64 bit, but I get similar behavior on 10.04 32 bit and 10.04 64 bit). I click run it just works, it also works fine from the command line. However it doesn't work when I try to run it using the run button in Code::Blocks, but it used to work fine a few months ago. Now, it runs into the early parts of the application initialization and simply pauses execution. Whenever I run into this issue it seems to pause in the same place unless I make a major change to my applications code, then the place it pauses at moves to another seemingly random place. It also pauses in different locations based on whether I am debugging or simply running the program, and which computer I am working on. I can tell exactly where it pauses because my application logs a lot of data and I can find the log messages in the code and tell where it stopped logging. When I am debugging I can tell it has paused because the Debugger will simply not let me advance to the next line. Once an application has paused this way clicking the "abort" button does nothing. The only way to convince Code::Blocks that the application is not running is to close it and re-open Code::Blocks.

I have tried the versions: 8.02, 10.05. SVN 6205 (I think), and I am using SVN 6703 it doesn't seem to affect it in any meaningful way. Currently the windows version of the application runs fine. I searched for other similar bugs and I couldn't find any, nor could I determine what in my application was causing this issue (assuming it was something in my application).

Any ideas? Any at all? What information would be helpful to aid troubleshooting?

oBFusCATed:
For better debugging support, try CB from the debuggers branch (wxpropgrid_debugger)...

I'm not sure if I've understand the problem correctly...
Does your application works from the command line as expected?
If not you can debug it the hardcore way with pure gdb (or another debugger wrapper ddd, kdbg).

Sqeaky:
My application works fine from the command line. Even if I use a tool like gbd or valgrind.

But it fails to run from inside C::B. It simply fails to advance past a certain point when I click the run button (The green ">" Arrow), and it simply fails to advance past a different bit still certain point when I am debugging inside C::B.

Each time I run it under a given set of conditions inside code::blocks it always pauses in the same place. If I change the conditions, like the OS, or whether or not I am debugging, it pauses at some new place until I change the conditions again.

I will look into the developers branch. I think I will avoid being hardcore for the time being, I would rather determine if it some odd bug with my application, an an odd bug in Code:Blocks, or something else that can be fixed.

Edit: I described more about my problem.

oBFusCATed:
Hm, pretty strange...

Have you tried to see if the working dir of your app is the same to the one from the console.
Does you app depend on the environment?
If it does verify that the environment is the same both times (use the env parameter of main() ).

And also does simple hello world app works as expected?

Sqeaky:
Simple hello world app in the same workspace as my application (which is split into 3 projects) works.

My app indirectly uses the environment. It uses the LD_LIBRARY_PATH to know where to search for external libaries. (It uses like 10 or more shared libraries, it is ridiculous).

I will check the env for that right now. But I would expect it to simply crash with SigTerm or SigAbrt if it couldn't find a required library.

gimme 10 minutes and I will check.

Navigation

[0] Message Index

[#] Next page

Go to full version