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

Segmentation fault when delivering music #41

Open
LinusU opened this issue Oct 21, 2013 · 11 comments
Open

Segmentation fault when delivering music #41

LinusU opened this issue Oct 21, 2013 · 11 comments

Comments

@LinusU
Copy link
Contributor

LinusU commented Oct 21, 2013

[../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x000008c4719245b9 in ?? ()
(gdb) bt
#0  0x000008c4719245b9 in ?? ()
#1  0x000008c4719118b7 in ?? ()
#2  0x000000010018a28c in v8::internal::Invoke ()
#3  0x0000000100146364 in v8::Function::Call ()
#4  0x00000001021055b4 in read_delivered_music (handle=<value temporarily unavailable, due to optimizations>, status=<value temporarily unavailable, due to optimizations>) at ../src/player.cc:132
#5  0x000000010012f60c in uv__run_timers ()
#6  0x0000000100125f7e in uv_run ()
#7  0x000000010000c6e3 in node::Start ()
#8  0x00000001000039f4 in start ()
(gdb) 
@LinusU
Copy link
Contributor Author

LinusU commented Oct 22, 2013

Got one more, it seems that there is always at least one buffer underflow before this happens. Last time there was one, this time four.

[../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)
[../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)
[../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)
[../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x0000360b14f245b9 in ?? ()
(gdb) bt   
#0  0x0000360b14f245b9 in ?? ()
#1  0x0000360b14f118b7 in ?? ()
#2  0x000000010018a28c in v8::internal::Invoke ()
#3  0x0000000100146364 in v8::Function::Call ()
#4  0x00000001021055b4 in read_delivered_music (handle=<value temporarily unavailable, due to optimizations>, status=<value temporarily unavailable, due to optimizations>) at ../src/player.cc:132
#5  0x000000010012f60c in uv__run_timers ()
#6  0x0000000100125f7e in uv_run ()
#7  0x000000010000c6e3 in node::Start ()
#8  0x00000001000039f4 in start ()
(gdb) 

@Floby
Copy link
Owner

Floby commented Oct 22, 2013

Are you sure this isn't a node core audio error?
Le 22 oct. 2013 02:11, "Linus Unnebäck" notifications@github.com a écrit :

Got one more, it seems that there is always at least one buffer underflow
before this happens. Last time there was one, this time four.

[../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)
[../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)
[../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)
[../deps/mpg123/src/output/coreaudio.c:81] warning: Didn't have any audio data in callback (buffer underflow)

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x0000360b14f245b9 in ?? ()
(gdb) bt
#0 0x0000360b14f245b9 in ?? ()
#1 0x0000360b14f118b7 in ?? ()
#2 0x000000010018a28c in v8::internal::Invoke ()
#3 0x0000000100146364 in v8::Function::Call ()
#4 0x00000001021055b4 in read_delivered_music (handle=<value temporarily unavailable, due to optimizations>, status=<value temporarily unavailable, due to optimizations>) at ../src/player.cc:132
#5 0x000000010012f60c in uv__run_timers ()
#6 0x0000000100125f7e in uv_run ()
#7 0x000000010000c6e3 in node::Start ()
#8 0x00000001000039f4 in start ()
(gdb)


Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-26767967
.

@LinusU
Copy link
Contributor Author

LinusU commented Oct 22, 2013

coreaudio.c is from node-speaker, however, I don't think that the problem lies there. This is just what I think and I might be totally wrong:

#3 0x0000000100146364 in v8::Function::Call () Is player.cc line 132, where it calls into this._session._sp_session.music_delivery which I think is #1 which just forwards the call to Node.js Readable stream which actually uses the buffer (#0). When the buffer is read it tries to read it from address 0 (NULL) which of course results in EXC_BAD_ACCESS.

So I think that somehow we create the buffer with a NULL pointer...

@Floby
Copy link
Owner

Floby commented Oct 22, 2013

That's unfortunate... ^^

On 22 October 2013 15:38, Linus Unnebäck notifications@github.com wrote:

coreaudio.c is from node-speaker, however, I don't think that the problem
lies there. This is just what I think and I might be totally wrong:

#3 0x0000000100146364 in v8::Function::Call () Is player.cc line 132,
where it calls into this._session._sp_session.music_delivery which I
think is #1 which just forwards the call to Node.js Readable stream which
actually uses the buffer (#0). When the buffer is read it tries to read
it from address 0 (NULL) which of course results in EXC_BAD_ACCESS.

So I think that somehow we create the buffer with a NULL pointer...


Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-26803169
.

@Floby
Copy link
Owner

Floby commented Oct 22, 2013

As I've said, I should be able to get more time to work on this next week.

On 22 October 2013 17:41, Florent JABY florent.jaby@gmail.com wrote:

That's unfortunate... ^^

On 22 October 2013 15:38, Linus Unnebäck notifications@github.com wrote:

coreaudio.c is from node-speaker, however, I don't think that the
problem lies there. This is just what I think and I might be totally wrong:

#3 0x0000000100146364 in v8::Function::Call () Is player.cc line 132,
where it calls into this._session._sp_session.music_delivery which I
think is #1 which just forwards the call to Node.js Readable stream
which actually uses the buffer (#0). When the buffer is read it tries to
read it from address 0 (NULL) which of course results in EXC_BAD_ACCESS.

So I think that somehow we create the buffer with a NULL pointer...


Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-26803169
.

@LinusU
Copy link
Contributor Author

LinusU commented Oct 23, 2013

Yeah, no worries. I'll look at aswell if I get the time.

@IainCole
Copy link
Contributor

I have made a change in this commit that should hopefully address this issue, I'm still testing it for a while but it seems to do the trick so far. I'll create a PR once I'm happy that it has actually fixed it. IainCole@85a2cdd

@IainCole
Copy link
Contributor

IainCole commented Jan 2, 2015

Looks like this didn't work :(

@IainCole
Copy link
Contributor

IainCole commented Jan 5, 2015

This one IainCole@ec2fbc5 might work better though

@tim-gp
Copy link

tim-gp commented Jan 14, 2015

Did it Iain?

@IainCole
Copy link
Contributor

I still get a segfault in my particular app but I don't get this error any more and it's much more stable, so I think it worked for fixing this issue. I haven't been able to get to the root cause of my other issue though so there might still be something wrong.

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

No branches or pull requests

4 participants