Pthread "manager" thread crashed due to get signal 33 - pthreads

I have linux application on embedded linux that uses pthread library. From time to time pthread "manager" thread get signal 33 and crashed.
How do I know who is sending the signal?
Strace log:
...
18:15:07 getppid() = 30
18:15:07 poll([{fd=31, events=POLLIN}], 1, 2000) = 0
18:15:09 getppid() = 30
18:15:09 poll([{fd=31, events=POLLIN}], 1, 2000) = 0
18:15:11 getppid() = 30
18:15:11 poll([{fd=31, events=POLLIN}], 1, 2000) = 0
18:15:13 getppid() = 30
18:15:13 poll([{fd=31, events=POLLIN}], 1, 2000) = -1 EINTR (Interrupted system call)
18:15:13 --- SIGRT_1 (Unknown signal 33) # 0 (0) ---
18:15:13 getppid() = 30
18:15:13 wait4(-1, [WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV], WNOHANG|__WCLONE, NULL) = 68
18:15:13 --- SIGSEGV (Segmentation fault) # 0 (0) ---

Signal 33 is used internally by the pthreads library (it is referred to as SIGSETXID, and is raised by the library for every thread whenever one of the uids or gids of the process are changed).
It should not cause a thread to crash. Why do you believe this signal is responsible?

Related

Object does not exist in the pdf file structure

%PDF-1.5
...
10737 0 obj
<</MarkInfo<</Marked true>>/Metadata 161 0 R/PageLayout/OneColumn/Pages 10732 0 R/StructTreeRoot 206 0 R/Type/Catalog>>
endobj
10738 0 obj
<</Contents[10740 0 R 10741 0 R 10747 0 R 10748 0 R 10749 0 R 10750 0 R 10751 0 R 10752 0 R]/CropBox[0.0 0.0 516.0 728.64]/MediaBox[0.0 0.0 516.0 728.64]/Parent 10733 0 R/Resources<</ColorSpace<</CS0 10771 0 R/CS1 10772 0 R>>/ExtGState<</GS0 10773 0 R>>/Font<</C2_0 10778 0 R/C2_1 10783 0 R/C2_2 10788 0 R/C2_3 10793 0 R/C2_4 10798 0 R/TT0 10800 0 R/TT1 10802 0 R/TT2 10804 0 R/TT3 10806 0 R/TT4 10808 0 R>>/XObject<</Im0 10769 0 R>>>>/Rotate 0/StructParents 0/Tabs/S/Type/Page>>
endobj
10739 0 obj
<</Filter/FlateDecode/First 410/Length 3756/N 38/Type/ObjStm>>stream
10771 0 10772 21 10773 42 10774 138 10775 190 10776 442 10777 741 10778 752 10779 869 10780 921 10781 1190 10782 2050 10783 2061 10784 2192 10785 2244 10786 2504 10787 3456 10788 3467 10789 3587 10790 3639 10791 3903 10792 6058 10793 6069 10794 6196 10795 6248 10796 6507 10797 8153 10798 8164 10799 8284 10800 8496 10801 9662 10802 9894 10803 11072 10804 11325 10805 11779 10806 11985 10807 13147 10808 13395
[/ICCBased 10753 0 R][/ICCBased 10754 0 R]
<</AIS false/BM/Normal/CA 1.0/OP false/OPM 1/SA true/SMask/None/Type/ExtGState/ca 1.0/op false>>
<</Ordering(Identity)/Registry(Adobe)/Supplement 0>><</Ascent 858/CIDSet 10757 0 R/CapHeight 719/Descent -148/Flags 4/FontBBox[-16 -148 1008 858]/FontFamily(\xfe\xff\x00H\x00Y\xc9\x11\xac\xe0\xb5\x15)/FontFile2 10758 0 R/FontName/YDRADB+H2gtrM/FontStretch/Normal/FontWeight 400/ItalicAngle 0/StemV 60/Type/FontDescriptor/XHeight 520>>
...
endstream
endobj
...
No. - Type
10732 - Pages
206 - StructTreeRoot
10771, 10772, 10773, 10778 ... - Font
Many indirect objects including 10732, 206, 10771 and 10772 do not exist in the pdf file.
But I think I found objects 10771~10808 in object 10739 stream.
Q1. Why are there no object 10732(Pages) and 206(StructTreeRoot) in the pdf file?
Q2. Why are indirect objects in stream?
I would be grateful if you would suggest any explanations or resources for reference.
Starting with version 1.5 PDF supports so called object streams, i.e. stream objects which contain other non-stream objects.
Your object 10739 is such an object stream as you can see in its Type ObjStm.
This allows those other objects to be compressed. In particular structure tree objects which otherwise can substantially increase the size of a PDF, can be compressed fairly well, reducing their impact on the document size.
For details please study the PDF specification, section 7.5.7 – Object Streams, in either the current PDF specification ISO 32000-2 or its predecessor ISO 32000-1.
Adobe has shared a copy of ISO 32000-1 on their web site which merely has its ISO page headers replaced. Simply google for "PDF32000_2008"; currently it is located at https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf but as far as I know this isn't a permalink.

