Code Monkey home page Code Monkey logo

Comments (11)

mom040267 avatar mom040267 commented on April 28, 2024

The problem is that pthread_create(...) on error returns not a negative value. It returns an error number that is positive. So, if the thread creation failed, then we treat it as success, but the content of the thread id is undefined. This is why the detach function is crashing. I can fix it in the next build. But why the thread creation is failing is unclear, probably your debugger is doing something wrong.

from coturn.

mom040267 avatar mom040267 commented on April 28, 2024

I pushed the fix to the master branch. You can try that and let me know please.

from coturn.

jonesmz avatar jonesmz commented on April 28, 2024

I've confirmed that git master doesn't crash as soon as I start it in the debugger. (Didn't bother checking to confirm everything else is working in the debugger, only that it doesn't crash right away).

Much appreciated!

from coturn.

jonesmz avatar jonesmz commented on April 28, 2024

This problem is back in 4.5.0.3

from coturn.

mom040267 avatar mom040267 commented on April 28, 2024

from coturn.

jonesmz avatar jonesmz commented on April 28, 2024

I'm very sorry, I wrote the wrong version number.

The version that I'm running is 4.5.0.4, the latest release.

I'll try testing the latest git master branch.

from coturn.

jonesmz avatar jonesmz commented on April 28, 2024

Latest git master branch has the same problem:

static void setup_auth_server(struct auth_server *as)
{
if(pthread_create(&(as->thr), NULL, run_auth_server_thread, as)) {
perror("Cannot create auth thread\n");
exit(-1);
}
pthread_detach(as->thr);
}

the call to pthread_detach triggers segmentation fault.

I'm running with qtcreator 4.0.3
gdb 7.12
coturn was compiled with gcc 4.9.3

from coturn.

mom040267 avatar mom040267 commented on April 28, 2024

from coturn.

jonesmz avatar jonesmz commented on April 28, 2024

What version of gdb do you use? I can install and try that version.

from coturn.

mom040267 avatar mom040267 commented on April 28, 2024

from coturn.

jonesmz avatar jonesmz commented on April 28, 2024

So you can't reproduce the issue?

from coturn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.