[OBSOLETE Tutorial][Advanced]2.PokittoSim - programming using a Simulator

I will post the execution of same on my Mac Machine soon with Wine !!!
I think if it works with Fedora it might be with Mac also because Mac OS also supports Wine !!!

1 Like

Thanks for those links. I have xcode but not the command line stuff.
I’ll let you know how I go.

1 Like

I will get my hands on a mac soon and try it out myself also.

Whoo hoo! Progress.
I downloaded and installed the Command line utilities.
I then added gdb to the debugger preference.
It still didn’t want to work, so I downloaded the pokkito example from github. Previously I had a pokkito zip file.
It is still erroring, but I am closer than before.

So I have had a chance to play a bit more.
I get the following error when I try to run any of the examples.

ld: unknown option: -Map=main.map
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The main.map file exists within the pokkito github files.
Build target is Helloworld.win.
This type of coding is very new to me, so any suggestions are greatly appreciated.
Ray

I’ve found a little glitch with the Chipengine_win build target. It seems like you accidentally put GuiTools.cpp into the build target, so it gives an error about there being two main() functions. It’s a fairly easy fix, but it might be a good idea to fix it so others don’t get confused :slight_smile:

Thanks for reporting. Please put a note to bugs and features category also so it is not lost.

hmmm, having suffered a hdd failure I had to reinstall everything, but now I can’t get the setup to work.

||=== Build: Pokittris in PokittoSimHello (compiler: GNU GCC Compiler) ===|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
C:\Users\Spinal\Documents\Pokitto\POKITTO_CORE\PokittoCore.cpp|187|warning: unused variable 'counter' [-Wunused-variable]|
C:\Users\Spinal\Documents\Pokitto\POKITTO_CORE\PokittoCore.cpp|459|warning: variable 'fc' set but not used [-Wunused-but-set-variable]|
C:\Users\Spinal\Documents\Pokitto\POKITTO_CORE\PokittoCore.cpp|459|warning: variable 'bc' set but not used [-Wunused-but-set-variable]|
C:\Users\Spinal\Documents\Pokitto\POKITTO_CORE\PokittoCore.cpp|491|warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]|
C:\Users\Spinal\Documents\Pokitto\POKITTO_CORE\PokittoCore.cpp|488|warning: control reaches end of non-void function [-Wreturn-type]|
C:\Users\Spinal\Documents\Pokitto\POKITTO_CORE\PokittoCore.cpp|559|warning: control reaches end of non-void function [-Wreturn-type]|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
C:\Users\Spinal\Documents\Pokitto\EXAMPLES\tetris.cpp||In function 'void checkLine()':|
C:\Users\Spinal\Documents\Pokitto\EXAMPLES\tetris.cpp|198|warning: unused variable 'y1' [-Wunused-variable]|
C:\Users\Spinal\Documents\Pokitto\EXAMPLES\tetris.cpp||In function 'int SDL_main()':|
C:\Users\Spinal\Documents\Pokitto\EXAMPLES\tetris.cpp|312|warning: unused variable 'oldMode' [-Wunused-variable]|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
C:\Users\Spinal\Documents\Pokitto\POKITTO_CORE\PokittoDisplay.cpp|395|warning: operation on 'index2' may be undefined [-Wsequence-point]|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
C:\Users\Spinal\Documents\Pokitto\POKITTO_CORE\PokittoSound.cpp|212|warning: comparison between signed and unsigned integer expressions [-Wsign-compare]|
C:\Users\Spinal\Documents\Pokitto\POKITTO_CORE\PokittoSound.cpp|819|warning: no return statement in function returning non-void [-Wreturn-type]|
C:\Users\Spinal\Documents\Pokitto\POKITTO_LIBS\FileIO\FileIO_SIM.cpp||In function 'char* getNextFile()':|
C:\Users\Spinal\Documents\Pokitto\POKITTO_LIBS\FileIO\FileIO_SIM.cpp|138|warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]|
C:\Users\Spinal\Documents\Pokitto\POKITTO_LIBS\FileIO\FileIO_SIM.cpp||In function 'char* getFirstFile()':|
C:\Users\Spinal\Documents\Pokitto\POKITTO_LIBS\FileIO\FileIO_SIM.cpp|163|warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]|
C:\Users\Spinal\Documents\Pokitto\POKITTO_LIBS\FileIO\FileIO_SIM.cpp||In function 'char* getNextFile(char*)':|
C:\Users\Spinal\Documents\Pokitto\POKITTO_LIBS\FileIO\FileIO_SIM.cpp|134|warning: control reaches end of non-void function [-Wreturn-type]|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
..\Pokitto_settings.h|169|warning: "POK_COLORDEPTH" redefined|
..\Pokitto_settings.h|128|note: this is the location of the previous definition|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|243|error: macro "min" passed 3 arguments, but takes just 2|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|265|error: macro "max" passed 3 arguments, but takes just 2|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|195|error: expected unqualified-id before 'const'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|195|error: expected ')' before 'const'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|195|error: expected ')' before 'const'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|195|error: expected initializer before 'const'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|219|error: expected unqualified-id before 'const'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|219|error: expected ')' before 'const'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|219|error: expected ')' before 'const'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|219|error: expected initializer before 'const'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|243|error: 'std::min' declared as an 'inline' variable|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|246|error: expected primary-expression before 'if'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|246|error: expected '}' before 'if'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|246|error: expected ';' before 'if'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|248|error: expected unqualified-id before 'return'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|265|error: 'max' declared as an 'inline' variable|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|268|error: expected primary-expression before 'if'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|268|error: expected '}' before 'if'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|268|error: expected ';' before 'if'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|270|error: expected unqualified-id before 'return'|
c:\mingw\lib\gcc\mingw32\6.3.0\include\c++\bits\stl_algobase.h|271|error: expected declaration before '}' token|
||=== Build failed: 21 error(s), 57 warning(s) (0 minute(s), 15 second(s)) ===|

Can anyone help? Have I missed an installation step? has a bug crept in since I last installed? What have I done wrong?

The errors seem to be coming from mingw32 itself.

I don’t know if it’s a fault in mingw or a conflict with min and max being defined in different places.

It could be that it’s trying to use some function forms of min and max that are designed to take a variable number of arguments and some macros are interfering.
I’m guessing from the file name that it’s supposed to be part of an implementation of the C++ stdlib (part of which was formerly referred to as the ‘standard template library’ (stl)), which would make sense since C++ does have a 3-argument variation of std::min and std::max.
C++ isn’t supposed to have min and max macros in the standard library so that implies to me that it’s possibly an overspill issue in which a file defining min and max macros is being included before one defining min and max functions.
Whitout actually being able to read the file, I’d guess that that’s the crux of the issue and all the other errors are a knock-on effect.

Ultimately though that’s all just a big guess and without seeing the file or knowing what else is being included and where I can only make guesses.

Looking at the Pokitto source code, the warnings coming from that would be expected to happen because there’s nothing to guard against them.

Caused by change in stdlib. min max used to be macros, now are functions. Lots of problems, not only for Pokitto.

put DISABLEAVRMIN in your #defines in the project build options to disable AVR versions of min and max

1 Like

OK, now I get

BmpImage.cpp|397|error: ‘max’ was not declared in this scope
BmpImage.cpp|398|error: ‘min’ was not declared in this scope

There is a fix for that

1 Like

Cool. Thanks…

1 Like


Get that error…

Reading the red text it’s looking for mingw compiler Wich is windows specific compiler (it’s also has a .exe externsion)
You could try going to the menubar settings as it says and change compiler to the buildin gnu gcc or llvm usually called clang
Sorry I have not tried this myself on Mac is at all so the rest of the sim might still be broken somewhere

1 Like

I got that error on my windows machine.

Edit: Got it working now. I needed to restore default settings at compiler settings. Weird since I didn’t changed them and just followed the instructions… But anyway, it works now ^^

1 Like

It works now, but which keys do I need to press on the simulator?

See first post

2 Likes

Getting some segfaults on Linux. The simulator runs like once in every 5 tries, other times I’m getting:

tastyfish@tastyfish-Lenovo-ideapad-700-15ISK ~/Git/PokittoSim/POKITTO_SIM/bin/Debug $ ./Pokitto_sim 
Assertion 'pthread_mutex_lock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:90, function pa_mutex_lock(). Aborting.
Aborted
tastyfish@tastyfish-Lenovo-ideapad-700-15ISK ~/Git/PokittoSim/POKITTO_SIM/bin/Debug $ ./Pokitto_sim 
Assertion 'pthread_mutex_lock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:90, function pa_mutex_lock(). Aborting.
Aborted
tastyfish@tastyfish-Lenovo-ideapad-700-15ISK ~/Git/PokittoSim/POKITTO_SIM/bin/Debug $ ./Pokitto_sim 
Segmentation fault
tastyfish@tastyfish-Lenovo-ideapad-700-15ISK ~/Git/PokittoSim/POKITTO_SIM/bin/Debug $ ./Pokitto_sim 
Assertion 'pthread_mutex_lock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:90, function pa_mutex_lock(). Aborting.
Aborted
tastyfish@tastyfish-Lenovo-ideapad-700-15ISK ~/Git/PokittoSim/POKITTO_SIM/bin/Debug $ ./Pokitto_sim 
Segmentation fault
tastyfish@tastyfish-Lenovo-ideapad-700-15ISK ~/Git/PokittoSim/POKITTO_SIM/bin/Debug $ ./Pokitto_sim 
*** Error in `./Pokitto_sim': munmap_chunk(): invalid pointer: 0x0000000001c39600 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fa4725a57e5]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x1a8)[0x7fa4725b2698]
/usr/lib/nvidia-384/libGL.so.1(+0xb68a1)[0x7fa46bb648a1]
======= Memory map: ========
00400000-00422000 r-xp 00000000 08:02 33033516                           /home/tastyfish/Git/PokittoSim/POKITTO_SIM/bin/Debug/Pokitto_sim
00621000-00622000 r--p 00021000 08:02 33033516                           /home/tastyfish/Git/PokittoSim/POKITTO_SIM/bin/Debug/Pokitto_sim
00622000-00623000 rw-p 00022000 08:02 33033516                           /home/tastyfish/Git/PokittoSim/POKITTO_SIM/bin/Debug/Pokitto_sim
00623000-00660000 rw-p 00000000 00:00 0 
...

Let me see, maybe I’m doing something wrong.

EDIT:

valgrind output:

Summary
valgrind ./Pokitto_sim 
==18654== Memcheck, a memory error detector
==18654== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==18654== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==18654== Command: ./Pokitto_sim
==18654== 
==18654== Syscall param writev(vector[...]) points to uninitialised byte(s)
==18654==    at 0x59F3FBD: ??? (syscall-template.S:84)
==18654==    by 0x9221F28: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==18654==    by 0x922231C: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==18654==    by 0x92223A4: xcb_writev (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==18654==    by 0x696B4AD: _XSend (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==18654==    by 0x696B9A1: _XReply (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==18654==    by 0x695659E: XInternAtom (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==18654==    by 0x4EF9AEA: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4EFA8F1: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4EEC148: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4EEBF34: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4E53396: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==  Address 0xbc2a893 is 35 bytes inside a block of size 16,384 alloc'd
==18654==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18654==    by 0x695B692: XOpenDisplay (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==18654==    by 0x4EF8DB4: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4EEBEE0: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4E53396: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x412E11: Pokitto::Simulator::initSDLGfx() (PokittoSimulator.cpp:165)
==18654==    by 0x4140ED: Pokitto::lcdInit() (in /home/tastyfish/Git/PokittoSim/POKITTO_SIM/bin/Debug/Pokitto_sim)
==18654==    by 0x4042CA: Pokitto::Display::begin() (PokittoDisplay.cpp:209)
==18654==    by 0x402060: Pokitto::Core::begin() (PokittoCore.cpp:108)
==18654==    by 0x4038CF: main (Chipeng.cpp:23)
==18654== 
==18654== Thread 4 SDLAudioDev2:
==18654== Invalid write of size 1
==18654==    at 0x4134BF: simAudioCallback(void*, unsigned char*, int) (PokittoSimulator.cpp:496)
==18654==    by 0x4E5583A: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4EB509B: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4F03398: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x830B6B9: start_thread (pthread_create.c:333)
==18654==    by 0x59FE3DC: clone (clone.S:109)
==18654==  Address 0xee6f2cd is 0 bytes after a block of size 285 alloc'd
==18654==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18654==    by 0x4EEEBCE: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4E566B2: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x413542: Pokitto::Simulator::initSDLAudio() (PokittoSimulator.cpp:520)
==18654==    by 0x4137BB: Pokitto::soundInit() (SimSound.cpp:54)
==18654==    by 0x4099D4: Pokitto::Sound::begin() (PokittoSound.cpp:226)
==18654==    by 0x40206A: Pokitto::Core::begin() (PokittoCore.cpp:113)
==18654==    by 0x4038CF: main (Chipeng.cpp:23)
==18654== 
==18654== Invalid read of size 8
==18654==    at 0x8B700D5: pa_mempool_block_size_max (in /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-8.0.so)
==18654==    by 0x64FCBBF: pa_stream_write_ext_free (in /usr/lib/x86_64-linux-gnu/libpulse.so.0.19.0)
==18654==    by 0x64FCFE0: pa_stream_write (in /usr/lib/x86_64-linux-gnu/libpulse.so.0.19.0)
==18654==    by 0x4EEE5F4: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4E557D5: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4EB509B: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4F03398: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x830B6B9: start_thread (pthread_create.c:333)
==18654==    by 0x59FE3DC: clone (clone.S:109)
==18654==  Address 0x7e7e7e7e00000030 is not stack'd, malloc'd or (recently) free'd
==18654== 
==18654== 
==18654== Process terminating with default action of signal 11 (SIGSEGV)
==18654==  General Protection Fault
==18654==    at 0x8B700D5: pa_mempool_block_size_max (in /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-8.0.so)
==18654==    by 0x64FCBBF: pa_stream_write_ext_free (in /usr/lib/x86_64-linux-gnu/libpulse.so.0.19.0)
==18654==    by 0x64FCFE0: pa_stream_write (in /usr/lib/x86_64-linux-gnu/libpulse.so.0.19.0)
==18654==    by 0x4EEE5F4: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4E557D5: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4EB509B: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x4F03398: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==18654==    by 0x830B6B9: start_thread (pthread_create.c:333)
==18654==    by 0x59FE3DC: clone (clone.S:109)
==18654== 
==18654== HEAP SUMMARY:
==18654==     in use at exit: 4,561,435 bytes in 2,478 blocks
==18654==   total heap usage: 24,752 allocs, 22,274 frees, 639,064,987 bytes allocated
==18654== 
==18654== LEAK SUMMARY:
==18654==    definitely lost: 3,216 bytes in 3 blocks
==18654==    indirectly lost: 0 bytes in 0 blocks
==18654==      possibly lost: 467,424 bytes in 27 blocks
==18654==    still reachable: 4,090,795 bytes in 2,448 blocks
==18654==                       of which reachable via heuristic:
==18654==                         newarray           : 16 bytes in 1 blocks
==18654==                         multipleinheritance: 104 bytes in 1 blocks
==18654==         suppressed: 0 bytes in 0 blocks
==18654== Rerun with --leak-check=full to see details of leaked memory
==18654== 
==18654== For counts of detected and suppressed errors, rerun with: -v
==18654== Use --track-origins=yes to see where uninitialised values come from
==18654== ERROR SUMMARY: 71 errors from 3 contexts (suppressed: 0 from 0)
Killed

Actually I think I might have seen this error before, could be wrong SDL installation.

EDIT2:

well, still don’t know :confused:

fun workaround for now:

#!/bin/bash

while true
do
  SECONDS=0
  ./Pokitto_sim

  if [ $SECONDS -ge 4 ]; then
    break
  fi
done

you have exactly the same symptoms as I have noticed

1 Like