iOS app crashes while synthesising audio: buffer, frames <unavailable>

I’m synthesising audio on an iPhone using additive synthesis and my app, written in Objective C, crashes while playing audio. The synthesis engine worked in a previous version of the app and with an earlier iOS. I'm currently testing it for iOS 10.3.3 using Xcode 8.3.3.
EDIT - in the current version, the view controller sends MIDI note on messages to communicate with the synthesis engine. The previous version did not use MIDI commands.
The app synthesises two sounds: a bell and a chorus of sine tones. It does this smoothly and without transients. However it will crash if one sound is playing while attempting to play the other. Yet it never crashes if the same sound is repeated or if the user stops the chorus sound before playing the bell sound (or vice versa).
The bell tone has 11 partials of fixed frequency, each partial shaped by an amplitude envelope. The chorus tone has 5 partials each with a pitch shift envelope and an amplitude envelope. Envelope duration is calculated at runtime from when a user triggers a sound until the end of the last active state, as shown in the diagram (below).
The crash happens consistently under two conditions.
Firstly, a crash can be caused by playing a bell while a chorus sound is still playing, in which case Xcode goes into debug looking for Amplitude partial 6, a partial that would not be used if the buffer was still trying to access a chorus sound which only has 5 partials.
The diagram shows what should happen if two sound events played in the first state (between 0:00 and 0:24) are followed by a third sound played in the following state. The envelope duration of all three is calculated to end at 1:36. Normally, the bell sound (between 0:24 and 0:48) would last until 1:36, unless a player interrupts it by playing another sound as happens with the previous two sounds. However, being the first sound played in a new state, playing it sends the app into debug.
Alternately, a crash can also be caused by playing a chorus sound while a bell is still playing, in which Xcode goes into debug looking at Pitch shift partial 1, a partial that would never be used if the buffer was still trying to access a bell sound where pitch is fixed.
In both examples, it looks as if my code fails when it tries to access a buffer that was active prior to the change of state. But I can't find the reason. I tried changing the buffer size but that made little difference (it just happened to be set to 5 when I produced the logs below).
Below are two methods I use to service buffer input for bell and chorus synthesis, the typedef that defines buffer states and a debug log for a typical bell crash and chorus crash. I need some feedback on these before diving into the routine where audio is synthesised into the output buffer. I'm happy to share that too but hopefully the problem might already be obvious for someone else.
The app almost works but for the past few weeks I’ve broken the code and fixed it several times without getting closer to solving this problem.
My code is an extension of an extremely helpful AudioBufferPlayer and Synth example created by Mattias Hollejman and refined by Mario Diana.
UPDATE
I added a new method called showPark to produce a clearer log showing the state of the audio buffer as each live event arrives. When audio buffer size is 3, the log clearly shows the buffer filling after three events leaving no where to go for all subsequent events.
The problem is not evident in the first 24 seconds because the synthesis parameters remain the same. However after 24 seconds, when event 6 happens, things change and the synthesis engine cannot access parameters it needs to synthesise a bell sound. I think this explains how the crash happens. On that basis I'm trying to work out the best way to fix the problem and I welcome any suggestions from anyone who knows what to do.
Here is a crash log.
crash log (latest)
2017-08-01 13:48:59.330 SatGam2[1169:1226966] PlayView loaded (selectedFamily:1 selectedPlayerID:9)
2017-08-01 13:48:59.331 SatGam2[1169:1226966] ENABLED (player 9: state 0)
2017-08-01 13:49:01.071 SatGam2[1169:1226966]
2017-08-01 13:49:01.072 SatGam2[1169:1226966] EVENT 1
2017-08-01 13:49:01.072 SatGam2[1169:1226966]
2017-08-01 13:49:01.072 SatGam2[1169:1226966] MIDI Status: 0 MIDI Note: 0 State: ToneEventStateInactive
2017-08-01 13:49:01.073 SatGam2[1169:1226966] MIDI Status: 0 MIDI Note: 0 State: ToneEventStateInactive
2017-08-01 13:49:01.073 SatGam2[1169:1226966] MIDI Status: 0 MIDI Note: 0 State: ToneEventStateInactive
2017-08-01 13:49:01.073 SatGam2[1169:1226966] update parkPointer [1]
2017-08-01 13:49:01.073 SatGam2[1169:1226966]
2017-08-01 13:49:01.074 SatGam2[1169:1226966] Risset Chorus playing MIDI note number: 1 length: 95
2017-08-01 13:49:01.074 SatGam2[1169:1226966] [playChorus - buffer: 0 state: 0]
2017-08-01 13:49:03.873 SatGam2[1169:1226966] EVENT 2
2017-08-01 13:49:03.874 SatGam2[1169:1226966]
2017-08-01 13:49:03.874 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 1 State: ToneEventStatePressed
2017-08-01 13:49:03.874 SatGam2[1169:1226966] MIDI Status: 0 MIDI Note: 0 State: ToneEventStateInactive
2017-08-01 13:49:03.875 SatGam2[1169:1226966] MIDI Status: 0 MIDI Note: 0 State: ToneEventStateInactive
2017-08-01 13:49:03.875 SatGam2[1169:1226966] update parkPointer [2]
2017-08-01 13:49:03.875 SatGam2[1169:1226966]
2017-08-01 13:49:03.875 SatGam2[1169:1226966] Risset Chorus playing MIDI note number: 3 length: 92
2017-08-01 13:49:03.876 SatGam2[1169:1226966] [playChorus - buffer: 1 state: 0]
2017-08-01 13:49:06.180 SatGam2[1169:1226966] EVENT 3
2017-08-01 13:49:06.180 SatGam2[1169:1226966]
2017-08-01 13:49:06.180 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 1 State: ToneEventStatePressed
2017-08-01 13:49:06.180 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 3 State: ToneEventStatePressed
2017-08-01 13:49:06.181 SatGam2[1169:1226966] MIDI Status: 0 MIDI Note: 0 State: ToneEventStateInactive
2017-08-01 13:49:06.181 SatGam2[1169:1226966] update parkPointer [0]
2017-08-01 13:49:06.181 SatGam2[1169:1226966]
2017-08-01 13:49:06.181 SatGam2[1169:1226966] Risset Chorus playing MIDI note number: 5 length: 90
2017-08-01 13:49:06.182 SatGam2[1169:1226966] [playChorus - buffer: 2 state: 0]
2017-08-01 13:49:10.162 SatGam2[1169:1226966] EVENT 4
2017-08-01 13:49:10.162 SatGam2[1169:1226966]
2017-08-01 13:49:10.163 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 1 State: ToneEventStatePressed
2017-08-01 13:49:10.163 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 3 State: ToneEventStatePressed
2017-08-01 13:49:10.163 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 5 State: ToneEventStatePressed
2017-08-01 13:49:10.163 SatGam2[1169:1226966] update parkPointer [1]
2017-08-01 13:49:10.163 SatGam2[1169:1226966]
2017-08-01 13:49:10.164 SatGam2[1169:1226966] Risset Chorus playing MIDI note number: 7 length: 86
2017-08-01 13:49:11.352361+1000 SatGam2[1169:1228409] [aqme] 254: AQDefaultDevice (173): skipping input stream 0 0 0x0
2017-08-01 13:49:13.041 SatGam2[1169:1226966]
2017-08-01 13:49:13.042 SatGam2[1169:1226966] EVENT 5
2017-08-01 13:49:13.043 SatGam2[1169:1226966]
2017-08-01 13:49:13.043 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 1 State: ToneEventStatePressed
2017-08-01 13:49:13.043 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 3 State: ToneEventStatePressed
2017-08-01 13:49:13.043 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 5 State: ToneEventStatePressed
2017-08-01 13:49:13.044 SatGam2[1169:1226966] update parkPointer [2]
2017-08-01 13:49:13.044 SatGam2[1169:1226966]
2017-08-01 13:49:13.044 SatGam2[1169:1226966] Risset Chorus playing MIDI note number: 9 length: 83
2017-08-01 13:49:23.332 SatGam2[1169:1226966] ENABLED (player 9: state 1)
2017-08-01 13:49:25.228 SatGam2[1169:1226966] EVENT 6
2017-08-01 13:49:25.228 SatGam2[1169:1226966]
2017-08-01 13:49:25.229 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 1 State: ToneEventStatePressed
2017-08-01 13:49:25.229 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 3 State: ToneEventStatePressed
2017-08-01 13:49:25.229 SatGam2[1169:1226966] MIDI Status: 144 MIDI Note: 5 State: ToneEventStatePressed
2017-08-01 13:49:25.229 SatGam2[1169:1226966] update parkPointer [0]
2017-08-01 13:49:25.229 SatGam2[1169:1226966]
2017-08-01 13:49:25.230 SatGam2[1169:1226966] Risset Bell playing MIDI note number: 0 length: 71
SatGam2 was compiled with optimization - stepping may behave oddly; variables may not be available.
(lldb) bt
* thread #9, name = 'com.apple.coreaudio.AQClient', stop reason = EXC_BAD_ACCESS (code=1, address=0xb174)
* frame #0: 0x000a1ea5 SatGam2`-[Synth amplitudeLookupPartial6:](self=<unavailable>, _cmd="amplitudeLookupPartial6:", n=<unavailable>) at Synth.m:988 [opt]
frame #1: 0x000a1519 SatGam2`-[Synth fillBuffer:frames:](self=0x7a831a00, _cmd="fillBuffer:frames:", buffer=<unavailable>, frames=<unavailable>) at Synth.m:805 [opt]
frame #2: 0x000a516c SatGam2`__39-[PlayViewController startAudioSession]_block_invoke((null)=0x7ce7f8e0, buffer=<unavailable>, audioFormat=AudioStreamBasicDescription # 0xb0422ab8) at PlayViewController.m:397 [opt]
frame #3: 0x000a3aa8 SatGam2`PlayCallback(inUserData=0x7946f4c0, inAudioQueue=<unavailable>, inBuffer=<unavailable>) at AudioBufferPlayer.m:30 [opt]
(the rest of the log is the same as logs shown below)
Here is the code for the new method
- (void)showPark:(uint8_t)midiStatus data1:(uint8_t)mapped_MIDINoteNumber
{
// see if MIDI events are currently active and what kind of event
eventCount++;
NSLog(#"\n\n");
NSLog(#"EVENT %i", eventCount);
NSLog(#"\n");
for (int n = 0; n < MaxToneEvents; ++n)
{
// scan buffers
int a = _tones[n].state;
int b = _tones[n].midiStatus;
int c = _tones[n].midiNote;
NSLog(#" MIDI Status: %3d MIDI Note: %3d State: %#", b, c, [self getCurrent:(int)a]);
}
// update parkPointer
parkPointer = (parkPointer + 1) % MaxToneEvents;
NSLog(#" update parkPointer [%i]", parkPointer);
NSLog(#"\n");
}
-(NSString *)getCurrent:(int)state
{
switch(state){
case ToneEventStateInactive:
return #"ToneEventStateInactive";
case ToneEventStatePressed:
return #"ToneEventStatePressed";
case ToneEventStateReleased:
return #"ToneEventStateReleased";
default:
return #"null";
}
}
showPark is called from a method not shown previously so I'll include it here.
- (void)sendMIDIEvent:(uint8_t)midiStatus
data1:(uint8_t)mapped_MIDINoteNumber // dekany buttons mapped to MIDI Note Numbers 0-9
data2:(uint8_t)data2
{
// 1. check parking bay
[self showPark:(uint8_t)midiStatus data1:(uint8_t)mapped_MIDINoteNumber];
// 2. identify MIDI status
if (midiStatus == MIDI_Status_KeyOn_RissetChorus) // 144
{
// 3. pick up duration and send a message to playChorus
[self playChorus:(uint8_t)midiStatus
chorusPitch:(uint8_t)mapped_MIDINoteNumber
length:(int)noteLength];
}
else
{
if (midiStatus == MIDI_Status_KeyOn_RissetBell) // 145
{
// 4. pick up duration and send a message to playBell
[self playBell:(uint8_t)midiStatus
bellPitch:(uint8_t)mapped_MIDINoteNumber
length:(int)noteLength];
}
}
}
playBell
-(void)playBell:(uint8_t)midiStatus
bellPitch:(uint8_t)midiNoteNumber
length:(int)length;
{
hasPitchEnvelope = FALSE;
for (int n = 0; n < MaxToneEvents; ++n)
{
if (_tones[n].state == ToneEventStateInactive) // find an empty slot
{
_tones[n].state = ToneEventStatePressed;
_tones[n].frequency = _pitches[midiNoteNumber];
_tones[n].phase1 = 0.0f;
_tones[n].phase2 = 0.0f;
_tones[n].phase3 = 0.0f;
_tones[n].phase4 = 0.0f;
_tones[n].phase5 = 0.0f;
_tones[n].phase6 = 0.0f;
_tones[n].phase7 = 0.0f;
_tones[n].phase8 = 0.0f;
_tones[n].phase9 = 0.0f;
_tones[n].phase10 = 0.0f;
_tones[n].phase11 = 0.0f;
_tones[n].levelEnvelope1 = _levelPartialEnvelope1;
_tones[n].levelEnvelope2 = _levelPartialEnvelope2;
_tones[n].levelEnvelope3 = _levelPartialEnvelope3;
_tones[n].levelEnvelope4 = _levelPartialEnvelope4;
_tones[n].levelEnvelope5 = _levelPartialEnvelope5;
_tones[n].levelEnvelope6 = _levelPartialEnvelope6;
_tones[n].levelEnvelope7 = _levelPartialEnvelope7;
_tones[n].levelEnvelope8 = _levelPartialEnvelope8;
_tones[n].levelEnvelope9 = _levelPartialEnvelope9;
_tones[n].levelEnvelope10 = _levelPartialEnvelope10;
_tones[n].levelEnvelope11 = _levelPartialEnvelope11;
_tones[n].gain = 1.0f;
_tones[n].envStep = 0.0f;
_tones[n].envDelta = ENVELOPE_LENGTH / length; // GS Envelope
_tones[n].fadeOut = 1.0f;
return;
}
}
}
playChorus
- (void)playChorus:(uint8_t)midiStatus
chorusPitch:(uint8_t)midiNoteNumber
length:(int)length;
{
hasPitchEnvelope = TRUE;
for (int n = 0; n < MaxToneEvents; ++n)
{
if (_tones[n].state == ToneEventStateInactive) // find an empty slot
{
_tones[n].state = ToneEventStatePressed;
_tones[n].frequency = _pitches[midiNoteNumber];
_tones[n].phase1 = 0.0f;
_tones[n].phase2 = 0.0f;
_tones[n].phase3 = 0.0f;
_tones[n].phase4 = 0.0f;
_tones[n].phase5 = 0.0f;
_tones[n].phase6 = 0.0f;
_tones[n].phase7 = 0.0f;
_tones[n].phase8 = 0.0f;
_tones[n].phase9 = 0.0f;
_tones[n].phase10 = 0.0f;
_tones[n].phase11 = 0.0f;
_tones[n].levelEnvelope1 = _levelEnvelopeAboveOuter;
_tones[n].levelEnvelope2 = _levelEnvelopeAboveInner;
_tones[n].levelEnvelope3 = _levelEnvelopeCentreNote;
_tones[n].levelEnvelope4 = _levelEnvelopeBelowInner;
_tones[n].levelEnvelope5 = _levelEnvelopeBelowOuter;
_tones[n].pitchEnvelope1 = _pitchEnvelopeAboveOuter;
_tones[n].pitchEnvelope2 = _pitchEnvelopeAboveInner;
_tones[n].pitchEnvelope3 = _pitchEnvelopeCentreNote;
_tones[n].pitchEnvelope4 = _pitchEnvelopeBelowInner;
_tones[n].pitchEnvelope5 = _pitchEnvelopeBelowOuter;
_tones[n].gain = 1.0f;
_tones[n].envStep = 0.0f;
_tones[n].envDelta = ENVELOPE_LENGTH / length; // GS Envelope
_tones[n].fadeOut = 1.0f;
return;
}
}
}
ToneEvent
typedef enum
{
ToneEventStateInactive = 0, // ToneEvent is not used for playing a tone
ToneEventStatePressed, // ToneEvent is still playing normally
ToneEventStateReleased, // ToneEvent is released and ringing out
}
ToneEventState;
bell crash
2017-07-28 21:05:28.438 SatGam2[897:503237] ENABLED (player 4: state 1)
2017-07-28 21:05:28.502804+1000 SatGam2[897:504929] [aqme] 254: AQDefaultDevice (173): skipping input stream 0 0 0x0
2017-07-28 21:05:30.511372+1000 SatGam2[897:504929] [aqme] 254: AQDefaultDevice (173): skipping input stream 0 0 0x0
2017-07-28 21:05:30.852 SatGam2[897:503237] ToneEventStatePressed
2017-07-28 21:05:30.853 SatGam2[897:503237] ToneEventStateReleased
2017-07-28 21:05:30.853 SatGam2[897:503237] ToneEventStatePressed
2017-07-28 21:05:30.854 SatGam2[897:503237] ToneEventStatePressed
2017-07-28 21:05:30.854 SatGam2[897:503237] ToneEventStatePressed
2017-07-28 21:05:30.854 SatGam2[897:503237] noteLength 70
2017-07-28 21:05:30.855 SatGam2[897:503237] timeToGo 70 [RissetBells, from PlayViewController]
2017-07-28 21:05:30.855 SatGam2[897:503237] Risset Bell MIDI note number 1 : length 70
2017-07-28 21:05:30.855 SatGam2[897:503237] Clapper button 7 pressed
SatGam2 was compiled with optimization - stepping may behave oddly; variables may not be available.
(lldb) bt
* thread #10, name = 'com.apple.coreaudio.AQClient', stop reason = EXC_BAD_ACCESS (code=1, address=0x9514)
* frame #0: 0x00071d82 SatGam2`-[Synth amplitudeLookupPartial6:](self=<unavailable>, _cmd="amplitudeLookupPartial6:", n=<unavailable>) at Synth.m:875 [opt]
frame #1: 0x000713f6 SatGam2`-[Synth fillBuffer:frames:](self=0x7e805a00, _cmd="fillBuffer:frames:", buffer=<unavailable>, frames=<unavailable>) at Synth.m:692 [opt]
frame #2: 0x000751e9 SatGam2`__39-[PlayViewController startAudioSession]_block_invoke((null)=0x7ae48160, buffer=<unavailable>, audioFormat=AudioStreamBasicDescription # 0xb0491ab8) at PlayViewController.m:393 [opt]
frame #3: 0x00073985 SatGam2`PlayCallback(inUserData=0x7c44ac60, inAudioQueue=<unavailable>, inBuffer=<unavailable>) at AudioBufferPlayer.m:30 [opt]
frame #4: 0x00a65e90 AudioToolbox`ClientAudioQueue::CallOutputCallback(AudioQueueBuffer*) + 336
frame #5: 0x00a69a99 AudioToolbox`ClientMessageHandler::OutputBufferComplete(unsigned int) + 137
frame #6: 0x00a5fc90 AudioToolbox`AQClientCallbackMessageReader::DispatchCallbacks(void const*, unsigned long) + 176
frame #7: 0x00a5f98d AudioToolbox`ClientAudioQueue::FetchAndDeliverPendingCallbacks(unsigned int) + 301
frame #8: 0x00a5fb78 AudioToolbox`AQCallbackReceiver_CallbackNotificationsAvailable + 152
frame #9: 0x009b071a AudioToolbox`_XCallbackNotificationsAvailable + 42
frame #10: 0x00c3b37b AudioToolbox`mshMIGPerform + 207
frame #11: 0x035e28b3 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
frame #12: 0x035e2822 CoreFoundation`__CFRunLoopDoSource1 + 498
frame #13: 0x035daccd CoreFoundation`__CFRunLoopRun + 2669
frame #14: 0x035d9fd4 CoreFoundation`CFRunLoopRunSpecific + 372
frame #15: 0x035d9e4b CoreFoundation`CFRunLoopRunInMode + 123
frame #16: 0x00a6a822 AudioToolbox`GenericRunLoopThread::Entry(void*) + 178
frame #17: 0x00c406b2 AudioToolbox`CAPThread::Entry(CAPThread*) + 96
frame #18: 0x06215047 libsystem_pthread.dylib`_pthread_body + 184
frame #19: 0x06214f8f libsystem_pthread.dylib`_pthread_start + 243
frame #20: 0x0621484a libsystem_pthread.dylib`thread_start + 34
(lldb)
chorus crash
2017-07-28 20:30:13.061 SatGam2[864:436890] ENABLED (player 4: state 2)
2017-07-28 20:30:13.227994+1000 SatGam2[864:438359] [aqme] 254: AQDefaultDevice (173): skipping input stream 0 0 0x0
2017-07-28 20:30:14.878 SatGam2[864:436890] ToneEventStatePressed
2017-07-28 20:30:14.878 SatGam2[864:436890] ToneEventStateReleased
2017-07-28 20:30:14.879 SatGam2[864:436890] ToneEventStatePressed
2017-07-28 20:30:14.879 SatGam2[864:436890] ToneEventStatePressed
2017-07-28 20:30:14.879 SatGam2[864:436890] ToneEventStatePressed
2017-07-28 20:30:14.879 SatGam2[864:436890] noteLength 47
2017-07-28 20:30:14.880 SatGam2[864:436890] timeToGo 47 [RissetChorus, from PlayViewController]
2017-07-28 20:30:14.880 SatGam2[864:436890] Risset Chorus MIDI note number 3 : length 47
2017-07-28 20:30:14.880 SatGam2[864:436890] Note button 4 pressed
SatGam2 was compiled with optimization - stepping may behave oddly; variables may not be available.
(lldb) bt
* thread #10, name = 'com.apple.coreaudio.AQClient', stop reason = EXC_BAD_ACCESS (code=1, address=0xe62c)
* frame #0: 0x0007b728 SatGam2`-[Synth pitchShiftLookupPartial1:](self=0x7bb0d400, _cmd="pitchShiftLookupPartial1:", n=0) at Synth.m:762 [opt]
frame #1: 0x0007aeb6 SatGam2`-[Synth fillBuffer:frames:](self=0x7bb0d400, _cmd="fillBuffer:frames:", buffer=<unavailable>, frames=<unavailable>) at Synth.m:724 [opt]
frame #2: 0x0007f1e9 SatGam2`__39-[PlayViewController startAudioSession]_block_invoke((null)=0x7c74d5b0, buffer=<unavailable>, audioFormat=AudioStreamBasicDescription # 0xb01f9ab8) at PlayViewController.m:393 [opt]
frame #3: 0x0007d985 SatGam2`PlayCallback(inUserData=0x7b656430, inAudioQueue=<unavailable>, inBuffer=<unavailable>) at AudioBufferPlayer.m:30 [opt]
frame #4: 0x00a14e90 AudioToolbox`ClientAudioQueue::CallOutputCallback(AudioQueueBuffer*) + 336
frame #5: 0x00a18a99 AudioToolbox`ClientMessageHandler::OutputBufferComplete(unsigned int) + 137
frame #6: 0x00a0ec90 AudioToolbox`AQClientCallbackMessageReader::DispatchCallbacks(void const*, unsigned long) + 176
frame #7: 0x00a0e98d AudioToolbox`ClientAudioQueue::FetchAndDeliverPendingCallbacks(unsigned int) + 301
frame #8: 0x00a0eb78 AudioToolbox`AQCallbackReceiver_CallbackNotificationsAvailable + 152
frame #9: 0x0095f71a AudioToolbox`_XCallbackNotificationsAvailable + 42
frame #10: 0x00bea37b AudioToolbox`mshMIGPerform + 207
frame #11: 0x035988b3 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
frame #12: 0x03598822 CoreFoundation`__CFRunLoopDoSource1 + 498
frame #13: 0x03590ccd CoreFoundation`__CFRunLoopRun + 2669
frame #14: 0x0358ffd4 CoreFoundation`CFRunLoopRunSpecific + 372
frame #15: 0x0358fe4b CoreFoundation`CFRunLoopRunInMode + 123
frame #16: 0x00a19822 AudioToolbox`GenericRunLoopThread::Entry(void*) + 178
frame #17: 0x00bef6b2 AudioToolbox`CAPThread::Entry(CAPThread*) + 96
frame #18: 0x0621f047 libsystem_pthread.dylib`_pthread_body + 184
frame #19: 0x0621ef8f libsystem_pthread.dylib`_pthread_start + 243
frame #20: 0x0621e84a libsystem_pthread.dylib`thread_start + 34
(lldb)

Example of Recording from the Mic and processing the (PCM?) file

I need to record sounds from the iPhone mic and process the samples in my Swift app. I would really appreciate an example to follow.
These Recording settings
let recordSettings:[String : AnyObject] = [
AVFormatIDKey: NSNumber(unsignedInt:kAudioFormatLinearPCM),
//AVEncoderAudioQualityKey : AVAudioQuality.Max.rawValue,
// AVEncoderBitRateKey : 320000,
AVNumberOfChannelsKey: 1,
AVSampleRateKey : 8000.0,
AVLinearPCMBitDepthKey: 16,
AVLinearPCMIsBigEndianKey: "true",
AVLinearPCMIsFloatKey: "false"
]
produce the following bytes
99 97 102 102 0 1 0 0 100 101 115 99 0 0 0 0 0 0 0 32 64 191 64 0 0 0 0 0 108 112 99 109 0 0 0 2 0 0 0 2 0 0 0 1 0 0 0 1 0 0 0 16 102 114 101 101 0 0 0 0 0 0 15 176 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Which looks fishy maybe it's a double still?
I already created an example for something like that. It gets the data from the microphone, does a Fast-Fourier-Transform on it to find the frequencies and displays them in the view. It's done for OSX, but it should also work on iOS:
https://github.com/Kametrixom/Frequencies

Erlang application exit,, but vm is still running

My Erlang applicaation processed crashed and then exited, but found that the erlang VM is still running.
I could recieve pong when ping this "suspended node"
Types regs() and the results show below, there is not my app process.
(hub#192.168.1.140)4> regs().
** Registered procs on node 'hub#192.168.1.140' **
Name Pid Initial Call Reds Msgs
application_controlle <0.7.0> erlang:apply/2 30258442 1390
auth <0.20.0> auth:init/1 189 0
code_server <0.26.0> erlang:apply/2 1194028 0
erl_epmd <0.19.0> erl_epmd:init/1 138 0
erl_prim_loader <0.3.0> erlang:apply/2 2914236 0
error_logger <0.6.0> gen_event:init_it/6 49983527 0
file_server_2 <0.25.0> file_server:init/1 16185407 0
global_group <0.24.0> global_group:init/1 107 0
global_name_server <0.13.0> global:init/1 1385 0
gr_counter_sup <0.43.0> supervisor:gr_counter_sup 253 0
gr_lager_default_trac <0.70.0> gr_counter:init/1 121 0
gr_lager_default_trac <0.72.0> gr_manager:init/1 46 0
gr_lager_default_trac <0.69.0> gr_param:init/1 117 0
gr_lager_default_trac <0.71.0> gr_manager:init/1 46 0
gr_manager_sup <0.45.0> supervisor:gr_manager_sup 484 0
gr_param_sup <0.44.0> supervisor:gr_param_sup/1 253 0
gr_sup <0.42.0> supervisor:gr_sup/1 237 0
inet_db <0.16.0> inet_db:init/1 749 0
inet_gethost_native <0.176.0> inet_gethost_native:serve 4698517 0
inet_gethost_native_s <0.175.0> supervisor_bridge:inet_ge 41 0
init <0.0.0> otp_ring0:start/2 30799457 0
kernel_safe_sup <0.35.0> supervisor:kernel/1 278 0
kernel_sup <0.11.0> supervisor:kernel/1 47618 0
lager_crash_log <0.52.0> lager_crash_log:init/1 97712230 0
lager_event <0.50.0> gen_event:init_it/6 1813660437 0
lager_handler_watcher <0.51.0> supervisor:lager_handler_ 358 0
lager_sup <0.49.0> supervisor:lager_sup/1 327 0
net_kernel <0.21.0> net_kernel:init/1 110769667 0
net_sup <0.18.0> supervisor:erl_distributi 313 0
os_cmd_port_creator <0.582.0> erlang:apply/2 81 0
rex <0.12.0> rpc:init/1 15653480 0
standard_error <0.28.0> erlang:apply/2 9 0
standard_error_sup <0.27.0> supervisor_bridge:standar 41 0
timer_server <0.100.0> timer:init/1 59356077 0
user <0.31.0> group:server/3 23837008 0
user_drv <0.30.0> user_drv:server/2 12239455 0
** Registered ports on node 'hub#192.168.1.140' **
Name Id Command
ok
It rarely occurs, but anyone explains it?
System: CentOS 5.8
Erlang: R15B03

puppettop? How can I see what puppet is doing?

I'm getting started with Puppet. I added some lines to a manifest and when running Puppet now it's been at 100% cpu for a very longtime. Is there a good way to see what puppet is actually doing? puppettop?
top gives me this, which is quite useless:
top - 20:02:11 up 1 day, 2:30, 5 users, load average: 1.02, 1.12, 0.93
Tasks: 164 total, 2 running, 162 sleeping, 0 stopped, 0 zombie
Cpu(s): 12.5%us, 0.0%sy, 0.0%ni, 87.4%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 32809072k total, 10412396k used, 22396676k free, 243832k buffers
Swap: 16768892k total, 0k used, 16768892k free, 6978500k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
9761 root 20 0 646m 558m 3568 R 100 1.7 20:42.88 puppet
10509 guaka 20 0 17344 1352 972 R 0 0.0 0:00.28 top
1 root 20 0 24216 2192 1344 S 0 0.0 0:00.85 init
2 root 20 0 0 0 0 S 0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0 0.0 0:02.83 ksoftirqd/0
4 root 20 0 0 0 0 S 0 0.0 0:00.00 kworker/0:0
5 root 0 -20 0 0 0 S 0 0.0 0:00.00 kworker/0:0H

Resources