PDA

View Full Version : Patch [Clanlib 8.1] alsafailsegfault



gpmfuchs
10-06-2008, 09:20 AM
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)

Seth
10-06-2008, 09:49 AM
Applied :)

gpmfuchs
10-08-2008, 12:04 AM
this patch removes a bug introduced with svn revision 14

which hinders nonlooping animations from stoping to animate.

Seth
10-08-2008, 12:30 AM
Thanks, applied. Good catch, oops. :sweatdrop:

gpmfuchs
10-11-2008, 07:19 AM
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

rombust
10-11-2008, 06:31 PM
[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.

gpmfuchs
10-20-2008, 12:19 AM
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)

gpmfuchs
10-30-2008, 06:15 PM
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.

gpmfuchs
11-10-2008, 11:26 PM
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

rombust
11-13-2008, 02:13 PM
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!

gpmfuchs
11-14-2008, 04:06 AM
ups, your absolutly right.
missed that one.

gpmfuchs
12-02-2008, 02:21 AM
here is the "patch" for mouseshow. but itmight not be the right thing as it calles system_hide more than once