Giter Site home page Giter Site logo

Comments (9)

EinstokFair avatar EinstokFair commented on June 3, 2024

Oh, duplicate of #305, sorry

from singularity.

nthykier avatar nthykier commented on June 3, 2024

Ok, closing it as a duplicate.

from singularity.

EinstokFair avatar EinstokFair commented on June 3, 2024
$ gdb -c ./core.singularity.1000.316097c4c3964844b8d7dc2e925f61ca.2794939.1630465132000000
GNU gdb (Gentoo 10.1 vanilla) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
[New LWP 2794945]
[New LWP 2794942]
[New LWP 2794943]
[New LWP 2794946]
[New LWP 2794948]
[New LWP 2794950]
[New LWP 2794951]
[New LWP 2794947]
[New LWP 2794949]
[New LWP 2794952]
[New LWP 2794953]
[New LWP 2794954]
[New LWP 2794955]
[New LWP 2794944]
[New LWP 2794939]
Core was generated by `/usr/bin/python3.9 /usr/bin/singularity'.
--Type <RET> for more, q to quit, c to continue without paging--
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f97d8eff891 in ?? ()
[Current thread is 1 (LWP 2794945)]
(gdb) backtrace full
#0  0x00007f97d8eff891 in ?? ()
No symbol table info available.
#1  0x000000000e017407 in ?? ()
No symbol table info available.
#2  0x0000000000000000 in ?? ()
No symbol table info available.

«you can diagnose this bug yourself using valgrind or asan,
since the error message clearly points to heap memory corruption as the cause.
malloc_consolidate(): unaligned fastbin chunk detected» was written

https://www.valgrind.org/docs/manual/quick-start.html

$ valgrind --leak-check=yes singularity

https://www.valgrind.org/docs/manual/faq.html
«Valgrind ... replace certain functions, such as malloc, with their own versions.»

$ valgrind  --leak-check=yes singularity
==2810872== Memcheck, a memory error detector
==2810872== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2810872== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==2810872== Command: /usr/bin/singularity
==2810872== 

valgrind:  Fatal error at startup: a function redirection
valgrind:  which is mandatory for this platform-tool combination
valgrind:  cannot be set up.  Details of the redirection are:
valgrind:  
valgrind:  A must-be-redirected function
valgrind:  whose name matches the pattern:      strlen
valgrind:  in an object with soname matching:   ld-linux-x86-64.so.2
valgrind:  was not found whilst processing
valgrind:  symbols from the object with soname: ld-linux-x86-64.so.2
valgrind:  
valgrind:  Possible fixes: (1, short term): install glibc's debuginfo
valgrind:  package on this machine.  (2, longer term): ask the packagers
valgrind:  for your Linux distribution to please in future ship a non-
valgrind:  stripped ld.so (or whatever the dynamic linker .so is called)
valgrind:  that exports the above-named function using the standard
valgrind:  calling conventions for this platform.  The package you need
valgrind:  to install for fix (1) is called
valgrind:  
valgrind:    On Debian, Ubuntu:                 libc6-dbg
valgrind:    On SuSE, openSuSE, Fedora, RHEL:   glibc-debuginfo
valgrind:  
valgrind:  Note that if you are debugging a 32 bit process on a
valgrind:  64 bit system, you will need a corresponding 32 bit debuginfo
valgrind:  package (e.g. libc6-dbg:i386).
valgrind:  
valgrind:  Cannot continue -- exiting now.  Sorry.

I didn't know which packages should be compiled with "-o0 -ggdb" compiler options.

$ find /lib64 -iname "ld-linux-x86-64.so.2"
/lib64/ld-linux-x86-64.so.2
$ qfile /lib64/ld-linux-x86-64.so.2
sys-libs/glibc: /lib64/ld-linux-x86-64.so.2

https://forums.gentoo.org/viewtopic-t-1114190-start-0.html

# mkdir -p /etc/portage/env
# echo 'CFLAGS="-O2 -ggdb -pipe"' >/etc/portage/env/debug-cflags
# echo 'FEATURES="${FEATURES} nostrip"' >>/etc/portage/env/debug-cflags

# echo 'sys-libs/glibc debug-cflags' >>/etc/portage/package.env

$ valgrind  --leak-check=full  --show-leak-kinds=all singularity 2>./valgrind.log

The log is large, and no ideas how to analyze it

==2942468== LEAK SUMMARY:
==2942468==    definitely lost: 48 bytes in 4 blocks

https://stackoverflow.com/a/12420689/3161761

$ valgrind  --leak-check=full  --show-leak-kinds=all --log-file="filename" singularity 

It would be nice to reopen this bug, because the referred bug in NixOS was closed without resolution (The reason was not diagnosed and upstream or distribution bugs was not created).

from singularity.

EinstokFair avatar EinstokFair commented on June 3, 2024

some other error text, should i create one more bug?

$ valgrind  --leak-check=full  --show-leak-kinds=all --log-file="test00" singularity 
Singularity 1.00 (commit: 2ebc2f3f2059b96885416167363bde2e27ece106)
Running under Python 3.9.6 (default, Aug 31 2021, 06:56:05) [GCC 10.3.0]
pygame 2.0.1 (SDL 2.0.14, Python 3.9.6)
Hello from the pygame community. https://www.pygame.org/contribute.html
The error-log configured as /home/user/.local/share/singularity/log/error.log (lazily created when something is logged)
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  3 (X_GetWindowAttributes)
  Resource id in failed request:  0x800000e
  Serial number of failed request:  932
Current serial number in output stream:  935

from singularity.

rofl0r avatar rofl0r commented on June 3, 2024

you need to compile pygame with -O0 -g3, then use

valgrind --track-origins=yes --trace-children=yes and eventually --leak-check=full though i dont think leak related options are required. X error messages are irrelevant, you need to look for messages related to invalid writes and the like

from singularity.

EinstokFair avatar EinstokFair commented on June 3, 2024
  1. Why do I need to use "trace children", if singularity game is the single python process which doesn't start others?

    $ which singularity
    /usr/bin/singularity
    $ head -n1 /usr/bin/singularity
    #!/usr/bin/python3.9

  2. what -g3 option means ?
    https://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html
    https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-Options

    -glevel
    -ggdblevel
    Level 3 includes extra information, such as all the macro definitions present in the program. Some debuggers support macro expansion when you use -g3.

do i need -g3 or -ggdb3 or both and why?

I assume that they are aliases of each other and will use -ggdb3

  1. if X error message is irrelevant here, then may be other bug which it is relate to?

$ python -m pip uninstall pygame
Found existing installation: pygame 2.0.1
Uninstalling pygame-2.0.1:
  Would remove:
    /home/user/.local/include/python3.9/pygame/...
...
Proceed (Y/n)? Y
  Successfully uninstalled pygame-2.0.1

# echo 'CFLAGS="-O0 -ggdb3 -pipe"' >/etc/portage/env/debug3-cflags
# echo 'FEATURES="${FEATURES} nostrip"' >>/etc/portage/env/debug3-cflags

# echo 'dev-python/pygame debug3-cflags' >>/etc/portage/package.env

# emerge -av pygame
...
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] media-libs/portmidi-234::gentoo  USE="python -debug -doc -java -static-libs -test-programs" PYTHON_TARGETS="python3_9 -python3_8" 1 311 KiB
[ebuild   R    ] dev-python/pygame-2.0.1-r1::gentoo  USE="X midi* opengl* -doc -examples -test" PYTHON_TARGETS="python3_9 -python3_8" 5 408 KiB

Total: 2 packages (1 new, 1 reinstall), Size of downloads: 6 718 KiB
...
>>> Original instance of package unmerged safely.
>>> dev-python/pygame-2.0.1-r1 merged.
...

$ valgrind  --track-origins=yes  --log-file="test04" singularity --theme=vector --nosound

from singularity.

rofl0r avatar rofl0r commented on June 3, 2024

Why do I need to use "trace children", if singularity game is the single python process which doesn't start others?

because SDL starts a number of threads

from singularity.

EinstokFair avatar EinstokFair commented on June 3, 2024

Starting a thread don't require process forking.

https://valgrind.org/docs/manual/manual-core.html#manual-core.pthreads
«Valgrind serialises execution so that only one (kernel) thread is running at a time. This approach avoids the horrible implementation problems of implementing a truly multithreaded version of Valgrind»

here is some log example (but for another bug). I need some luck to reproduce this one (it is more rare, but still reproduced three times already at my machine).

it also says

ALSA lib /var/tmp/portage/media-libs/alsa-lib-1.2.4/work/alsa-lib-1.2.4/src/pcm/pcm.c:8545:(snd_pcm_recover) underrun occurred

sometimes.

UPD:
i think it is necessary to fix
#311
first, because that bug is much more frequent (I get it every launch).

from singularity.

JensKorte avatar JensKorte commented on June 3, 2024

I have the same problem. When deactivating ccache the error message changes but still the game crashes within minutes. It seems to me, when playing the easiest mode, creating many servers (20-50) speeds the up the crash. My system: RaspberryPi 400, Gentoo 64 bit (arm64).

from singularity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.