Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6241785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:49:53+00:00 2026-05-24T11:49:53+00:00

Months ago I implemented a component which receives data via UDP-network, deserializes it via

  • 0

Months ago I implemented a component which receives data via UDP-network, deserializes it via Boost::Serialization and starts working with the incoming objects.

After some time of using this component random crashes occured, which I could solve when finding out that someone else is sending data to my UDP-Port.

I solved this problem by simply adding a try/catch around the deserialization:

try
{
    boost::archive::text_iarchive inputArchive(incomingData);
    inputArchive >> givenElements; //the actual deserialization, here the exception has been thrown in the past
}
catch( boost::archive::archive_exception& ex )
{
    std::cout << "Archive Exception during deserializing:" << std::endl;
    std::cout << ex.what() << std::endl;
    std::cout << "Incoming data had the following content:" << std::endl;
    std::cout << dataStream.str() << std::endl;
}

The above code sorted out any foreign/corrupt data coming in via network and just deserializes data which was meant to be.

Back then I worked with an older Boost-Version (I don’t know really well, 1.44, 1.42?) on a Linux-Machine.

Currently I have to use the component again on a Windows XP machine with a fairly new Boost 1.46.1.
Now the problem is, that the try/catch does not seem to filter the foreign/corrupt data anymore. As far as something from that code is incoming, my application crashes without any error-message.

It is not possible for me to change the Port I’m listening to. Besides that I want to create a robust application which ignores data it could not work with instead of crashing.

I’m now wondering if anyone has an idea why this effect occurs? Has Boost been getting less robust? Is this something with the OS? I have no idea and hope this is kind of a question someone who is “more into Boost” could answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:49:53+00:00Added an answer on May 24, 2026 at 11:49 am

    My answer is not directly related to boost serialization but it is always a good idea to do some validation on incoming data from network before entering deeper logic.

    Before diving deep into boost serialization I suggest you :

    1. Check the size of UDP packet
    2. If you are using some kind of header do some validation
    3. Whatever seems appropriate for you case

    and then try to deserialize the packet. This way you can filter out foreign packets yourself instead of *relying on boost.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

2 months ago I was writing a web-application which use some classes to draw
I implemented 6 months ago in our web application site(Asp.Net) a page where you
A Chrome extension I built a few months ago has been working fine until
Some months ago I read a blog post which had a comparison of different
I have implemented a couple of months ago the in app auto renewable subscription
12 months ago I developed an iPhone app which was rejected by the app
Several months ago I implemented a solution to choose unique values from a range
few months ago I've been using some ruby library ( I can't recall which
About 2 months ago, I imported EnWikipedia data(http://dumps.wikimedia.org/enwiki/20120211/) into mysql. After finished importing EnWikipedia
Few months ago, I have came across a Silverlight tutorial of Eric Cartman (South

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.