Re: [Dorset] Cannot Run Sonic Pi as an Ordinary User

2015-09-08 Thread Terry Coles
On Tuesday 08 Sep 2015 12:21:11 Ralph Corderoy wrote:
> These look odd.
> 
> [pid  8184] execve(0x1e43b50, [0x1e43aa0], [/* 0 vars */]) = 0
> [pid  8183] +++ killed by SIGKILL +++
> [pid  8170] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED,
> si_pid=8183, si_status=SIGKILL, si_utime=0, si_stime=0} ---
> 
> The KILL signal is number 9, see `kill -l', often seen in the overused
> `kill -9'.  Either one part of the code is killing it, or some external
> thing is, like the kernel's out-of-memory, OOM, manager, but that would
> send a TERM signal
> 
> 8170 is being told of 8183's death with a CHLD, child, signal, so that
> means it was the parent that started it.
> 
> I'd widen what strace reports and see if activity laeding up to the KILL
> sheds light.
> 
> LC_ALL=C strace -f -o /tmp/st.out ./rp-app-bin

Well I ran it, but I can't say that I understand enough of what is going on to 
see the 
problem.  I've uploaded the full results to:
http://www.hadrian-way.co.uk/Misc/st.out[1] 

To me though, the key events appear to occur about 70% in:

8775  open(0x1d19490, O_RDONLY 
8761  wait4(8774,  
8775  <... open resumed> )  = -1 ENOENT (No such file or directory)
8761  <... wait4 resumed> 0x7fff7c2a864c, WNOHANG, NULL) = 0
8775  open(0x1d194e0, O_RDONLY 
8761  kill(8774, SIGKILL 
8775  <... open resumed> )  = -1 ENOENT (No such file or directory)
8761  <... kill resumed> )  = 0
8775  open(0x1d194e0, O_RDONLY 
8761  wait4(8774,  
8775  <... open resumed> )  = -1 ENOENT (No such file or directory)
8775  open(0x1d19540, O_RDONLY) = -1 ENOENT (No such file or directory)
8775  open(0x1d194e0, O_RDONLY) = -1 ENOENT (No such file or directory)
8775  open(0x1d19400, O_RDONLY) = -1 ENOENT (No such file or directory)
8775  read(6, "", 4096) = 0
8775  close(6)  = 0
8775  munmap(0x7f0876512000, 4096)  = 0
8774  +++ killed by SIGKILL +++
8761  <... wait4 resumed> [?], 0, NULL) = 8774
8775  access(0x1d191b0, F_OK 
8761  --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=8774, 
si_status=SIGKILL, si_utime=0, si_stime=0} ---
8775  <... access resumed> )= 0
8761  epoll_wait(3,  
8775  stat(0x1d191b0,  
8761  <... epoll_wait resumed> {?} 0x7fff7c2a8530, 64, -1) = 1
8775  <... stat resumed> {...}) = 0
8761  recvmsg(9,  
8775  futex(0x7f087475e0d0, FUTEX_WAKE_PRIVATE, 2147483647  

BTW, strace never comes back and it simply keeps appending lines at the bottom 
at 
intervals until it is killed.

-- 

Terry Coles




[1] http://www.hadrian-way.co.uk/Misc/st.out
--
Next meeting:  Bournemouth, Tuesday, 2015-10-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Cannot Run Sonic Pi as an Ordinary User

2015-09-08 Thread Ralph Corderoy
Hi Terry,

> > LC_ALL=C strace -fe execve ./rp-app-bin
> 
> I ran that and got the result at:
> 
> http://www.hadrian-way.co.uk/Misc/strace_output.txt

These look odd.

[pid  8184] execve(0x1e43b50, [0x1e43aa0], [/* 0 vars */]) = 0
[pid  8183] +++ killed by SIGKILL +++
[pid  8170] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=8183,
si_status=SIGKILL, si_utime=0, si_stime=0} ---

The KILL signal is number 9, see `kill -l', often seen in the overused
`kill -9'.  Either one part of the code is killing it, or some external
thing is, like the kernel's out-of-memory, OOM, manager, but that would
send a TERM signal

8170 is being told of 8183's death with a CHLD, child, signal, so that
means it was the parent that started it.

I'd widen what strace reports and see if activity laeding up to the KILL
sheds light.

LC_ALL=C strace -f -o /tmp/st.out ./rp-app-bin

Cheers, Ralph.

--
Next meeting:  Bournemouth, Tuesday, 2015-10-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Cannot Run Sonic Pi as an Ordinary User

2015-09-08 Thread Terry Coles
On Tuesday 08 Sep 2015 11:23:36 Ralph Corderoy wrote:
> I Googled for that error message and arrived at
> https://github.com/samaaron/sonic-pi/blob/master/app/gui/qt/mainwindow.cpp#L

Huh  I googled for the error message and got no hits remotely like that (I 
tried 
the two sentences separately too).  Can I ask what incantation you used?

> 652 Combine that with
> 
> LC_ALL=C strace -fe execve ./rp-app-bin
> 
> and see if you can determine if an execve(2) is failing, i.e. returning
> -1, and it giving up in response.  You might be able to see what it's
> attempting and, from the code, why.

I ran that and got the result at:

http://www.hadrian-way.co.uk/Misc/strace_output.txt[1] 

(I've put it in a file for clarity; it wraps in the message.)

However, I can't make out from that what went wrong.  The dialog box signalling 
the 
error pops up immediately after the Sonic Pi banner.  There is a splash screen 
and 
then when this is dismissed, the error pops up.

-- 

Terry Coles




[1] http://www.hadrian-way.co.uk/Misc/strace_output.txt
--
Next meeting:  Bournemouth, Tuesday, 2015-10-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Cannot Run Sonic Pi as an Ordinary User

2015-09-08 Thread Ralph Corderoy
Hi Terry,

> It's an ELF binary:
> 
> terry@Optiplex:/usr/src/sonic-pi-master/app/gui/qt$ ls -la sonic-pi
> -rwxr-xr-x 1 root root 3151986 Sep  7 14:47 sonic-pi

I Googled for that error message and arrived at
https://github.com/samaaron/sonic-pi/blob/master/app/gui/qt/mainwindow.cpp#L652
Combine that with

LC_ALL=C strace -fe execve ./rp-app-bin

and see if you can determine if an execve(2) is failing, i.e. returning
-1, and it giving up in response.  You might be able to see what it's
attempting and, from the code, why.

Cheers, Ralph.

--
Next meeting:  Bournemouth, Tuesday, 2015-10-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Cannot Run Sonic Pi as an Ordinary User

2015-09-08 Thread Terry Coles
On Tuesday 08 Sep 2015 10:14:01 Ralph Corderoy wrote:
> This script that you're running,
> 
> doesn't contain
> 
> > Apologies, a critical error occurred during startup:
> > Ruby could not be started, is it installed and in your PATH?
> 
> so I'd look at sonic-pi that sits alongside rp-app-bin and see if that's
> also a script with logic you can follow.

It's an ELF binary:

terry@Optiplex:/usr/src/sonic-pi-master/app/gui/qt$ ls -la sonic-pi
-rwxr-xr-x 1 root root 3151986 Sep  7 14:47 sonic-pi

> It's common for errors to be misreported;  it could be anything going
> wrong and, instead of letting that filter up to you, it's being caught
> and turned into a "Ruby could not be started".

Yes, I was rapidly coming to that conclusion.

-- 

Terry Coles



--
Next meeting:  Bournemouth, Tuesday, 2015-10-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Cannot Run Sonic Pi as an Ordinary User

2015-09-08 Thread Ralph Corderoy
Hi Terry,

This script that you're running,

> eval $(dbus-launch --auto-syntax)
> DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
> $DIR/sonic-pi

doesn't contain

>   Apologies, a critical error occurred during startup:
>   Ruby could not be started, is it installed and in your PATH?

so I'd look at sonic-pi that sits alongside rp-app-bin and see if that's
also a script with logic you can follow.

It's common for errors to be misreported;  it could be anything going
wrong and, instead of letting that filter up to you, it's being caught
and turned into a "Ruby could not be started".

Cheers, Ralph.

--
Next meeting:  Bournemouth, Tuesday, 2015-10-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


Re: [Dorset] Cannot Run Sonic Pi as an Ordinary User

2015-09-08 Thread Terry Coles
Hi again,
 
Some progress since yesterday; namely I have now got jack working and I can 
use the tool - providing that I sudo the launch script and pause anything else 
that is using the audio output at the time.
 
However, I still have the same problem if I try to launch it as myself.  The 
dialog box still says:
Apologies, a critical error occurred during startup:
 
Ruby could not be started, is it installed and in your PATH?
 
The details given in the dialog are now different; to save space in this 
message I've put the original, the latest and the output from diff in a folder 
on my website; see:
 
http://www.hadrian-way.co.uk/Misc/SonicPi_Errors.txt
http://www.hadrian-way.co.uk/Misc/SonicPi_Errors_2.txt
http://www.hadrian-way.co.uk/Misc/SonicPi_Errors_Diff.txt 
 
BTW.  It doesn't show up in the Detailed Errors list, but I had to install 
IBus to get the application to work, even as root.  I'm not sure what that 
does in this context, but I assume that it's something to do with the editor.
 
BTW2.  I've also experimented with adding myself to some groups (audio, pulse, 
pulse-access), but that had no effect.
 
Any other ideas?

-- 

Terry Coles



--
Next meeting:  Bournemouth, Tuesday, 2015-10-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR


[Dorset] Cannot Run Sonic Pi as an Ordinary User

2015-09-07 Thread Terry Coles
Hi,

So I built the Sonic Pi code and it is installed and launched by running the 
following script in  /usr/src/sonic-pi-master/app/gui/qt/.

rp-app-bin:

#!/bin/bash

#--
# This file is part of Sonic Pi: http://sonic-pi.net
# Full project source: https://github.com/samaaron/sonic-pi
# License: https://github.com/samaaron/sonic-pi/blob/master/LICENSE.md
#
# Copyright 2013, 2014, 2015 by Sam Aaron (http://sam.aaron.name).
# All rights reserved.
#
# Permission is granted for use, copying, modification, and
# distribution of modified versions of this work as long as this
# notice is included.
#++

eval $(dbus-launch --auto-syntax)

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

$DIR/sonic-pi

If I launch it with sudo ./rp-app-bin it launches Sonic Pi and I get the 
ability to enter notes etc.  (It doesn't work yet, but I think that is to do 
with jack.  I'll worry about that later.)

If I launch the same script as myself, I get a dialog with:

Apologies, a critical error occurred during startup:

Ruby could not be started, is it installed and in your PATH?

Please consider reporting a bug at
http://github.com/samaaron/sonic-pi/issues

Clearly, ruby is installed, since it works when I sudo the script.  When I 
invoke env, I can see the directory containing ruby (/usr/bin/) listed.

There are also some details given in the dialog:

Detailed Error Report:

GUI log
---
[GUI] - shutting down any old audio servers...
[GUI] - using default editor colours
[GUI] - booting live coding server
[GUI] - booting live coding server
[GUI] - starting UDP OSC Server on port 4558...
[GUI] - UDP OSC Server ready and listening
[GUI] - waiting for server to connect...
[GUI] - server connection established
[GUI] - loading workspaces
[GUI] - saving workspaces
[GUI] - asking server process to exit...
[GUI] - server asked us to exit
[GUI] - exiting. Cheerio :-)

Server Errors
-
ERROR system:playback_1 not a valid port
ERROR system:playback_2 not a valid port
ignoring {:type=>:job, :jobid=>1, :action=>:start, 
:jobinfo=>{:workspace=>"Workspace 0"}}
ignoring {:type=>:job, :jobid=>1, :action=>:killed}
ignoring {:type=>:job, :jobid=>1, :action=>:completed, 
:jobinfo=>{:workspace=>"Workspace 0"}}
ignoring {:type=>:job, :jobid=>2, :action=>:start, 
:jobinfo=>{:workspace=>"Workspace 0"}}
ignoring {:type=>:job, :jobid=>2, :action=>:killed}
ignoring {:type=>:job, :jobid=>2, :action=>:completed, 
:jobinfo=>{:workspace=>"Workspace 0"}}

Server Output
-
Using protocol: udp
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 16000.00, driver's block size = 1024
SuperCollider 3 server ready.
exception in GrafDef_Load: UGen 'MdaPiano' not installed.
while reading file '/usr/src/sonic-pi-master/etc/synthdefs/compiled/sonic-pi-
piano.scsyndef'
exception in GrafDef_Load: UGen 'Decimator' not installed.
while reading file '/usr/src/sonic-pi-master/etc/synthdefs/compiled/sonic-pi-
fx_bitcrusher.scsyndef'
late 0.197549483
late 0.044707808
late 0.108747585
late 0.103747470
FAILURE IN SERVER /n_free Node 84 not found
saving: workspace_zero.spi
saving: workspace_zero.spi
saving: workspace_zero.spi
saving: workspace_one.spi
saving: workspace_two.spi
saving: workspace_three.spi
saving: workspace_four.spi
saving: workspace_five.spi
saving: workspace_six.spi
saving: workspace_seven.spi
saving: workspace_eight.spi
saving: workspace_nine.spi


Any ideas?  MdaPiano and Decimator seem to be causing an issue, but I don't 
see why the ruby bit is being thrown up.

-- 

Terry Coles



--
Next meeting:  Bournemouth, Tuesday, 2015-10-06 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:dorset@mailman.lug.org.uk / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR