SDL 2.0 -> Error: Passed a NULL mutex

Hi.

When I’m compiling a simple example with SDL 2.0, after the command
SDL_CreateWindow, this occurring the following error: “Passed a NULL mutex”.
I’m using the static library project. Also I’m testing on OSX 10.8.3.
This inform missing something on the command line compilation?
If this is really a problem?

Below is the command line to generate the program.

Compiler:
clang++ -I “TestSDL/sdl/include” -Wall -c -x c++ -arch x86_64 -std=c++11
-stdlib=libc++ -MMD -MP -MF"src/main.d" -MT"src/main.d" -o “src/main.o”
“…/src/main.cpp”

Linker:
clang++ -L “TestSDL/sdl/lib” -arch x86_64 -stdlib=libc++ -Bstatic
-framework GLUT -framework ForceFeedBack -framework IOKit -framework
CoreAudio -framework CoreFoundation -framework Carbon -framework AudioUnit
-framework AudioToolbox -framework OpenGL -framework Cocoa -o “TestSDL”
./src/main.o -lSDL2

the same question in this stackoverflow

Thanks.–

[]s
Silvio Fragnani da Silva.
Music, motorcycle and algorithm.

“Preocupe-se mais com sua consci?ncia do que com sua reputa??o. Porque sua
consci?ncia ? o que voc? ?, e sua reputa??o ? o que os outros pensam de
voc?. E o que os outros pensam, ? problema deles…”
(Albert Einstein)

“Temo o dia em que a tecnologia se sobreponha ? nossa humanidade. O mundo
s? ter? uma gera??o de idiotas”
(Albert Einstein)

“N?o h? nada que seja maior evid?ncia de insanidade do que fazer a mesma
coisa dia ap?s dia e esperar resultados diferentes.”
(Albert Einstein)

“Coletar dados ? s? o primeiro passo em dire??o ? sabedoria. Mas
compartilhar dados ? o primeiro passo em dire??o a comunidade.”
(desconhecido)

Hi.

Don’t query for errors if there are no errors. Check the return values and
only ask for the error description if the calles function returned -1.
Am 19.04.2013 17:22 schrieb “Silvio Fragnani” :

Hi.

When I’m compiling a simple example with SDL 2.0, after the command
SDL_CreateWindow, this occurring the following error: “Passed a NULL mutex”.
I’m using the static library project. Also I’m testing on OSX 10.8.3.
This inform missing something on the command line compilation?
If this is really a problem?

Below is the command line to generate the program.

Compiler:
clang++ -I “TestSDL/sdl/include” -Wall -c -x c++ -arch x86_64 -std=c++11
-stdlib=libc++ -MMD -MP -MF"src/main.d" -MT"src/main.d" -o “src/main.o”
"…/src/main.cpp"

Linker:
clang++ -L “TestSDL/sdl/lib” -arch x86_64 -stdlib=libc++ -Bstatic
-framework GLUT -framework ForceFeedBack -framework IOKit -framework
CoreAudio -framework CoreFoundation -framework Carbon -framework AudioUnit
-framework AudioToolbox -framework OpenGL -framework Cocoa -o “TestSDL”
./src/main.o -lSDL2

the same question in this stackoverflow
http://stackoverflow.com/questions/16005970/sdl-2-0-passed-a-null-mutex

Thanks.

[]s
Silvio Fragnani da Silva.
Music, motorcycle and algorithm.

“Preocupe-se mais com sua consci?ncia do que com sua reputa??o. Porque sua
consci?ncia ? o que voc? ?, e sua reputa??o ? o que os outros pensam de
voc?. E o que os outros pensam, ? problema deles…”
(Albert Einstein)

“Temo o dia em que a tecnologia se sobreponha ? nossa humanidade. O mundo
s? ter? uma gera??o de idiotas”
(Albert Einstein)

“N?o h? nada que seja maior evid?ncia de insanidade do que fazer a mesma
coisa dia ap?s dia e esperar resultados diferentes.”
(Albert Einstein)

“Coletar dados ? s? o primeiro passo em dire??o ? sabedoria. Mas
compartilhar dados ? o primeiro passo em dire??o a comunidade.”
(desconhecido)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

When I’m compiling a simple example with SDL 2.0, after the command
SDL_CreateWindow, this occurring the following error: “Passed a NULL mutex”.
I’m using the static library project. Also I’m testing on OSX 10.8.3.
This inform missing something on the command line compilation?
If this is really a problem?

No, you need to check the return value from SDL_CreateWindow().
SDL_GetError() is meaningless unless SDL_CreateWindow() reports failure.

It works like errno, and not like glGetError().

That being said, you aren’t the first to report this, and it turns out
in this case that “Passed a NULL mutex” actually was a legitimate SDL2
bug. This is now fixed in hg changeset f8e3dcefed59. But you should
still fix your program, too.

–ryan.

Here you go. The attached patch should fix the problem.

Jonny DOn Fri, Apr 19, 2013 at 11:26 AM, M. Gerhardy <martin.gerhardy at gmail.com>wrote:

Hi.

Don’t query for errors if there are no errors. Check the return values and
only ask for the error description if the calles function returned -1.
Am 19.04.2013 17:22 schrieb “Silvio Fragnani” <
silviofragnanisilva at gmail.com>:

Hi.

When I’m compiling a simple example with SDL 2.0, after the command
SDL_CreateWindow, this occurring the following error: “Passed a NULL mutex”.
I’m using the static library project. Also I’m testing on OSX 10.8.3.
This inform missing something on the command line compilation?
If this is really a problem?

Below is the command line to generate the program.

Compiler:
clang++ -I “TestSDL/sdl/include” -Wall -c -x c++ -arch x86_64 -std=c++11
-stdlib=libc++ -MMD -MP -MF"src/main.d" -MT"src/main.d" -o “src/main.o”
"…/src/main.cpp"

Linker:
clang++ -L “TestSDL/sdl/lib” -arch x86_64 -stdlib=libc++ -Bstatic
-framework GLUT -framework ForceFeedBack -framework IOKit -framework
CoreAudio -framework CoreFoundation -framework Carbon -framework AudioUnit
-framework AudioToolbox -framework OpenGL -framework Cocoa -o “TestSDL”
./src/main.o -lSDL2

the same question in this stackoverflow
http://stackoverflow.com/questions/16005970/sdl-2-0-passed-a-null-mutex

Thanks.

[]s
Silvio Fragnani da Silva.
Music, motorcycle and algorithm.

“Preocupe-se mais com sua consci?ncia do que com sua reputa??o. Porque
sua consci?ncia ? o que voc? ?, e sua reputa??o ? o que os outros pensam de
voc?. E o que os outros pensam, ? problema deles…”
(Albert Einstein)

“Temo o dia em que a tecnologia se sobreponha ? nossa humanidade. O mundo
s? ter? uma gera??o de idiotas”
(Albert Einstein)

“N?o h? nada que seja maior evid?ncia de insanidade do que fazer a mesma
coisa dia ap?s dia e esperar resultados diferentes.”
(Albert Einstein)

“Coletar dados ? s? o primeiro passo em dire??o ? sabedoria. Mas
compartilhar dados ? o primeiro passo em dire??o a comunidade.”
(desconhecido)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl_createwindow_error.diff
Type: application/octet-stream
Size: 490 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130419/9142a419/attachment.obj

Here you go. The attached patch should fix the problem.

Be nice.

This has been reported multiple times recently. Clearly we have a
documentation problem at a minimum.

–ryan.

I agree. I’ll put something in the wiki now.

Jonny DOn Fri, Apr 19, 2013 at 12:16 PM, Ryan C. Gordon wrote:

Here you go. The attached patch should fix the problem.

Be nice.

This has been reported multiple times recently. Clearly we have a
documentation problem at a minimum.

–ryan.

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thank you all.

I had taken an example where he checked errors for all calls SDL, making it
arrived this question.
As I am starting the study SDL, thought this might be a problem. Until I
did research to try to find any report about this problem but have not
found anything.

I did the update and hg already seen fit that Ryan Gordon did.

Jonathan Dearborn kakakak.

Again thank you.

obs: sorry for my english, is google translate.

2013/4/19 Jonathan Dearborn > I agree. I’ll put something in the wiki now.

Jonny D

On Fri, Apr 19, 2013 at 12:16 PM, Ryan C. Gordon wrote:

Here you go. The attached patch should fix the problem.

Be nice.

This has been reported multiple times recently. Clearly we have a
documentation problem at a minimum.

–ryan.

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

[]s
Silvio Fragnani da Silva.
Music, motorcycle and algorithm.

“Preocupe-se mais com sua consci?ncia do que com sua reputa??o. Porque sua
consci?ncia ? o que voc? ?, e sua reputa??o ? o que os outros pensam de
voc?. E o que os outros pensam, ? problema deles…”
(Albert Einstein)

“Temo o dia em que a tecnologia se sobreponha ? nossa humanidade. O mundo
s? ter? uma gera??o de idiotas”
(Albert Einstein)

“N?o h? nada que seja maior evid?ncia de insanidade do que fazer a mesma
coisa dia ap?s dia e esperar resultados diferentes.”
(Albert Einstein)

“Coletar dados ? s? o primeiro passo em dire??o ? sabedoria. Mas
compartilhar dados ? o primeiro passo em dire??o a comunidade.”
(desconhecido)