Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on openig in linux #1044

Closed
narukeh opened this issue Apr 8, 2020 · 29 comments
Closed

Error on openig in linux #1044

narukeh opened this issue Apr 8, 2020 · 29 comments
Assignees
Labels
platform: linux For issues affecting TIC80 on Linux

Comments

@narukeh
Copy link

narukeh commented Apr 8, 2020

I'm on ArchLinux, i compiled this package this aur and also this this from tic.computer
i always get an error code when i want to launch it:

TIC-80 tiny computer 0.70.6
 http://tic.computer (C) 2017
malloc(): invalid next size (unsorted)
zsh: abort (core dumped)  ./tic80

or this, from the compiled one, which i think its the same:

TIC-80 tiny computer 0.80.1097-dev Pro
 http://tic80.com (C) 2020
malloc(): invalid next size (unsorted)
zsh: abort (core dumped)  tic80

does tic80 have a dependency to RUN? i know it has some to build. take a look at the aur package pkgbuild i compiled.

@nesbox
Copy link
Owner

nesbox commented Apr 8, 2020

Hmm, I've never seen it before, could you debug it please to locate code where crash occured?
Thank you.

@narukeh
Copy link
Author

narukeh commented Apr 8, 2020

how do i do that? 😅(sorry idk how to debug)
additional info: i am using i3 window manager, not a usual desktop. i will try it in manjaro xfce.

@narukeh
Copy link
Author

narukeh commented Apr 9, 2020

My assumption was correct. I installed manjaro xfce in virtualbox, and there it ran fine, both the release and the compiled one. It seems tic-80 does not like tiling window managers.


GUESSING:
so i tried opening multiple (terminal)windows to reduce the screen size tic80 would be having, or make tic-80 float by default, sometimes, very rarely, it would run, but when i try to open it in another workspace, it would not run anymore. Which let me to belive it has no default screen size by default, which is not true, since in xfce it does have a specific size it always opens.

@nesbox
Copy link
Owner

nesbox commented Apr 10, 2020

Have you tried to run tic80-sokol?

@narukeh
Copy link
Author

narukeh commented Apr 10, 2020

$ ./tic80-sokol

 TIC-80 tiny computer 0.80.1103-dev Pro
 http://tic80.com (C) 2020
zsh: abort (core dumped)  ./tic80-sokol

it does not even attempt to open, and gives no error info.

@RobLoach
Copy link
Contributor

Looking at the package source, I do see 3rd-party still in there. That's no longer needed.

@narukeh
Copy link
Author

narukeh commented Apr 10, 2020

@RobLoach yes. that package also does not give me tic80-sokol
so i built it myselt, like in the wiki

git clone --recursive https://github.com/nesbox/TIC-80
cd TIC-80/build
cmake -DBUILD_PRO=true ..
make -j4

@narukeh
Copy link
Author

narukeh commented Apr 10, 2020

TLDR: Which are ALL dependencies? please list recommended also. it must be one of THESE

Explanation:
I THINK, its NOT because "window manager vs. normal desktop enviroment", because i installed Xfce on my (arch) laptop, but it still would not run. Which can only mean Manjaro must be shipping an extra package by default. So i diff'd All packages on my (arch) laptop and manjaro (vm), (meaning all in manjaro (vm) but not my laptop(arch)) thats the list above.

@narukeh
Copy link
Author

narukeh commented Apr 11, 2020

@nesbox @RobLoach since i've been waiting for your response, here i posted my build log
and i also made a new PKGBUILD

@RobLoach
Copy link
Contributor

I don't use arch, but this certainly looks more up too date than the other package definition.

@stefandevai
Copy link
Contributor

Hi @narukeh, I happen to also use arch with i3wm but I couldn't reproduce your error. Actually both the aur package and the binary work just fine for me.

Are you still having this problem? Have you updated packages from both the official repository and the aur?

@narukeh
Copy link
Author

narukeh commented Apr 29, 2020

@stefandevai i just build it, and its still not working. Under Manjaro it runs fine. Which means im missing a dependencie, which the developer i think took for granted that everyone has. i have a minimal install. cant figure it out which package that is, what do u think is a recomended dependency? its gotta be one of these.

@stefandevai
Copy link
Contributor

So these are the 3rd-party dependencies of the project. I also took a look in your diff of packages and pinpointed these ones related to graphics/sound which you can try to install:

  • lib32-glew
  • lib32-gcc-libs
  • lib32-glu
  • lib32-libogg
  • lib32-libpulse
  • lib32-libvorbis
  • lib32-sdl2
  • pulseaudio-alsa

Tell me if anything changes :)

@narukeh
Copy link
Author

narukeh commented Apr 29, 2020

😅i did not even have multilib, so i enabled it and installed all of them, but its still not working.
EDIT: @stefandevai i just rebooted, AND IT WORKS. ma maaan! thanks a lot.
@nesbox i think now you sould state these needed dependencies.

  • lib32-glew
  • lib32-gcc-libs
  • lib32-glu
  • lib32-libogg
  • lib32-libpulse
  • lib32-libvorbis
  • lib32-sdl2
  • pulseaudio-alsa

im gonna close this issiue here, @stefandevai thanks again.

@narukeh narukeh closed this as completed Apr 29, 2020
@narukeh
Copy link
Author

narukeh commented Apr 29, 2020

After i closed it, i could not open it again. Only when i changed my workspace did it work, which meant i could only run it 10 time in a session. than even that would not work, only after i would: rm -rf ~/.local/share/com.nesbox.tic would it work. than even that would not work, only after i would log out and log in would it work, then only after a reboot, and now it wont open again anymore. i literaly have no clue whats causing this.
@stefandevai where else does it store config and data?

@narukeh narukeh reopened this Apr 29, 2020
@stefandevai
Copy link
Contributor

Well, at least things changed and you were able to run it for a while. Let's try to understand this new problem. So there's no error message appearing when you try to open it? Have you tried to rm -r the old build and build everything again?

Depending on the way you are using the tic80 command, there's a .local/ in your cart.tic path or in the path from where you are running the command. Try to see if by removing those you get anything different.

@narukeh
Copy link
Author

narukeh commented Apr 30, 2020

@stefandevai its the same old error message:

$ /usr/bin/tic80

 TIC-80 tiny computer 0.80.1110-dev Pro
 http://tic80.com (C) 2020
malloc(): invalid next size (unsorted)
zsh: abort (core dumped)  /usr/bin/tic80

to find config or data i do this:

find $HOME/.config/ | grep -i tic
find $HOME/.local/share/ | grep -i tic

ran everything from ~. Nothing tic related shows up, other than ~/.local/share/com.nesbox.tic which im deleting.
i also have a script that deletes cache and temp files: sudo rm -rf $HOME/.cache /root/.cache /tmp/* /tmp/.* /var/tmp/* /var/tmp/.* /var/cache/pacman/pkg/* >/dev/null 2>&1
so i guess there is nothing else left to delete. i also did grep -ri cart.tic while i was under~/.config/ and ~/.local/ meaning no file contains that string.

The 70.0.6 release, gives me this error mesage once, the first time on a "fresh" workspace:

./tic80

 TIC-80 tiny computer 0.70.6
 http://tic.computer (C) 2017
malloc(): mismatching next->prev_size (unsorted)
zsh: abort (core dumped)  ./tic80

then it gives me the old error mesage, even after i delete ~/.local/share/com.nesbox.tic.
im not good at programing but you should take a look at the malloc() function in the source code.

@nesbox
Copy link
Owner

nesbox commented Apr 30, 2020

@narukeh what if you try to debug it with gdb

$ gdb ./tic80
$ r

once the program crash, do bt for backtrace

$ bt

and show us the output

@narukeh
Copy link
Author

narukeh commented Apr 30, 2020

@nesbox here is the output of the latest build:

(gdb) r
Starting program: /usr/bin/tic80
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff447a700 (LWP 8664)]
[New Thread 0x7ffff3c79700 (LWP 8665)]
[New Thread 0x7ffff3478700 (LWP 8666)]
[New Thread 0x7ffff2c77700 (LWP 8667)]
[New Thread 0x7ffff1ddd700 (LWP 8668)]
[New Thread 0x7ffff2476700 (LWP 8669)]

 TIC-80 tiny computer 0.80.1110-dev Pro
 http://tic80.com (C) 2020
malloc(): invalid next size (unsorted)

Thread 1 "tic80" received signal SIGABRT, Aborted.
0x00007ffff7229ce5 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7229ce5 in raise () at /usr/lib/libc.so.6
#1  0x00007ffff7213857 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff726d2b0 in __libc_message () at /usr/lib/libc.so.6
#3  0x00007ffff727474a in  () at /usr/lib/libc.so.6
#4  0x00007ffff727770c in _int_malloc () at /usr/lib/libc.so.6
#5  0x00007ffff7278fb9 in malloc () at /usr/lib/libc.so.6
#6  0x00007ffff6646dc2 in glXGetProcAddress () at /usr/lib/libGLX.so.0
#7  0x00000001000ee5fe in  ()
#8  0x00000001000f8433 in glewInit ()
#9  0x00000001000ea1a3 in  ()
#10 0x00000001000dc28d in  ()
#11 0x00000001000a13fa in GPU_InitRendererByID ()
#12 0x00000001000a15ad in GPU_Init ()
#13 0x000000010007da54 in  ()
#14 0x0000000100075852 in main ()
(gdb)

and here is the output of the 0.70 release:

(gdb) r
Starting program: /tmp/tic80
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff447d700 (LWP 10876)]
[New Thread 0x7ffff3c7c700 (LWP 10877)]
[New Thread 0x7ffff347b700 (LWP 10878)]
[New Thread 0x7ffff2c7a700 (LWP 10879)]
[New Thread 0x7ffff1deb700 (LWP 10880)]
[New Thread 0x7ffff2479700 (LWP 10881)]

 TIC-80 tiny computer 0.70.6
 http://tic.computer (C) 2017
malloc(): mismatching next->prev_size (unsorted)

Thread 1 "tic80" received signal SIGABRT, Aborted.
0x00007ffff742cce5 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff742cce5 in raise () at /usr/lib/libc.so.6
#1  0x00007ffff7416857 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff74702b0 in __libc_message () at /usr/lib/libc.so.6
#3  0x00007ffff747774a in  () at /usr/lib/libc.so.6
#4  0x00007ffff747aa44 in _int_malloc () at /usr/lib/libc.so.6
#5  0x00007ffff747bfb9 in malloc () at /usr/lib/libc.so.6
#6  0x00007ffff6849dc2 in glXGetProcAddress () at /usr/lib/libGLX.so.0
#7  0x0000000000575b66 in _glewInit_GL_VERSION_1_3 ()
#8  0x000000000058b6fb in glewInit ()
#9  0x000000000052fd62 in CreateTargetFromWindow ()
#10 0x0000000000529e1b in Init ()
#11 0x00000000004d85d1 in GPU_Init ()
#12 0x000000000040755c in main ()

@nesbox
Copy link
Owner

nesbox commented Apr 30, 2020

@narukeh
ok, I made some fixes, could you pls download the build from here https://builds.tic80.com/test-sdlgpu/2020.04.30/linux or build https://github.com/nesbox/TIC-80/tree/test-sdlgpu branch yourself and test

@narukeh
Copy link
Author

narukeh commented Apr 30, 2020

@nesbox
open error:

$ ./tic80
ALSA lib control.c:1379:(snd_ctl_open_noupdate) Invalid CTL hw:0
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM dmix

 TIC-80 tiny computer 0.80.1145-dev
 http://tic80.com (C) 2020
malloc(): invalid next size (unsorted)
zsh: abort (core dumped)  ./tic80

debug:

(gdb) r
Starting program: /tmp/tic80
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff447a700 (LWP 16224)]
[New Thread 0x7ffff3c79700 (LWP 16225)]
[New Thread 0x7ffff3478700 (LWP 16226)]
[New Thread 0x7ffff2c77700 (LWP 16227)]
[New Thread 0x7ffff2376700 (LWP 16228)]
ALSA lib control.c:1379:(snd_ctl_open_noupdate) Invalid CTL hw:0
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM dmix

 TIC-80 tiny computer 0.80.1145-dev
 http://tic80.com (C) 2020
malloc(): invalid next size (unsorted)

Thread 1 "tic80" received signal SIGABRT, Aborted.
0x00007ffff7243ce5 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7243ce5 in raise () at /usr/lib/libc.so.6
#1  0x00007ffff722d857 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff72872b0 in __libc_message () at /usr/lib/libc.so.6
#3  0x00007ffff728e74a in  () at /usr/lib/libc.so.6
#4  0x00007ffff729170c in _int_malloc () at /usr/lib/libc.so.6
#5  0x00007ffff7292fb9 in malloc () at /usr/lib/libc.so.6
#6  0x00007ffff6660dc2 in glXGetProcAddress () at /usr/lib/libGLX.so.0
#7  0x00000000004d3a62 in _glewInit_GL_VERSION_1_3 ()
#8  0x00000000004e24ab in glewInit ()
#9  0x00000000004a974a in CreateTargetFromWindow ()
#10 0x00000000004a6b0d in Init ()
#11 0x0000000000479566 in GPU_InitRendererByID ()
#12 0x000000000047966e in GPU_Init ()
#13 0x000000000045e69e in initGPU ()
#14 0x0000000000457bff in main ()

(tried it with the download link)

@technomancy
Copy link
Contributor

I'm getting this same problem on my machine. It started happening immediately after upgrading my OS from Debian 9 to Debian 10. (glibc version is 2.28 if that's relevant)

I get the same thing on 0.70.0, or 0.80.1265-dev downloaded from builds.tic.computer, or from 0.80.1273-dev built myself.

My backtrace is slightly different from the one above, but only in the version numbers:

(gdb) r
Starting program: /home/noah/src/TIC-80/build/bin/tic80 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff3454700 (LWP 3077)]
[New Thread 0x7ffff1f4d700 (LWP 3079)]
[New Thread 0x7ffff2c4c700 (LWP 3080)]

 TIC-80 tiny computer 0.80.1273-dev
 http://tic80.com (C) 2020
malloc(): invalid next size (unsorted)

Thread 1 "tic80" received signal SIGABRT, Aborted.
0x00007ffff6a547bb in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff6a547bb in raise () at /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff6a3f535 in abort () at /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff6a96508 in  () at /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff6a9cc1a in  () at /lib/x86_64-linux-gnu/libc.so.6
#4  0x00007ffff6a9fbc4 in  () at /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007ffff6aa156a in malloc () at /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007ffff53f8719 in glXGetProcAddress ()
    at /usr/lib/x86_64-linux-gnu/libGLX.so.0
#7  0x000055555567398c in _glewInit_GL_VERSION_1_2 ()
#8  0x0000555555697cf0 in glewContextInit ()
#9  0x00005555556a3636 in glewInit ()
#10 0x00005555556581cf in CreateTargetFromWindow ()
#11 0x00005555556576ae in Init ()
#12 0x000055555560169d in GPU_InitRendererByID ()
#13 0x000055555560154d in GPU_Init ()
#14 0x00005555555d4d2b in initGPU ()
#15 0x00005555555d6bb4 in start ()
#16 0x00005555555d6d49 in main ()

The tic80-sokol executable also exits immediately; the only difference is that it does not print the malloc(): invalid next size (unsorted) message before doing so. The backtrace there is shorter:

(gdb) r
Starting program: /home/noah/src/TIC-80/build/bin/tic80-sokol 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffefe39700 (LWP 1710)]
[New Thread 0x7fffef638700 (LWP 1711)]

 TIC-80 tiny computer 0.80.1273-dev
 http://tic80.com (C) 2020
[New Thread 0x7fffed896700 (LWP 1712)]

Thread 1 "tic80-sokol" received signal SIGABRT, Aborted.
0x00007ffff68ee7bb in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff68ee7bb in raise () at /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff68d9535 in abort () at /lib/x86_64-linux-gnu/libc.so.6
#2  0x00005555555b2488 in _sapp_strcpy ()
#3  0x00005555555b385d in _sapp_glx_create_context ()
#4  0x00005555555b5288 in main ()

@Anrock Anrock added the platform: linux For issues affecting TIC80 on Linux label Sep 3, 2020
@StephenWassell
Copy link

I had the exact same problem with the develop branch built on Raspberry Pi 4B (standard 32 bit Raspbian, not bare metal). The solution I found was to use the GLES 2 renderer instead of OpenGL. I switched it by patching CMakeLists.txt - maybe there's a better way?

At CMakeLists.txt line 717, replace the line starting "target_compile_definitions(sdlgpu" with the version above under "if(EMSCRIPTEN OR ANDROID)"

@nesbox
Copy link
Owner

nesbox commented Nov 10, 2020

Disabled SDL GPU lib by default 0995ce5

@nesbox nesbox closed this as completed Nov 10, 2020
@technomancy
Copy link
Contributor

I built this from master yesterday, and it's still crashing on my Debian Buster machine. Anything else I can do to debug?

@nesbox
Copy link
Owner

nesbox commented Nov 13, 2020

Do you see any error messages in the terminal?

@technomancy
Copy link
Contributor

Oh, sorry--yeah, to be clear I get the exact same message as in the original description of this issue: malloc(): invalid next size (unsorted)

@nesbox
Copy link
Owner

nesbox commented Nov 14, 2020

It's strange because SDLGPU disabled by default,
could please do a clean rebuild on the clean repo?
Thanks.

@technomancy
Copy link
Contributor

I don't get this error any more; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: linux For issues affecting TIC80 on Linux
Projects
None yet
Development

No branches or pull requests

7 participants