Coder Social home page Coder Social logo

pd-websocketserver's People

Stargazers

 avatar

Watchers

 avatar  avatar

pd-websocketserver's Issues

Crash on macOS

Building and testing on a 10.10 hackintosh. There's a osx-10.10 branch with some #ifdef for apple.

It seems the problem is when entering the base64_encode() function :

*dest = base64_encode(hash, SHA1HashSize, NULL);

I get a segfault.

This is the debugger:

(lldb) target create "./pd"
Current executable set to './pd' (x86_64).
(lldb) run
Process 856 launched: './pd' (x86_64)
Process 856 stopped
* thread #5: tid = 0x27db, 0x00007fff90fc4f4f Heimdal`base64_encode + 277, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00007fff90fc4f4f Heimdal`base64_encode + 277
Heimdal`base64_encode:
->  0x7fff90fc4f4f <+277>: movq   %rax, (%r14)
    0x7fff90fc4f52 <+280>: movq   %rax, %rdi
    0x7fff90fc4f55 <+283>: callq  0x7fff90fe6bf4            ; symbol stub for: strlen
    0x7fff90fc4f5a <+288>: jmp    0x7fff90fc4f68            ; <+302>
(lldb) bt
* thread #5: tid = 0x27db, 0x00007fff90fc4f4f Heimdal`base64_encode + 277, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x00007fff90fc4f4f Heimdal`base64_encode + 277
    frame #1: 0x0000000100279976 websocketserver.pd_darwin`get_handshake_accept + 214
    frame #2: 0x0000000100279ab8 websocketserver.pd_darwin`get_handshake_response + 232
    frame #3: 0x000000010027a9ca websocketserver.pd_darwin`ws_establishconnection + 234
    frame #4: 0x00007fff86a422fc libsystem_pthread.dylib`_pthread_body + 131
    frame #5: 0x00007fff86a42279 libsystem_pthread.dylib`_pthread_start + 176
    frame #6: 0x00007fff86a404b1 libsystem_pthread.dylib`thread_start + 13

race conditions

The functions onopen, onclose and onmessage seem to be called from the network thread, but they call Pd API methods that are not thread-safe, e.g. outlet_list or outlet_float. You have to either

a) protect Pd with sys_lock + sys_unlock before/after calling such methods

or

b) use a thread-safe queue which is polled regularly from Pd's scheduler with a clock.

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.