Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scsynth failing to start #834

Closed
federicoasara opened this issue Nov 26, 2015 · 6 comments
Closed

scsynth failing to start #834

federicoasara opened this issue Nov 26, 2015 · 6 comments
Labels

Comments

@federicoasara
Copy link

Hi there,
I'm giving a shot at Sonic Pi running on a custom built Windows PC.
There seems to be an issue with scsynth not launching.

Executing scsynth.exe manually yields:
C:\Users\Federico>"C:\Program Files (x86)\Sonic Pi\app\server\native\windows\scs
ynth.exe" -u 5998
Exception in World_New: boost::interprocess::intermodule_singleton initializatio
n failed
terminate called after throwing an instance of 'std::system_error'
what(): Invalid argument

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

(I believe that Sonic Pi uses 5994 as UDP port)

Is there a way I can help you on this? Admittedly, my experience on Windows development is close to zero (yes, choosing to try Sonic Pi on a platform I have no experience on was not a brilliant move..).
SuperCollider's own server starts without any hiccups. Possibly the binary you are shipping with the Windows bundle is not compiled correctly?

Thanks!
Fed

@xavriley
Copy link
Collaborator

Hi Fed,

If you're starting scsynth manually you need to provide some options (see https://github.com/samaaron/sonic-pi/blob/master/app/server/sonicpi/lib/sonicpi/scsynthexternal.rb#L210)

That would translate to something like

C:\Users\Federico> cd "C:\Program Files (x86)\Sonic Pi\app\server\native\windows"
C:\Program Files (x86)\Sonic Pi\app\server\native\windows> scsynth.exe -u 4556 -a 1024 -m 131072 -D 0 -R 0 -l 1

When you say there's an issue with scsynth not launching is that every time? Have you tried after a restart for example? There are known issues with zombie scsynth processes that block Sonic Pi from starting properly.

@federicoasara
Copy link
Author

Oh I see, definitely the options were different.
However, same failure (which rules out Bonjour/Rendezvous and synth defs, too. The issue seems to happen earlier.

Re. your other questions:

  • every time I launch Sonic Pi, the UI hits the timeout , and the server didn't launch because of that error;
  • a restart doesn't help;
  • there are no zombie processes around.

Do you happen to have a build of Sonic Pi + scsynth that has debug symbols? I might be able to debug this for you, assuming I figure out how to do so.
Do you build SCSynth using MinGW or Visual Studio or..? (or maybe it's a pre-packaged binary that you get somewhere else?)
I wonder if I can replace the bundled scsynth.exe binary with something coming directly from SuperCollider.. I'll give it a shot now.

@federicoasara
Copy link
Author

Yes! Replacing a few libraries did the trick.

So, from SuperCollider 3.6.6 I copied: libscsynth.dll, libscsynth.dll.a (.dll.a on Win32?) and scsynth.exe.
These three files had different sizes between SuperCollider and Sonic Pi v2.8 that's available on your main website.

You might want to repack/rebuild your native/windows distribution of scsynth.

I'm installing mingw, I might manage to get some information out of the dll and the executable - so far, there is a difference in size and that's it.
Let me know if there is any other information you might find helpful.

@federicoasara
Copy link
Author

Alright, so.. this is what I dug up:

The stack trace:
#0 0x63ab54b8 in cxa_throw ()
from c:\Program Files (x86)\Sonic Pi\app\server\native\windows - Copy\libscsy
nth.dll
#1 0x63ac1b63 in windows_bootstamp (this=0x1fb9c10)
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/shared_dir_helpers.hpp:39
#2 boost::interprocess::ipcdetail::intermodule_singleton_impl<boost::interproce
ss::ipcdetail::windows_bootstamp, true, false, boost::interprocess::ipcdetail::i
ntermodule_singleton_helpers::windows_semaphore_based_map>::init_atomic_func::op
erator() (this=)
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/intermodule_singleton_common.hpp:403
#3 0x63ac035e in atomic_func<boost::interprocess::ipcdetail::intermodule_single
ton_impl<boost::interprocess::ipcdetail::windows_bootstamp, true, false, boost::
interprocess::ipcdetail::intermodule_singleton_helpers::windows_semaphore_based

map>::init_atomic_func> (f=...,
this=0x63ada370 <boost::interprocess::ipcdetail::intermodule_singleton_commo
n<boost::interprocess::ipcdetail::intermodule_singleton_helpers::windows_semapho
re_based_map>::mem_holder>)
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/windows_intermodule_singleton.hpp:214
#4 atomic_func<boost::interprocess::ipcdetail::intermodule_singleton_impl<boost
::interprocess::ipcdetail::windows_bootstamp, true, false, boost::interprocess::
ipcdetail::intermodule_singleton_helpers::windows_semaphore_based_map>::init_ato
mic_func> (f=..., map=...)
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/windows_intermodule_singleton.hpp:288
#5 singleton_constructor (map=...)
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/intermodule_singleton_common.hpp:466
#6 initialize_singleton_logic (phoenix=false, constructor=,
this_module_singleton_initialized=@0x63ada36c: 1, ptr=@0x63ada368: 0x0)
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/intermodule_singleton_common.hpp:127
#7 atentry_work ()
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/intermodule_singleton_common.hpp:340
#8 get ()
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/intermodule_singleton_common.hpp:330
#9 get_bootstamp (add=true, s=...)
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/shared_dir_helpers.hpp:49
#10 get_shared_dir (shared_dir=...)
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/shared_dir_helpers.hpp:121
#11 shared_filepath (filepath=...,
filename=0x1fb7dfc "SuperColliderServer_4556")
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/detail/shared_dir_helpers.hpp:128
#12 boost::interprocess::shared_memory_object::remove (
filename=0x1fb7dfc "SuperColliderServer_4556")
at C:/msys/home/sc/sources/supercollider/external_libraries/boost/boost/inte
rprocess/shared_memory_object.hpp:224
#13 0x63a9c239 in cleanup (port_number=)
at c:/msys/home/sc/sources/supercollider/server/scsynth/../../common/server

shm.hpp:127
#14 World_New (inOptions=0x28fc7c)
at c:/msys/home/sc/sources/supercollider/server/scsynth/SC_World.cpp:385
#15 0x00403032 in main (argc=3, argv=0x1fcf198)
at c:/msys/home/sc/sources/supercollider/server/scsynth/scsynth_main.cpp:315

Is it possible you are being hit by something similar to:
https://svn.boost.org/trac/boost/ticket/11660
(which sounds weird enough, I don't understand the link with IIS and this crash)

given how it's used here?
https://github.com/supercollider/supercollider/blob/master/external_libraries/boost/boost/interprocess/detail/shared_dir_helpers.hpp#L41

@xavriley
Copy link
Collaborator

xavriley commented Mar 4, 2016

Hi,

Sorry I went AWOL on this one. I started a new job around the time this was filed so things got a bit crazy!

It's quite possible you've found a bug in SuperCollider here but I don't really know enough about the Windows build to say for sure.

On a separate note, we could always do with more people who know about Windows - we're having to work really hard to try and fix these issues and the majority of the core team are Linux/Mac users. Any contributions/suggestions are very welcome.

After you filed this issue we've put together a more detailed document on the Windows build process which might answer some of your questions. https://github.com/samaaron/sonic-pi/blob/master/INSTALL-WINDOWS.md

@samaaron
Copy link
Collaborator

Closing for now as this conversation appears to have waned.

Please feel free to re-open a new issue if you're still having issues with v3.1.0+. Posting the full error report will help us find a solution :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants