NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Debugger crashing by itself

 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
erupter



Joined: 16 May 2012
Posts: 5

PostPosted: Wed May 16, 2012 4:40 pm    Post subject: Debugger crashing by itself Reply with quote

Hello.
I'm new to using netbeans as a C++ ide under ubuntu.
I've been developing a program to interface with playerstage.
Right now I'm updating some code from 2yrs ago so I'm almost starting from scratch and the code has been reduced to very few lines.
Here they are
Code:

/*
 * File:   main.cpp
 * Author: erupter
 *
 * Created on May 16, 2012, 6:22 PM
 */

#include <GL/glut.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <libplayerc/playerc.h>
#include "variables.h"


int main(int argc, char **argv)
{
  int result=0,i;
  double min_angle=0, max_angle=0, angular_res=0, min_range=0, max_range=0, range_res=0, frequency=0;
 
  set_defaults();
 
  if ((execute_command_interpreter(argc,argv)))
    return -1;

  result=network_setup();
 
  if (result){
    printf("Network setup error\n%s",network_errors[result]);
    return -1;
  }

  playerc_ranger_get_geom(sonar);
  playerc_ranger_get_config(sonar,&min_angle, &max_angle, &angular_res, &min_range, &max_range, &range_res, &frequency);
  i=0;

  printf("Sensor config:\nMin_angle %g\nMax_angle %g\nAngular_res %g\nMin_range %g\nMax_range %g\nRange_res %g\nFreq %g\n",min_angle, max_angle,angular_res,min_range,max_range,range_res,frequency);
  printf("Setting new config\n\n");
  playerc_ranger_set_config(sonar,-90,90,1,0,8,0.05,15);
  playerc_ranger_get_config(sonar,&min_angle, &max_angle, &angular_res, &min_range, &max_range, &range_res, &frequency);
  printf("Sensor config:\nMin_angle %g\nMax_angle %g\nAngular_res %g\nMin_range %g\nMax_range %g\nRange_res %g\nFreq %g\n",min_angle, max_angle,angular_res,min_range,max_range,range_res,frequency);

  close_connections();

  return 0;
}


I'm omitting code for some functions.
Anyway up to about 40 minutes ago I got it debugging nicely.
Now the debugger doesn't start (or most probably it crashes).

If I load a simple stupid hello world, gdb works ok.
In my app no way.
I started a new project and just pasted the relevant code, but no joy.
How can I debug the debugger behaviour under netbeans???
Back to top
erupter



Joined: 16 May 2012
Posts: 5

PostPosted: Fri May 18, 2012 9:05 am    Post subject: Reply with quote

I debugged the very same program with gdb in console without any problem, so it is Netbeans somehow.

Can anybody at least suggest a way to show relevant messages from the debugger?


Edit:
after an uninstall&reinstall cycle I first got it working again, then broke it again.
So I deleted my home user ./netbeans folder and the debugger works again without reinstalling.
So something's going on with what's saved in my users config.

edit2:
tried a diff on the .netbeans folder but too many things got changed.
It's something in the config subfolder though...
Back to top
Egor Ushakov
Posted via mailing list.





PostPosted: Mon May 21, 2012 1:18 pm    Post subject: Debugger crashing by itself Reply with quote

Hi,

try to see what's in the gdb log (http://wiki.netbeans.org/GdbLog)
or just open it (main menu/window/debugging/debugger console)

Egor

On 05/18/12 01:05 PM, erupter wrote:
Quote:
Can anybody at least suggest a way to show relevant messages from the debugger?



Back to top
erupter



Joined: 16 May 2012
Posts: 5

PostPosted: Tue May 22, 2012 10:34 am    Post subject: Reply with quote

Thank you very much Egor, now I'm at least in a position to understand what's happening!
Back to top
erupter



Joined: 16 May 2012
Posts: 5

PostPosted: Tue May 22, 2012 10:44 am    Post subject: Reply with quote

Finally I have some logs!

Code:

=thread-group-added,id="i1"
~"GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04\n"
~"Copyright (C) 2012 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"x86_64-linux-gnu\".\nFor bug reporting instructions, please see:\n"
~"<http://bugs.launchpad.net/gdb-linaro/>.\n"
&"/home/erupter/.gdbinit: No such file or directory.\n"
(gdb)
2-list-features
3-gdb-set print repeat 0
4-gdb-set backtrace limit 1024
5-gdb-set print elements 0
6-environment-directory ".:/usr/local/include/player-3.1:/usr/local/include/Stage-4.1"
7-file-exec-and-symbols  "/home/erupter/NetBeansProjects/PlayerStage Test/dist/Debug/GNU-Linux-x86/playerstage_test"
2^done,features=["frozen-varobjs","pending-breakpoints","thread-info","data-read-memory-bytes","breakpoint-notifications","ada-task-info","python"]
(gdb)
3^done
(gdb)
4^done
(gdb)
5^done
(gdb)
&"Warning: /home/erupter/NetBeansProjects/PlayerStage Test/.:/usr/local/include/player-3.1:/usr/local/include/Stage-4.1: No such file or directory.\n"
6^done,source-path="/home/erupter/NetBeansProjects/PlayerStage Test/.:/usr/local/include/player-3.1:/usr/local/include/Stage-4.1:$cdir:$cwd"
(gdb)
7^done
(gdb)
8-file-list-exec-source-file
8^done,line="10",file="main.c",fullname="/home/erupter/NetBeansProjects/PlayerStage Test/main.c",macro-info="0"
(gdb)
9cd /home/erupter/NetBeansProjects/PlayerStage Test
10-exec-arguments
11set environment $LD_LIBRARY_PATH=/usr/local/lib64;/usr/local/lib;/usr/lib;/usr/lib64
12-break-insert -f "main.c:23"
13-var-create - @ sonar
14-var-update --all-values *
15-var-create - @ client
16-var-update --all-values *
&"cd /home/erupter/NetBeansProjects/PlayerStage Test\n"
17-break-insert -t _start
~"Working directory /home/erupter/NetBeansProjects/PlayerStage Test.\n"
9^done
(gdb)
10^done
(gdb)
&"set environment $LD_LIBRARY_PATH=/usr/local/lib64;/usr/local/lib;/usr/lib;/usr/lib64\n"
11^done
(gdb)
12^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000000000040109d",func="main",file="main.c",fullname="/home/erupter/NetBeansProjects/PlayerStage Test/main.c",line="23",times="0",original-location="main.c:23"}
(gdb)
13^done,name="var1",numchild="21",value="0x0",type="playerc_ranger_t *",has_more="0"
(gdb)
~"/build/buildd/gdb-7.4-2012.04/gdb/thread.c:613: internal-error: is_thread_state: Assertion `tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? "
~"(y or n) [answered Y; input not from terminal]\n"
18-var-show-attributes "var1"
~"/build/buildd/gdb-7.4-2012.04/gdb/thread.c:613: internal-error: is_thread_state: Assertion `tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nCreate a core file of GDB? "
~"(y or n) [answered Y; input not from terminal]\n"
 


Now I have to understand it.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo