Hi
 I tried running the code for Opaque proxy by updating to the latest CVS version of player/stage.The code runs well in the absence of try and catch statements but returns a segmentation fault otherwise.
I have posted the GDB BACKTRACE of the code when try and catch statements are used:
[swarm@localhost libplayerc++]$ ./opq1
Segmentation fault
[swarm@localhost libplayerc++]$ gdb opq1
GNU gdb Red Hat Linux (6.6-35.fc8rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/swarm/Documents/player/examples/libplayerc++/opq1

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/ac/2eeb206486bb7315d6ac4cd64de0cb50838ff6.debug
(no debugging symbols found)
(no debugging symbols found)

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/e8/38ce6093590b08883fd28e6008fb91964ef067.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/59/2af63ddff2a1ff221065e557f938cc2cb25cc7.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/88/27308433e33aeefb560f42fb133577c8936f20.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/92/8ab51a53627c59877a85dd9afecc1619ca866c.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/db/8cb95645d5df469d4aece301cdb5e60087be21.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/ba/4ea1118691c826426e9410cafb798f25cefad5.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/6c/1cdbb38ae2a292613c8c31195417ee80ea7e1e.debug
[Thread debugging using libthread_db enabled]
[New process 4455]

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/d0/b716d925c00494a40cff204a21530d0b96df8b.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/e3/3448de964a5ca97b70edbdcea227c6ea5d3657.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/04/aefaf601793e8d276f6b6c6f4da080babe3faf.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/07/b722c2a7fed5b96cf4b40ce0f2a06eb0f8d2fc.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/36/f3124773ab53b99593686f41e2db7beb736d44.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/db/a292aff9720bfc3f25c53fa8e469168460a894.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/59/90d96516d0966b3e75c018e6129eee43965a6a.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/fa/4de2ee94deb82d3b7b6dddba32b4cbfb94dd8e.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/cc/a2a51671562775f944bce85a9476972b6994c8.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/34/0daf994019a9e2655d5c027d938d489510070c.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/03/5807c541381466da2f8457545e62c87066fd4f.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/90/ebf9c172c9332feed316b7c0fdff30ce1a15ae.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/8a/cc903fa48e73406552c64938e7866699a10801.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/54/97ce83a1cf21660e17bef3f4831e2f24afe795.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/41/b572ad1b8e3fac8fb0dadf6bcc2b61ef6e08a9.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/60/d593e7987c4f31a338bf509b15d713aa1fe1fb.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/7c/f32ecc91202c1747b80e3356a6828ae7ee97e7.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/13/e7ce3022231431f7402aed8afd467f81d091f0.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/0d/605d38e5e2d23fb14837dd95144b2d330b946c.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/87/d66bafb3c5d1af9e5a91a447ef5efcc0a3ec3c.debug
[New Thread -1208793392 (LWP 4455)]

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/a7/eabb854181ef5ff0c22b78c3e5048c64a2ebb8.debug

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208793392 (LWP 4455)]
0x0804990e in main ()

Also another problem is that the output I am getting is
abcd@K-
count=4getcount4
opGetData[0]=a
opGetData[1]=b
opGetData[2]=c
opGetData[3]=d

I would like to know why garbage values are being displayed after "abcd"?

Regards
Eshwaran

 

On Fri, Feb 22, 2008 at 12:04 AM, Toby Collett <tcollett+player@plan9.net.nz> wrote:
Have you tried the CVS version of player, there are many memory fixes that have not made it into a release yet, if the CVS version doesnt work then we can track down the fault in there.

Toby


