Results 1 to 12 of 12

Thread: Patch [Clanlib 8.1] alsafailsegfault

  1. #1
    Squire
    Join Date
    Jan 2007
    Posts
    28

    Default Patch [Clanlib 8.1] alsafailsegfault

    This patch corrects an segfault in Clanlib 8.1.
    If ALSA is deactivated on linux. Program with sound crashes.

    Reason is that CL_SoundOutput_alsa throws in the constructor, the destructor calls stop_mixer_thread() but start_mixer_thread() hasn't been called.
    stop_mixer_thread segfaults after cl_assert != NULL output in the thread.wait() call. Because there was never a thread initialized.
    Checking for the thread being initialized removes the segfault and restores intended behavior. (Maybe also corrects similar bugs in other CL_SoundOutputs)

    (patch is against HEAD)
    Attached Files Attached Files

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Applied
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Squire
    Join Date
    Jan 2007
    Posts
    28

    Default patch for non stoping animation

    this patch removes a bug introduced with svn revision 14

    which hinders nonlooping animations from stoping to animate.
    Attached Files Attached Files

  4. #4
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,377

    Default

    Thanks, applied. Good catch, oops.
    Seth A. Robinson
    Robinson Technologies

  5. #5
    Squire
    Join Date
    Jan 2007
    Posts
    28

    Default patch for very evil CL_SlotContainer

    another day another patch

    To make your program crash. Do simply
    CL_SlotContainer cnt;
    cnt = CL_SlotContainer();

    Very evil things happen because CL_SlotContainer doesn't initialize it's list. Therefore wild evil pointers. segfaults ...

    check the patch for coding style before adding it.

    I think we should do a code audit. And search for uninitialized variables before 1.0
    Attached Files Attached Files

  6. #6
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Quote Originally Posted by gpmfuchs View Post
    [snip]
    I think we should do a code audit. And search for uninitialized variables before 1.0
    This is also needed for clanlib 0.9, however I do not know of an automatic method of detecting uninitialized member variables of a class - Thinking about it, i don't think it's possible.

  7. #7
    Squire
    Join Date
    Jan 2007
    Posts
    28

    Default

    there's a gcc option called -Weffc++ which does the job, output to a file and some greps on it ;-) and you get a pretty list. (to bad my computer is broken and segfaults every now an then while compiling)

  8. #8
    Squire
    Join Date
    Jan 2007
    Posts
    28

    Default patch for systems with missing Xxf86vm

    When trying to setup ClanLib on my university account. I ran into some problems with a missing Xxf86vm. Clanlib does test for it in ./configure but it doesn't do anything with it's test results.
    This patch changes the code so that it'll work again, but I might not be able to test it (due to 200MB disc quotas, but maybe I can get an exeption).
    I also failed to find a way to remove the -lXxf86vm from the Makefile.am in Sources/Display and Sources/GL/GLX
    All in all it might not be a very useful patch. But it's nearly complete. So maybe with some help ClanLib can run on systems, which aren't especially prepared for it.
    Attached Files Attached Files

  9. #9
    Squire
    Join Date
    Jan 2007
    Posts
    28

    Default

    In the audit for delete instead of delete[] I found some very suspicious delete [] argv.

    This argv belongs to windows we have no idea how it was created and are thankfull to M$ to do internal checks and do not crash, because of our misbehavior. Anyway I think we shouldn't do this. Here's the patch:
    stupid stuff removed
    Last edited by gpmfuchs; 11-14-2008 at 04:07 AM.

  10. #10
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Quote Originally Posted by gpmfuchs View Post
    In the audit for delete instead of delete[] I found some very suspicious delete [] argv.

    This argv belongs to windows we have no idea how it was created and are thankfull to M$ to do internal checks and do not crash, because of our misbehavior. Anyway I think we shouldn't do this. Here's the patch:
    argv does not belong to windows, it is created via "new char*[num_words + 1];" in calc_commandline()

    So, delete [] argv is correct
    ... unless i am misunderstanding something!

  11. #11
    Squire
    Join Date
    Jan 2007
    Posts
    28

    Default

    ups, your absolutly right.
    missed that one.

  12. #12
    Squire
    Join Date
    Jan 2007
    Posts
    28

    Default

    here is the "patch" for mouseshow. but itmight not be the right thing as it calles system_hide more than once
    Attached Files Attached Files

Similar Threads

  1. Replies: 1
    Last Post: 10-27-2007, 11:19 PM
  2. FreeBSD joystick patch for clanlib 0.8
    By Trigve in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 10-14-2007, 04:19 PM
  3. Patch for ClanLib 0.9 svn 368 (Linux compatibility)
    By rombust in forum Official ClanLib SDK Forums
    Replies: 7
    Last Post: 05-16-2007, 08:02 AM
  4. Patch to ClanLib-0.9 svn rev 365
    By rombust in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-09-2007, 01:08 PM
  5. Patch to ClanLib-0.8 svn rev 364
    By rombust in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 05-06-2007, 01:14 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •