ERROR: Primitive '_NetAddr_SendMsg' failed. Bis

Hi,

I’m on my my macbook air m1, and SuperCollider is not booting. I get two errors:

The final line at post window:

*** ERROR: failed to open UDP socket: bind: Can't assign requested address
Server 'localhost' exited with exit code 1.

Some few lines before this:


SCDoc: Indexing help-files...
SCDoc: Indexed 2107 documents in 0.5 seconds
ERROR: Primitive '_NetAddr_SendMsg' failed.
caught exception 'send_to: Can't assign requested address' in primitive in method NetAddr:sendMsg
RECEIVER:
Instance of NetAddr {    (0x158082a38, gc=34, fmt=00, flg=00, set=02)
  instance variables [4]
    addr : Integer 2130706433
    port : Integer 57110
    hostname : "127.0.0.1"
    socket : nil
}
CALL STACK:
	MethodError:reportError
		arg this = <instance of PrimitiveFailedError>
	Nil:handleError
		arg this = nil
		arg error = <instance of PrimitiveFailedError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of PrimitiveFailedError>
	Object:throw
		arg this = <instance of PrimitiveFailedError>
	Object:primitiveFailed
		arg this = <instance of NetAddr>
	Server:prPingApp
		arg this = <instance of Server>
		arg func = <instance of Function>
		arg onFailure = <instance of Function>
		arg timeout = 0.25
		var id = -2062595420
		var resp = <instance of OSCFunc>
		var task = <instance of Routine>
	Server:boot
		arg this = <instance of Server>
		arg startAliveThread = true
		arg recover = false
		arg onFailure = nil
	Interpreter:interpretPrintCmdLine
		arg this = <instance of Interpreter>
		var res = nil
		var func = <instance of Function>
		var code = "s.boot;"
		var doc = nil
		var ideClass = <instance of Meta_ScIDE>
	Process:interpretPrintCmdLine
		arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Primitive '_NetAddr_SendMsg' failed.
caught exception 'send_to: Can't assign requested address' in primitive in method NetAddr:sendMsg
RECEIVER: a NetAddr(127.0.0.1, 57110)

SuperCollider had been working well until yesterday, which was the day I installed a MAX/MSP Trial Version and also downloaded MaxForLive’s Connection Kit (to be able to use it with a downgraded version of TouchOSC which was installed in an old iPad). So I am not willing to uninstall Max o MaxforLive just yet. I think this is the cause of SuperCollider not booting. I would like to fix this. I killed all servers and tried to reboot, but no. I uninstalled and reinstalled SC too, with no success.

Can you try restarting your computer, and starting SC first to see if the server boots?
I would suspect something else has bound to that port. If it boots on a restart, you can then try starting other programs to see where the conflict is, and then we can offer solutions for configuring SC to avoid out.

I restarted the computer. Opened SC. Before booting, the post window shows something about the NetAddr:

compiling class library...
	Found 855 primitives.
	Compiling directory '/Applications/SuperCollider.app/Contents/Resources/SCClassLibrary'
	Compiling directory '/Users/ofelia/Library/Application Support/SuperCollider/Extensions'
	Compiling directory '/Users/ofelia/Library/Application Support/SuperCollider/downloaded-quarks/Vowel'
	Compiling directory '/Users/ofelia/Library/Application Support/SuperCollider/downloaded-quarks/Dirt-Samples'
	Compiling directory '/Users/ofelia/Library/Application Support/SuperCollider/downloaded-quarks/SuperDirt'
	numentries = 1510392 / 24466884 = 0.062
	6627 method selectors, 3692 classes
	method table size 24638832 bytes, big table size 195735072
	Number of Symbols 17361
	Byte Code Size 584120
	compiled 678 files in 0.48 seconds
compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Class tree inited in 0.01 seconds
ERROR: Primitive '_NetAddr_SendMsg' failed.
caught exception 'send_to: Can't assign requested address' in primitive in method NetAddr:sendMsg
RECEIVER:
Instance of NetAddr {    (0x120052a38, gc=78, fmt=00, flg=00, set=02)
  instance variables [4]
    addr : Integer 2130706433
    port : Integer 57110
    hostname : "127.0.0.1"
    socket : nil
}

