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 loading PlaylistContainer #26

Open
LinusU opened this issue Sep 22, 2013 · 2 comments
Open

Segmentation fault when loading PlaylistContainer #26

LinusU opened this issue Sep 22, 2013 · 2 comments

Comments

@LinusU
Copy link
Contributor

LinusU commented Sep 22, 2013

If you try to use getPlaylistcontainer() on a session before receiving the login callback you'll trigger a segmentation fault. This is of course low prio but I still think that we never should segfault. I'll try to submit a pull request as well.

console.log('This gets printed');
pc = this.session.getPlaylistcontainer();
console.log('This will not...');
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000028
0x000000010222ffd5 in sp_image_add_load_callback ()
(gdb) bt
#0  0x000000010222ffd5 in sp_image_add_load_callback ()
#1  0x00000001022300c3 in sp_playlistcontainer_add_callbacks ()
#2  0x00000001009de52d in Session_PlaylistContainer (args=<value temporarily unavailable, due to optimizations>) at ../src/session.cc:482
#3  0x000000010016665c in v8::internal::Builtin_HandleApiCall ()
#4  0x00003e4f82e0618e in ?? ()
#5  0x00003e4f8307cf33 in ?? ()
#6  0x00003e4f8306a397 in ?? ()
#7  0x00003e4f82e636f7 in ?? ()
#8  0x00003e4f82e2851e in ?? ()
#9  0x00003e4f82e62fb0 in ?? ()
#10 0x00003e4f82e5de25 in ?? ()
#11 0x00003e4f82e59f16 in ?? ()
#12 0x00003e4f82e492e7 in ?? ()
#13 0x00003e4f82e48cab in ?? ()
#14 0x00003e4f82e2d119 in ?? ()
#15 0x00003e4f82e2c6a5 in ?? ()
#16 0x00003e4f82e245e7 in ?? ()
#17 0x00003e4f82e118b7 in ?? ()
#18 0x000000010018abd7 in v8::internal::Invoke ()
#19 0x0000000100147104 in v8::Function::Call ()
#20 0x000000010000b2f5 in node::Load ()
#21 0x000000010000bdf4 in node::Start ()
#22 0x0000000100003034 in start ()
(gdb) 
@Floby
Copy link
Owner

Floby commented Sep 23, 2013

Agreed on the "never segfault" policy. However, that's kind of hard with how badly spotify sessions are implemented.

This does surprise me, maybe it's because of a missing error check in how playlist containers bindings are implemented.

@LinusU
Copy link
Contributor Author

LinusU commented Sep 23, 2013

The funny thing is how long it took me to figure out what was happening. Here in Sweden it was the middle of the night when I reported it and I was probably very tired but I sincerely thought that the library always segfaulted when getting the rootlist and that it just wasn't implemented yet. So instead of looking at my own 5 lines of code, test.js, I started digging thru the C bindings tearing my hair out. :)

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

2 participants