Author Topic: problems when opening multiple https streams  (Read 522 times)

drugoimir

  • Posts: 39
Hello Ian,

i'm using the latest bass-arm release,
i've two players called by two distinct pthreads and things
get messed up when both are playing https streams.
Also the debugger (gdb) get stuck and i've to kill all
processes by hand.

Launching with no debugger, got:
double free or corruption (!prev)
double free or corruption (out)
Segmentation Fault

I solved the problem putting a mutex around the routine (i made a wrapper
around Bass) which then called Bass_StreamCreateUrl.
So, i guess that the problem arise when Bass_StreamCreateUrl is called
for two https streams starting at the very same time.
For one https and one http, or two http, there are no problems at all.

I'm asking this because, putting a mutex around bass_streamcreate,
i loose the benefit of having two threads for connection: if one gets stuck
while waiting Bass_StreamCreate, the other will also stop, waiting for
the mutex to be unlocked.

Since the problem appears only with two https, could it be related
to calls to  libssl when starting the streams?

Thanks.
Best Regards.

 

Ian @ un4seen

  • Administrator
  • Posts: 23937
Re: problems when opening multiple https streams
« Reply #1 on: 14 Sep '20 - 17:06 »
Yes, that does sound like it could be an OpenSSL-related issue, and indeed the OpenSSL library initialization is currently not synchronized properly. Here's an update for you to try:

   www.un4seen.com/stuff/bass-linux-arm.zip

Let me know if you still have the problem with that.

drugoimir

  • Posts: 39
Re: problems when opening multiple https streams
« Reply #2 on: 14 Sep '20 - 18:46 »
Wonderful ! Problem solved!

Great Ian!

Thanks a lot.
drugo.

Ian @ un4seen

  • Administrator
  • Posts: 23937
Re: problems when opening multiple https streams
« Reply #3 on: 15 Sep '20 - 15:17 »
Great! The fix will be present in the next BASS release. In the meantime, you can continue to use the update above (it's a "release" build).

The issue could also affect the standard Linux version, so here's an update of that too:

   www.un4seen.com/stuff/bass-linux.zip

drugoimir

  • Posts: 39
Re: problems when opening multiple https streams
« Reply #4 on: 15 Sep '20 - 20:44 »
Many thanks.
Your commitment is really exemplary, and that's why i love bass.