PROTECTED CALL STACK:
	Meta_MethodError:new	0x14874d480
		arg this = PrimitiveFailedError
		arg what = caught exception 'send_to: Can't assign requested address' in primitive in method NetAddr:sendMsg
		arg receiver = a NetAddr(127.0.0.1, 57110)
	Meta_PrimitiveFailedError:new	0x148765d00
		arg this = PrimitiveFailedError
		arg receiver = a NetAddr(127.0.0.1, 57110)
	Object:primitiveFailed	0x1200b2e00
		arg this = a NetAddr(127.0.0.1, 57110)
	Server:sendMsg	0x149a67500
		arg this = localhost
		arg msg = nil
	SynthDef:doSend	0x149d6f140
		arg this = a SynthDef
		arg server = localhost
		arg completionMsg = nil
		var bytes = Int8Array[ 83, 67, 103, 102, 0, 0, 0, 2, 0, 1, 12, 112, 98, 105, 110, 100, 70, 120, 95, 122, 101, 114, 111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3, 111, 117, 116, 0, 0, 0, 0, 0, 0, 0, 3, 7, 67, 111, 110, 116, 114, 111, 108, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 68, 67, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 2, 10, 82, 101, 112, 108, 97, 99, 101, 79, 117, 116, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 ]
		var path = nil
		var resp = nil
		var syncID = nil
	a FunctionDef	0x149919180
		sourceCode = "<an open Function>"
		arg item = a Function
	ArrayedCollection:do	0x1497b8640
		arg this = [ nil, nil, nil, a Function ]
		arg function = a Function
		var i = 3
	Set:do	0x149918dc0
		arg this = IdentitySet[ a Function ]
		arg function = a Function
		var i = 0
	a FunctionDef	0x149d78d00
		sourceCode = "<an open Function>"
		var bytes = Int8Array[ 83, 67, 103, 102, 0, 0, 0, 2, 0, 1, 12, 112, 98, 105, 110, 100, 70, 120, 95, 122, 101, 114, 111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3, 111, 117, 116, 0, 0, 0, 0, 0, 0, 0, 3, 7, 67, 111, 110, 116, 114, 111, 108, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 68, 67, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 2, 10, 82, 101, 112, 108, 97, 99, 101, 79, 117, 116, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 ]
		var desc = nil
	Function:prTry	0x148a39200
		arg this = a Function
		var result = nil
		var thread = a Thread
		var next = nil
		var wasInProtectedFunc = false
	
CALL STACK:
	MethodError:reportError
		arg this = <instance of PrimitiveFailedError>
	Nil:handleError
		arg this = nil
		arg error = <instance of PrimitiveFailedError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of PrimitiveFailedError>
	Object:throw
		arg this = <instance of PrimitiveFailedError>
	Function:protect
		arg this = <instance of Function>
		arg handler = <instance of Function>
		var result = <instance of PrimitiveFailedError>
	SynthDef:store
		arg this = <instance of SynthDef>
		arg libname = 'global'
		arg dir = "/Users/ofelia/Library/Applic..."
		arg completionMsg = nil
		arg mdPlugin = nil
		var lib = <instance of SynthDescLib>
		var file = <instance of File>
		var path = "/Users/ofelia/Library/Applic..."
	Meta_AddEventTypes_PbindFx:makeZeroSynthDef
		arg this = <instance of Meta_AddEventTypes_PbindFx>
	< closed FunctionDef >  (no arguments or variables)
	Function:doOnStartUp
		arg this = <instance of Function>
	ArrayedCollection:do
		arg this = [*7]
		arg function = <instance of Function>
		var i = 6
	List:do
		arg this = <instance of List>
		arg function = <instance of Function>
	Meta_StartUp:run
		arg this = <instance of Meta_StartUp>
	Main:startup
		arg this = <instance of Main>
		var didWarnOverwrite = false
^^ The preceding error dump is for ERROR: Primitive '_NetAddr_SendMsg' failed.
caught exception 'send_to: Can't assign requested address' in primitive in method NetAddr:sendMsg
RECEIVER: a NetAddr(127.0.0.1, 57110)


SCDoc: Indexing help-files...
SCDoc: Indexed 2107 documents in 0.59 seconds

