Archived

This forum has been archived. Please start a new discussion on GitHub.

inferior stopped, write access violation win32 MSVC2010

Hi everyone,

I was just running tests of ICE using MSVS 2010 C++ express, now, I did everything, changed from /lib to /lib/vc100 and everything, but some weird things happen.

First, when I run it as debug with iced and iceutild, I get an error saying "The inferior stopped because it triggered an exception" and the disassembler code shows Memory access error, and the debugger shows write access violation.

Now, I used MSVC2008 with the normal libraries and had no issues, I even used MSVS 2010 professional and it worked with /lib/vc100, but now that I use express I get this issue.

When I build it as release instead of debug, the program actually runs, but when running I get the message: ObjectAdapterI.cpp:1215: Ice::EndpointParseException: error while parsing endpoint `invalid object adapter endpoint `

Now, from what I know the error is using createObjectAdapterWithEndpoints, I searched the forum, and it happened with MSVC2010 when not using the vc100 build, but I am using it, and still, I'm not able to debug and on release I get the Endpoint exception, here's the code, I'm sure it works because I tested with MSVC2010 professional and MSVC2008, and no, I don't use MSVC2010 pro anymore because it was just the trial, so developing with it is not an option.

//the main handler of the Ice runtime
	Ice::CommunicatorPtr ic;

	try {
		//initialize the Ice runtime
		ic = Ice::initialize(argc, argv);
		cout << "initialize the Ice runtime" << endl;

		//create the servant of Printer and add the runtime to the servant so it can be deleted on aboutToQuit()
		PrinterI *p = new PrinterI();
		Ice::ObjectPtr object = p;
		cout << "create the servant of Printer" << endl;

		//create the object adapter, here's where it throws the exception
		Ice::ObjectAdapterPtr adapter = ic->createObjectAdapterWithEndpoints("SimplePrinterAdapter", "default -p 10000");
		cout << "create the object adapter" << endl;

		//inform the object adapter of the printer servant and set an identity for the servant
		adapter->add(object, ic->stringToIdentity("SimplePrinter"));
		cout << "inform the object adapter of the printer servant and set an identity for the servant" << endl;

		//activate the adapter
		adapter->activate();
		cout << "activate the adapter" << endl;
	}
	//catch any Ice initialization exception
	catch (const Ice::Exception& e) {
		//Ice::Exception.what()
		cout << "Error: " << e.what() << endl;
	}

Any ideas? thanks for your time everyone!

Comments

  • xdm
    xdm La Coruña, Spain
    Hi Raul,

    Are you sure that you have the correct PATH, to use VC100 you need to have c:\Program Files\Ice-3.4.1\bin\vc100\

    If that isn't the problem you should do as Bernard suggest in this similar post

    http://www.zeroc.com/forums/help-center/5049-ms-visual-studio-2010-built-exe-fails-run-outside.html
  • xdm wrote: »
    Hi Raul,

    Are you sure that you have the correct PATH, to use VC100 you need to have c:\Program Files\Ice-3.4.1\bin\vc100\

    Thanks, I already had it in the PATH, I just fixed it, but just to let anyone know about this who may bump into this problem as well.

    I did have the PATH set with vc100, but the problem is in MSVC2010 express, it's not resolving correctly the bin path where the DLL are, I ran DependencyWalker and it wasn't resolving the path correctly, there's no issue in MSVC2010 professional because it uses the professional linker and compiler, but the latest express edition comes with another toolchain named Windows SDK for Windows 7 v7.1, so it was an issue with that.

    I had to manually copy the DLLs to the debug and release folder, it's really annoying, but I guess that the price you pay for using the express edition with the windows SDK 7.1.

    By the way, I use the SDK 7.1 with MSVC2010 express because that's the only way to use cdb for debugging, as the express edition comes with a light debugger, if you want all of the debugger features, you need to do a separate download of the debugger tools for windows.

    So, anyone who has issues with the express edition 2010, remember to download and install the windows SDK 7.1, install the debugger tools with it, and then install VS express, and copy the DLLs straight into your debug and release tools, as placing the PATH in the environment variables won't work.

    Thanks for the quick response though! you guys have a really active forum, it's nice that you can get help asap!
  • Access violation on createObjectAdapterWithEndpoints vs2010

    To anyone who runs into this issue, _HAS_ITERATOR_DEBUGGING set to 0
    was the culprit when I was building this in debug in vs2010 professional.