Skip to content

Problem when debugging app using libXPlane #1

@opt12

Description

@opt12

Hey dotsha, Thanks for bringing us this great library.
Unfortunately, I run into a problem when using your library and run my app in the debugger.
When running my app in debugbuild, but without gdb running, everything is great, however, whenever I run my app under control of gdb, the app throws and terminates.
I was able to nail down the problem to this piece of code:

recv_len = recvfrom(sock, message, sizeof(message), 0,
(struct sockaddr *) &addr, &addrlen);
time_t nowTime = time(NULL);
if (recv_len < 0) {
if (errno != EWOULDBLOCK) {
ostringstream buf;
buf << "recvfrom returned " << recv_len << " errno is " << errno
<< endl;
throw runtime_error(buf.str());
};

Obviously, the socket is not correctly established yet and hence, the recv_len == -1. So the function throws, but this is not caught anywhere.

Do you have an idea, how to resolve that problem and why it only happens when debugging the app.

Regards,
Felix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions