Tiago da Silva | 15 Jul 04:18

Help with Access Violation in simple serialization

Hi there,

I am having some serious problems when trying to instantiate either a
boost::archive::xml_oarchive or a boost::archive::text_oarchive: everytime I
receive an

"Unhandled exception at XXX (msvcr90d.dll) in XXX : Access violation writing
location"

I have simplified a test case up to this:

structure I want to save (in whatever.h):

    typedef
        struct s_pt
        {
            int x;
            int y;

            bool operator< (const struct s_pt &spt2) const
            {
                return (x < spt2.x) && (y < spt2.y);
            }

            bool operator== (const struct s_pt &spt2) const
            {
                return (x == spt2.x) && (y == spt2.y);
            }

            template<class Archive>        // turns into a serializable
(Continue reading)

Tiago da Silva | 15 Jul 15:54

Re: Help with Access Violation in simple serialization

I am linking to the following libs in my project:

glut32.lib glu32.lib opengl32.lib odbc32.lib odbccp32.lib cv.lib cxcore.lib
highgui.lib

basically OpenGL and OpenCV.

Are there any imcompatibility issues? I simply CANNOT instantiate an output
file!!!.

Thanks in advance,

Tiago

On Tue, Jul 15, 2008 at 11:21 AM, Tiago da Silva <besbatti <at> gmail.com> wrote:

> Hi there,
>
> I am having some serious problems when trying to instantiate either a
> boost::archive::xml_oarchive or a boost::archive::text_oarchive: everytime I
> receive an
>
> "Unhandled exception at XXX (msvcr90d.dll) in XXX : Access violation
> writing location"
>
> I have simplified a test case up to this:
>
> structure I want to save (in whatever.h):
>
>     typedef
(Continue reading)

joaquin | 15 Jul 15:58
Favicon
Gravatar

Re: Help with Access Violation in simple serialization

Tiago da Silva escribió:
> I am linking to the following libs in my project:
>
> glut32.lib glu32.lib opengl32.lib odbc32.lib odbccp32.lib cv.lib cxcore.lib
> highgui.lib
>
> basically OpenGL and OpenCV.
>
> Are there any imcompatibility issues? I simply CANNOT instantiate an output
> file!!!.
>   

Hi Tiago,

Have you made sure that all the libs your're using, as well as the main 
program, are built to work
with the same version of the C runtime library (dynamic/static, 
multi/single-threaded)?

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Tiago da Silva | 15 Jul 17:17

Re: Help with Access Violation in simple serialization

Thx for answering, Joaquín.

Currently I'm using a Multi-threaded Debug DLL (/MDd) runtime, without
optimizations, and all of them work perfectly. No warnings.

So, do you think that, by changing the runtime options, it might work?

Tiago

On Tue, Jul 15, 2008 at 10:58 PM, <joaquin <at> tid.es> wrote:

> Tiago da Silva escribió:
>
>> I am linking to the following libs in my project:
>>
>> glut32.lib glu32.lib opengl32.lib odbc32.lib odbccp32.lib cv.lib
>> cxcore.lib
>> highgui.lib
>>
>> basically OpenGL and OpenCV.
>>
>> Are there any imcompatibility issues? I simply CANNOT instantiate an
>> output
>> file!!!.
>>
>>
>
> Hi Tiago,
>
> Have you made sure that all the libs your're using, as well as the main
(Continue reading)

Tiago da Silva | 15 Jul 17:34

Re: Help with Access Violation in simple serialization

I tried all the combinations available, and mylibs require me to use a
Multithreaded DLL runtime...

still getting the Access violation writing location when I try to
instantiate a

[code]

      boost::archive::text_oarchive oa(ofs)

[/code]

(ofs being a ofstream)...

one thing i noticed is that if I do this:

[code]

   stringstream archbuf;
    boost::archive::text_oarchive *oa = new
boost::archive::text_oarchive(archbuf, 3 );

    *oa << VerticesKeeper::getConst( vkeeper );

    archbuf.flush();
    delete oa;

[/code]

I don't get the error, but the file is not written ( that is,  the
(Continue reading)

Tiago da Silva | 16 Jul 07:00

Re: Help with Access Violation in simple serialization

Here is how I managed not to correct, but to work around my bug:

[code]

    stringstream archbuf;
    boost::archive::text_oarchive *oa = new
boost::archive::text_oarchive(archbuf, 3 );

    const structs::POINT2D aaa = {1,2,3,4};
    const structs::LIVE_CAM aaumalivec = {5, 6, 7, 8, 9};
    const structs::POINT2D_PAIR aappp = {10, 11, 12, 13,  14, 15, 16, 17};

    const string anana = "ana acaxa kkk";

    *oa << aaa;
    *oa << aaumalivec;
    *oa << anana;
    *oa << aappp;

    std::cout << "-- archive content: >" << archbuf.str() << endl;

//    archbuf.flush();

    ofstream ofs("savedProject.imag3d");

    ofs << archbuf.str();

    ofs.close();

    delete oa;
(Continue reading)

Robert Ramey | 16 Jul 10:17

Re: Help with Access Violation in simple serialization

start with one of the demos or examples and make sure you can build
and execute it.  In fact, you should run the whole test suite.  Look
for library_status and library_test.sh and library_test.bat

Robert Ramey

Tiago da Silva wrote:
> Here is how I managed not to correct, but to work around my bug:
>
> [code]
>
>     stringstream archbuf;
>     boost::archive::text_oarchive *oa = new
> boost::archive::text_oarchive(archbuf, 3 );
>
>     const structs::POINT2D aaa = {1,2,3,4};
>     const structs::LIVE_CAM aaumalivec = {5, 6, 7, 8, 9};
>     const structs::POINT2D_PAIR aappp = {10, 11, 12, 13,  14, 15, 16,
> 17};
>
>     const string anana = "ana acaxa kkk";
>
>     *oa << aaa;
>     *oa << aaumalivec;
>     *oa << anana;
>     *oa << aappp;
>
>     std::cout << "-- archive content: >" << archbuf.str() << endl;
>
> //    archbuf.flush();
(Continue reading)

Tiago da Silva | 16 Jul 15:52

Re: Help with Access Violation in simple serialization

That's what I did... I played a lot with the serialization demos provided in
the instalation package, and they all work perfectly well... it's something
in my project that has a conflict with the boost library, and I gave up of
trying to figure it out... I'll stick with my workaround...

Tiago

On Wed, Jul 16, 2008 at 5:17 PM, Robert Ramey <ramey <at> rrsd.com> wrote:

> start with one of the demos or examples and make sure you can build
> and execute it.  In fact, you should run the whole test suite.  Look
> for library_status and library_test.sh and library_test.bat
>
> Robert Ramey
>
> Tiago da Silva wrote:
> > Here is how I managed not to correct, but to work around my bug:
> >
> > [code]
> >
> >     stringstream archbuf;
> >     boost::archive::text_oarchive *oa = new
> > boost::archive::text_oarchive(archbuf, 3 );
> >
> >     const structs::POINT2D aaa = {1,2,3,4};
> >     const structs::LIVE_CAM aaumalivec = {5, 6, 7, 8, 9};
> >     const structs::POINT2D_PAIR aappp = {10, 11, 12, 13,  14, 15, 16,
> > 17};
> >
> >     const string anana = "ana acaxa kkk";
(Continue reading)


Gmane