On 22/02/2008, Eshwaran VijayKumar <eshwaran.vijaykumar@gmail.com> wrote:
Hi
   Thanks for your reply Vimal. I will try out your suggestion.Please do inform me if  there is any other alternative/Patch which can get Opaque Interface working on the current version of Player/Stage V2.10 RC1 ? (I don't want to have to revert to an earlier version unless i really have to:))

Thanks in advance,
Regards
Eshwaran
  


On Thu, Feb 21, 2008 at 9:55 PM, VIMAL MEHTA <vimal_744@yahoo.co.in> wrote:
Hi
 
Even I tried the same versions of player stage as u did and I get the same errors.
 
So i download player 2.0.5 and stage 2.0.4 and opaque proxy works fine with them
 
Hope this helps.
Thanks
 
Vimal


Eshwaran VijayKumar <eshwaran.vijaykumar@gmail.com> wrote:
Hi,
   I tried using a section of code posted by Yashan Sun earlier to try working with Opaque Proxy. I am using Player V2.10RC1 and Stage V2.10 RC1.  When I  try running the code, I get a segmentation fault. I have posted the code I am using and a gdb back trace. Any help would be much appreciated.

CFG FILE:
driver
(       
  name "stage"
  provides ["simulation:0" ]
  plugin "libstageplugin"

  # load the named file into the simulator
  worldfile "opq.world"   
)


driver
(
  name "stage"
  provides ["6665:position2d:0" "6665:laser:0"]
 
  model "robot1"
)


driver(
  name "relay"
  provides ["6665:opaque:0"]
)


CC FILE:
 #include <libplayerc++/playerc++.h>
 #include <libplayerc/playerc.h>
 #include <iostream>
 #include "args.h"

 int
 main(int argc, char **argv)
 {
 parse_args(argc,argv);

 try
 {
 using namespace PlayerCc;
 using namespace std;

 PlayerClient robot(gHostname, gPort);
 Position2dProxy pp(&robot, gIndex);
 LaserProxy lp(&robot, gIndex);
 OpaqueProxy op(&robot, gIndex);
 player_opaque_data_t opData;
 uint8_t opGetData[1024];
for(;;)
 {
 robot.Read();

 opData.data_count = 3;
 opData.data[0]='a';
 opData.data[1]='b';
 opData.data[2]='c';
 op.SendCmd(&opData);
 std::cout << opData.data << std::endl;
 uint count = op.GetCount();
 std::cout << "count=" << count << std::endl;
 op.GetData(opGetData);
 std::cout << "opGetData[0]=" << opGetData[0] << std::endl;
 std::cout << "opGetData[1]=" <<opGetData[1] << std::endl;
 std::cout << "opGetData[2]=" <<opGetData[2] << std::endl;
 //std::cout << "opGetData[3]=" <<opGetData[3] << std::endl;
 }
 }
 catch (PlayerCc::PlayerError e)
 {
 std::cerr << e << std::endl;
 return -1;
 }
 }

GDB BACK TRACE:
[swarm@localhost libplayerc++]$ gdb opq1
GNU gdb Red Hat Linux (6.6-35.fc8rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run >opq1.txt
Starting program: /home/swarm/Desktop/player-2.1.0rc1/examples/libplayerc++/opq1 >opq1.txt

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/ac/2eeb206486bb7315d6ac4cd64de0cb50838ff6.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/e8/38ce6093590b08883fd28e6008fb91964ef067.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/59/2af63ddff2a1ff221065e557f938cc2cb25cc7.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/88/27308433e33aeefb560f42fb133577c8936f20.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/92/8ab51a53627c59877a85dd9afecc1619ca866c.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/db/8cb95645d5df469d4aece301cdb5e60087be21.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/ba/4ea1118691c826426e9410cafb798f25cefad5.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/6c/1cdbb38ae2a292613c8c31195417ee80ea7e1e.debug
[Thread debugging using libthread_db enabled]
[New process 9859]

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/d0/b716d925c00494a40cff204a21530d0b96df8b.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/e3/3448de964a5ca97b70edbdcea227c6ea5d3657.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/04/aefaf601793e8d276f6b6c6f4da080babe3faf.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/07/b722c2a7fed5b96cf4b40ce0f2a06eb0f8d2fc.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/db/a292aff9720bfc3f25c53fa8e469168460a894.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/59/90d96516d0966b3e75c018e6129eee43965a6a.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/fa/4de2ee94deb82d3b7b6dddba32b4cbfb94dd8e.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/cc/a2a51671562775f944bce85a9476972b6994c8.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/03/5807c541381466da2f8457545e62c87066fd4f.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/90/ebf9c172c9332feed316b7c0fdff30ce1a15ae.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/8a/cc903fa48e73406552c64938e7866699a10801.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/54/97ce83a1cf21660e17bef3f4831e2f24afe795.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/41/b572ad1b8e3fac8fb0dadf6bcc2b61ef6e08a9.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/60/d593e7987c4f31a338bf509b15d713aa1fe1fb.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/7c/f32ecc91202c1747b80e3356a6828ae7ee97e7.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/13/e7ce3022231431f7402aed8afd467f81d091f0.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/0d/605d38e5e2d23fb14837dd95144b2d330b946c.debug

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/87/d66bafb3c5d1af9e5a91a447ef5efcc0a3ec3c.debug
[New Thread -1208587552 (LWP 9859)]

warning: Missing the separate debug info file: /usr/lib/debug/.build-id/a7/eabb854181ef5ff0c22b78c3e5048c64a2ebb8.debug

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208587552 (LWP 9859)]
0x080499cf in main (argc=Cannot access memory at address 0x0
) at opq1.cc:37
37       opData.data[0]='a';


Thanks in advance,

Regards,
Eshwaran
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users


Save all your chat conversations. Find them online.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users




--
This email is intended for the addressee only and may contain privileged and/or confidential information

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users