For “caught exception” errors, the text comes from the OS call or library doing the work, so “Can’t assign requested address” is important. Note that port conflicts are reported as “*** ERROR: failed to open UDP socket: address in use” so “something else has bound to that port” may not be the cause.

A quick web search for localhost "Can't assign requested address" macos doesn’t turn up a conclusive answer. However many page results suggest software incompatibility as the cause, so you may be onto something with the M4L Connection Kit.

Maybe M4L people know something about what the Connection Kit is doing? It might not be a SC problem.

hjh

Another thing that I did while configuring TouchOSC was to create an adhoc network from terminal:
sudo networksetup -createnetworkservice AdHoc lo0
sudo networksetup -setmanual AdHoc 192.168.1.88 255.255.255.255

This creates a wifi network with password where touchOSC can connect to. But it’s not even necessary to use this network. One can just connect to the local IP address. I’m no expert at networks, but those cmd lines don’t seem be in to conflict with SC ports like 57110. Using sudo is just giving a new IP address, and no ports are being specified.

What does socket: nil mean? Should it say something different? Can it be specified manually?

If I’m understanding the web search results correctly, the “Can’t assign requested address” message is about the IP address… and an ad-hoc network could interfere with that. (Maybe…? I’m not sure exactly what the ad-hoc network is doing.)

The error message is not about ports, AFAICS.

Can SC server boot if you turn off the ad-hoc network?

hjh

I eliminated the adhoc network from the computer’s network panel, but this doesn’t make a difference.

Aaaawwww, I will never be able to SuperCollider again!!

As another test, could you try:

s.options.bindAddress = "0.0.0.0";
s.boot;

Based on ServerOptions | SuperCollider 3.12.2 Help – the default is 127.0.0.1, which would explain the presence of that address in the error message. 0.0.0.0 is more permissive (thus potentially more dangerous on WiFi networks to which others have access) but valuable to try. If this works and 127.0.0.1 doesn’t work, then 1/ you have a workaround, and 2/ it’s useful troubleshooting information.

Btw: I would strongly suggest that you also raise this with Cycling '74, and/or the developer of the M4L Connection Kit. Your thinking now is that you see the error in SC – therefore it’s a SC problem. Another view is: SC was fine until installing Max – therefore Max (or M4L Connection Kit) changed something that causes the problem. If that’s the case, then maybe SC people don’t have the answer. It’s better in this case to discuss both ends of the scenario.

hjh

When I use the bindAddress 0.0.0.0, and then s.boot, SuperCollider does indicate this message:

SC_AudioDriver: sample rate = 44100.000000, driver's block size = 512
SuperCollider 3 server ready.

The Interpreter has green color, but the Server numbers at the lower right side corner of the screen remain white.

I’m also getting a bunch of these error messages:

*** ERROR: dlopen '/Users/ofelia/Library/Application Support/SuperCollider/Extensions/SC3plugins/AYUGens/AY_UGen.scx' err 'dlopen(/Users/ofelia/Library/Application Support/SuperCollider/Extensions/SC3plugins/AYUGens/AY_UGen.scx, 0x0002): tried: '/Users/ofelia/Library/Application Support/SuperCollider/Extensions/SC3plugins/AYUGens/AY_UGen.scx' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))'
*** ERROR: dlopen '/Users/ofelia/Library/Application Support/SuperCollider/Extensions/SC3plugins/AYUGens/AY_UGen_supernova.scx' err 'dlopen(/Users/ofelia/Library/Application Support/SuperCollider/Extensions/SC3plugins/AYUGens/AY_UGen_supernova.scx, 0x0002): tried: '/Users/ofelia/Library/Application Support/SuperCollider/Extensions/SC3plugins/AYUGens/AY_UGen_supernova.scx' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))'

I believe this means you’ve installed the Intel build of sc3-plugins on an M1 machine.

About the “Can’t assign” error… I overlooked the fact that both sclang and scsynth are unable to use localhost (127.0.0.1).

This is very weird. In 20 years, I’ve never seen this.

Have you sought advice in the Cycling '74 forums?

hjh

I believe this means you’ve installed the Intel build of sc3-plugins on an M1 machine.

Oh!

No, I haven’t. SC started working again, just like that, no reason.