0.10 and FreeBSD7

2007-11-20
2013-05-30
  • Wesley Morgan
    Wesley Morgan
    2007-11-20

    I've just upgraded my media server box to FreeBSD 7.0-beta, for various reasons... However, I'm finding that Mediatomb does NOT work properly at all. With libthr, the default threading library, it uses up tons of CPU and I get tons of disconnects on my DSM-520. Even disabling all the autoscans, the CPU usage sits at about 120-130%. When I try to stop the process, the memory usage balloons out of control and if it isn't kill -9'd quickly it will exhaust all of your swap space (and get killed).

    If I use libkse, the alternative threading library, the worker threads keep crashing, but the parent thread doesn't. The server itself does nothing.

    What debugger or debugging method is recommended for tracking the problem(s) down?

     
    • Jin
      Jin
      2007-11-20

      Well, since I do not know much about BSD I will wait for Leo to comment on that; however I believe that MediaTomb has never been tested with the above libraries, so far we only used libpthread. Actually you could do a test and see if everything works as expected if you switch to libpthread.

      As for debugging... we use gdb/ddd, sometimes simple printf output is also helpful when debugging threading related problems. I'd rather write a small test program that works fine with libpthread on Linux and uses threads and mutexes, and I would then see what it does when linked with one of the libs you mentioned.

      Kind regards,
      Jin

       
      • Wesley Morgan
        Wesley Morgan
        2007-11-20

        Well, on 6.x, the default threading library is libpthread. When this was changed for 7.0, libpthread was renamed to libkse. So, using the same threading library as 6.x results in the thread crashes mentioned before.

        My experiences with 6.x were that libthr did not work with mediatomb at all, I believe that sqlite needed to be built without thread support (it was one or the other that it refused to work properly with). I think that moving from i386 to amd64 a few months back seemed to be what tickled the sqlite problem.

        To sum it up... I think there might be a few issues with amd64 and libthr on FreeBSD 7. I've got plenty of time over the next couple days to test a couple things, so I might try getting it running on a 32-bit system to see if that helps.

         
      • Wesley Morgan
        Wesley Morgan
        2007-11-20

        OK, as a followup, I built MT on a 32-bit system, and have the binary running perfectly on both an i386 and amd64 system. There must be some kind of problem with moving to the different default data types, on FreeBSD at least.

         
    • Jin
      Jin
      2007-11-20

      I did a 64bit related fix to libupnp (tombupnp), so you could try the latest svn (the fix was not yet in 0.10.0), however, the fix was not related to threading...

       
      • Wesley Morgan
        Wesley Morgan
        2007-11-21

        hmm... The latest svn runs without a hitch. Excellent!

         
    • Jin
      Jin
      2007-11-21

      Hmm, interesting. I really could not imagine that those changes had any influence on the threads, were just some tweaks in libupnp part of the code; anyway, I'm glad to hear that it works now.