Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Error in `./sfml-app': free(): invalid pointer  (Read 6583 times)

0 Members and 1 Guest are viewing this topic.

BroManSalaam

  • Guest
Error in `./sfml-app': free(): invalid pointer
« on: January 12, 2017, 10:36:45 pm »
I've been trying to run sfml on my computer following this tutorial http://www.sfml-dev.org/tutorials/2.0/start-linux.php
the program compiles without any errors, and I set up my link paths correctly, however once I run the program this message appears

Error in `./sfml-app': free(): invalid pointer: 0x000000000206ab38 ***

Following this is a long memory map that starts at my program's directory and works its way to the /dev folder

7ffb9fa63000-7ffb9fa64000 rw-s dfdf5000Aborted (core dumped)

Ubuntu version: 16.04
SFML-2.4.1 (GCC - 64-bit) 
g++ Version 5.4.0

I've already tried switched my g++ version to something before 5.4.0, however this does not change the outcome of the program at all.

 I would greatly appreciate some help. Thanks

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error in `./sfml-app': free(): invalid pointer
« Reply #1 on: January 12, 2017, 10:54:13 pm »
Build the debug libs of SFML, find out where the error occurs and provide a stack trace.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

BroManSalaam

  • Guest
Re: Error in `./sfml-app': free(): invalid pointer
« Reply #2 on: January 13, 2017, 02:24:04 am »
I used this command to compile

g++-4.8 main.o -o sfml-app -L /media/matt/DataDrive/SFML-2.4.1/lib -lsfml-graphics-d -lsfml-window-d -lsfml-system-d

Then used this to compile

export LD_LIBRARY_PATH=/media/matt/DataDrive/SFML-2.4.1/lib && ./sfml-app

errors

: free(): invalid pointer: 0x0000000001136fe8 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f039c0b17e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7fe0a)[0x7f039c0b9e0a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f039c0bd98c]
./sfml-app[0x401746]
./sfml-app[0x401715]
./sfml-app[0x4016a4]
./sfml-app[0x40161a]
./sfml-app[0x401599]
./sfml-app(_ZN2sf6StringD1Ev+0x18)[0x401560]
/media/matt/DataDrive/SFML-2.4.1/lib/libsfml-window-d.so.2.4(+0x2a551)[0x7f039cbf4551]
/media/matt/DataDrive/SFML-2.4.1/lib/libsfml-window-d.so.2.4(+0x2b3d3)[0x7f039cbf53d3]
/media/matt/DataDrive/SFML-2.4.1/lib/libsfml-window-d.so.2.4(+0x2488b)[0x7f039cbee88b]
/media/matt/DataDrive/SFML-2.4.1/lib/libsfml-window-d.so.2.4(_ZN2sf6Window6createENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE+0x113)[0x7f039cbede15]
/media/matt/DataDrive/SFML-2.4.1/lib/libsfml-graphics-d.so.2.4(_ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE+0x87)[0x7f039ce68c83]
./sfml-app[0x401315]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f039c05a830]
./sfml-app[0x401189]
======= Memory map: ========
00400000-00402000 r-xp 00000000 08:21 19922947                           /media/matt/DataDrive/TPC/sfml-app
00601000-00602000 r--p 00001000 08:21 19922947                           /media/matt/DataDrive/TPC/sfml-app
00602000-00603000 rw-p 00002000 08:21 19922947                           /media/matt/DataDrive/TPC/sfml-app
00ee7000-0116e000 rw-p 00000000 00:00 0                                  [heap]
4028a000-4028c000 r-xs 00000000 08:11 11021694                           /tmp/.glo9QteG (deleted)
409b9000-40a59000 rw-p 00000000 00:00 0
7f0390000000-7f0390021000 rw-p 00000000 00:00 0
7f0390021000-7f0394000000 ---p 00000000 00:00 0
7f03967d2000-7f0396852000 rw-s 1631a0000 00:06 531                       /dev/nvidiactl
7f0396852000-7f0396854000 rw-s 00000000 08:11 11021694                   /tmp/.glo9QteG (deleted)
7f0396855000-7f03968d5000 rw-s 16311b000 00:06 531                       /dev/nvidiactl
7f03968d5000-7f0396955000 rw-s 16309b000 00:06 531                       /dev/nvidiactl
7f039695a000-7f0396a5a000 rw-s 180270000 00:06 531                       /dev/nvidiactl
7f0396a5c000-7f0396a6f000 rw-s 4d69a000 00:06 531                        /dev/nvidiactl
7f0396a72000-7f0396a82000 rw-s d03f0000 00:06 532                        /dev/nvidia0
7f0396a82000-7f0396a86000 rw-s 72900000 00:06 531                        /dev/nvidiactl
7f0396a8d000-7f0396acd000 rw-s 50bdb000 00:06 531                        /dev/nvidiactl
7f0396ad4000-7f0396af4000 rw-s 729b2000 00:06 531                        /dev/nvidiactl
7f0396af4000-7f0396b34000 rw-s 72902000 00:06 531                        /dev/nvidiactl
7f0396b37000-7f0396d82000 rw-p 00000000 00:00 0
7f0396d82000-7f039811b000 r-xp 00000000 08:11 9439775                    /usr/lib/nvidia-367/libnvidia-glcore.so.367.57
7f039811b000-7f039813b000 rwxp 01399000 08:11 9439775                    /usr/lib/nvidia-367/libnvidia-glcore.so.367.57
7f039813b000-7f03984dc000 r-xp 013b9000 08:11 9439775                    /usr/lib/nvidia-367/libnvidia-glcore.so.367.57
7f03984dc000-7f03986db000 ---p 0175a000 08:11 9439775                    /usr/lib/nvidia-367/libnvidia-glcore.so.367.57
7f03986db000-7f0398aa3000 rw-p 01759000 08:11 9439775                    /usr/lib/nvidia-367/libnvidia-glcore.so.367.57
7f0398aa3000-7f0398abb000 rw-p 00000000 00:00 0
7f0398ac2000-7f0398ac5000 r-xp 00000000 08:11 9439779                    /usr/lib/nvidia-367/tls/libnvidia-tls.so.367.57
7f0398ac5000-7f0398cc5000 ---p 00003000 08:11 9439779                    /usr/lib/nvidia-367/tls/libnvidia-tls.so.367.57
7f0398cc5000-7f0398cc6000 rw-p 00003000 08:11 9439779                    /usr/lib/nvidia-367/tls/libnvidia-tls.so.367.57
7f0398cca000-7f0398d92000 r-xp 00000000 08:11 9439755                    /usr/lib/nvidia-367/libGLX_nvidia.so.367.57
7f0398d92000-7f0398dc6000 rwxp 000c8000 08:11 9439755                    /usr/lib/nvidia-367/libGLX_nvidia.so.367.57
7f0398dc6000-7f0398dd9000 r-xp 000fc000 08:11 9439755                    /usr/lib/nvidia-367/libGLX_nvidia.so.367.57
7f0398dd9000-7f0398fd9000 ---p 0010f000 08:11 9439755                    /usr/lib/nvidia-367/libGLX_nvidia.so.367.57
7f0398fd9000-7f0399001000 rw-p 0010f000 08:11 9439755                    /usr/lib/nvidia-367/libGLX_nvidia.so.367.57
7f0399001000-7f0399008000 rw-p 00000000 00:00 0
7f039900a000-7f039900f000 r-xp 00000000 08:11 9314320                    /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f039900f000-7f039920e000 ---p 00005000 08:11 9314320                    /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f039920e000-7f039920f000 r--p 00004000 08:11 9314320                    /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f039920f000-7f0399210000 rw-p 00005000 08:11 9314320                    /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f0399212000-7f0399214000 r-xp 00000000 08:11 9314309                    /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f0399214000-7f0399414000 ---p 00002000 08:11 9314309                    /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f0399414000-7f0399415000 r--p 00002000 08:11 9314309                    /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f0399415000-7f0399416000 rw-p 00003000 08:11 9314309                    /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f039941a000-7f0399423000 r-xp 00000000 08:11 9314342                    /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f0399423000-7f0399622000 ---p 00009000 08:11 9314342                    /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f0399622000-7f0399623000 r--p 00008000 08:11 9314342                    /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f0399623000-7f0399624000 rw-p 00009000 08:11 9314342                    /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f039962a000-7f039964e000 r-xp 00000000 08:11 11407886                   /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f039964e000-7f039984d000 ---p 00024000 08:11 11407886                   /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f039984d000-7f039984e000 r--p 00023000 08:11 11407886                   /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f039984e000-7f039984f000 rw-p 00024000 08:11 11407886                   /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f0399852000-7f039986b000 r-xp 00000000 08:11 11407936                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f039986b000-7f0399a6a000 ---p 00019000 08:11 11407936                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f0399a6a000-7f0399a6b000 r--p 00018000 08:11 11407936                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f0399a6b000-7f0399a6c000 rw-p 00019000 08:11 11407936                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f0399a72000-7f0399a93000 r-xp 00000000 08:11 9315687                    /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f0399a93000-7f0399c92000 ---p 00021000 08:11 9315687                    /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f0399c92000-7f0399c93000 r--p 00020000 08:11 9315687                    /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f0399c93000-7f0399c94000 rw-p 00021000 08:11 9315687                    /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f0399c9a000-7f0399c9e000 r-xp 00000000 08:11 11407929                   /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f0399c9e000-7f0399e9d000 ---p 00004000 08:11 11407929                   /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f0399e9d000-7f0399e9e000 r--p 00003000 08:11 11407929                   /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f0399e9e000-7f0399e9f000 rw-p 00004000 08:11 11407929                   /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f0399ea2000-7f0399ef0000 r-xp 00000000 08:11 9439771                    /usr/lib/nvidia-367/libGLdispatch.so.0
7f0399ef0000-7f0399f22000 r-xp 0004e000 08:11 9439771                    /usr/lib/nvidia-367/libGLdispatch.so.0
7f0399f22000-7f0399f5c000 r-xp 00080000 08:11 9439771                    /usr/lib/nvidia-367/libGLdispatch.so.0
7f0399f5c000-7f039a15c000 ---p 000ba000 08:11 9439771                    /usr/lib/nvidia-367/libGLdispatch.so.0
7f039a15c000-7f039a16b000 rw-p 000ba000 08:11 9439771                    /usr/lib/nvidia-367/libGLdispatch.so.0
7f039a16b000-7f039a18b000 rw-p 00000000 00:00 0
7f039a192000-7f039a1a2000 r-xp 00000000 08:11 9439788                    /usr/lib/nvidia-367/libGLX.so.0
7f039a1a2000-7f039a3a2000 ---p 00010000 08:11 9439788                    /usr/lib/nvidia-367/libGLX.so.0
7f039a3a2000-7f039a3a3000 rw-p 00010000 08:11 9439788                    /usr/lib/nvidia-367/libGLX.so.0
7f039a3a3000-7f039a3c3000 rw-p 00000000 00:00 0
7f039a3ca000-7f039a3cd000 r-xp 00000000 08:11 11403356                   /lib/x86_64-linux-gnu/libdl-2.23.so
7f039a3cd000-7f039a5cc000 ---p 00003000 08:11 11403356                   /lib/x86_64-linux-gnu/libdl-2.23.so
7f039a5cc000-7f039a5cd000 r--p 00002000 08:11 11403356                   /lib/x86_64-linux-gnu/libdl-2.23.so
7f039a5cd000-7f039a5ce000 rw-p 00003000 08:11 11403356                   /lib/x86_64-linux-gnu/libdl-2.23.so
7f039a5d2000-7f039a6da000 r-xp 00000000 08:11 11403362                   /lib/x86_64-linux-gnu/libm-2.23.so
7f039a6da000-7f039a8d9000 ---p 00108000 08:11 11403362                   /lib/x86_64-linux-gnu/libm-2.23.so
7f039a8d9000-7f039a8da000 r--p 00107000 08:11 11403362                   /lib/x86_64-linux-gnu/libm-2.23.so
7f039a8da000-7f039a8db000 rw-p 00108000 08:11 11403362                   /lib/x86_64-linux-gnu/libm-2.23.so
7f039a8e2000-7f039a8ec000 r-xp 00000000 08:11 9314340                    /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f039a8ec000-7f039aaeb000 ---p 0000a000 08:11 9314340                    /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f039aaeb000-7f039aaec000 r--p 00009000 08:11 9314340                    /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f039aaec000-7f039aaed000 rw-p 0000a000 08:11 9314340                    /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f039aaf2000-7f039aaf9000 r-xp 00000000 08:11 11403352                   /lib/x86_64-linux-gnu/librt-2.23.so
7f039aaf9000-7f039acf8000 ---p 00007000 08:11 11403352                   /lib/x86_64-linux-gnu/librt-2.23.so
7f039acf8000-7f039acf9000 r--p 00006000 08:11 11403352                   /lib/x86_64-linux-gnu/librt-2.23.so
7f039acf9000-7f039acfa000 rw-p 00007000 08:11 11403352                   /lib/x86_64-linux-gnu/librt-2.23.so
7f039acfa000-7f039ad12000 r-xp 00000000 08:11 11407645                   /lib/x86_64-linux-gnu/libpthread-2.23.so
7f039ad12000-7f039af11000 ---p 00018000 08:11 11407645                   /lib/x86_64-linux-gnu/libpthread-2.23.so
7f039af11000-7f039af12000 r--p 00017000 08:11 11407645                   /lib/x86_64-linux-gnu/libpthread-2.23.so
7f039af12000-7f039af13000 rw-p 00018000 08:11 11407645                   /lib/x86_64-linux-gnu/libpthread-2.23.so
7f039af13000-7f039af17000 rw-p 00000000 00:00 0
7f039af1a000-7f039af71000 r-xp 00000000 08:11 9315043                    /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f039af71000-7f039b171000 ---p 00057000 08:11 9315043                    /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f039b171000-7f039b172000 r--p 00057000 08:11 9315043                    /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f039b172000-7f039b173000 rw-p 00058000 08:11 9315043                    /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f039b17a000-7f039b21e000 r-xp 00000000 08:11 9314740                    /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f039b21e000-7f039b41d000 ---p 000a4000 08:11 9314740                    /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f039b41d000-7f039b423000 r--p 000a3000 08:11 9314740                    /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f039b423000-7f039b424000 rw-p 000a9000 08:11 9314740                    /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f039b42a000-7f039b43b000 r-xp 00000000 08:11 9314322                    /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f039b43b000-7f039b63a000 ---p 00011000 08:11 9314322                    /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f039b63a000-7f039b63b000 r--p 00010000 08:11 9314322                    /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f039b63b000-7f039b63c000 rw-p 00011000 08:11 9314322                    /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f039b642000-7f039b777000 r-xp 00000000 08:11 9314305                    /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f039b777000-7f039b977000 ---p 00135000 08:11 9314305                    /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f039b977000-7f039b978000 r--p 00135000 08:11 9314305                    /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f039b978000-7f039b97c000 rw-p 00136000 08:11 9314305                    /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f039b982000-7f039b998000 r-xp 00000000 08:11 9314175                    /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f039b998000-7f039bb97000 ---p 00016000 08:11 9314175                    /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f039bb97000-7f039bb98000 r--p 00015000 08:11 9314175                    /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f039bb98000-7f039bb99000 rw-p 00016000 08:11 9314175                    /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f039bb99000-7f039bb9c000 rw-p 00000000 00:00 0
7f039bba2000-7f039bba9000 r-xp 00000000 08:11 9314295                    /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f039bba9000-7f039bda8000 ---p 00007000 08:11 9314295                    /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f039bda8000-7f039bda9000 r--p 00006000 08:11 9314295                    /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f039bda9000-7f039bdaa000 rw-p 00007000 08:11 9314295                    /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f039bdaa000-7f039bddb000 r-xp 00000000 08:11 9439770                    /usr/lib/nvidia-367/libGL.so.1.0.0
7f039bddb000-7f039be0d000 r-xp 00031000 08:11 9439770                    /usr/lib/nvidia-367/libGL.so.1.0.0
7f039be0d000-7f039be37000 r-xp 00063000 08:11 9439770                    /usr/lib/nvidia-367/libGL.so.1.0.0
7f039be37000-7f039c037000 ---p 0008d000 08:11 9439770                    /usr/lib/nvidia-367/libGL.so.1.0.0
7f039c037000-7f039c038000 rw-p 0008d000 08:11 9439770                    /usr/lib/nvidia-367/libGL.so.1.0.0
7f039c038000-7f039c039000 rw-p 00000000 00:00 0
7f039c03a000-7f039c1f9000 r-xp 00000000 08:11 11403357                   /lib/x86_64-linux-gnu/libc-2.23.so
7f039c1f9000-7f039c3f9000 ---p 001bf000 08:11 11403357                   /lib/x86_64-linux-gnu/libc-2.23.so
7f039c3f9000-7f039c3fd000 r--p 001bf000 08:11 11403357                   /lib/x86_64-linux-gnu/libc-2.23.so
7f039c3fd000-7f039c3ff000 rw-p 001c3000 08:11 11403357                   /lib/x86_64-linux-gnu/libc-2.23.so
7f039c3ff000-7f039c403000 rw-p 00000000 00:00 0
7f039c40a000-7f039c420000 r-xp 00000000 08:11 11407783                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f039c420000-7f039c61f000 ---p 00016000 08:11 11407783                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f039c61f000-7f039c620000 rw-p 00015000 08:11 11407783                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f039c622000-7f039c794000 r-xp 00000000 08:11 9308289                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f039c794000-7f039c994000 ---p 00172000 08:11 9308289                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f039c994000-7f039c99e000 r--p 00172000 08:11 9308289                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f039c99e000-7f039c9a0000 rw-p 0017c000 08:11 9308289                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f039c9a0000-7f039c9a4000 rw-p 00000000 00:00 0
7f039c9aa000-7f039c9c5000 r-xp 00000000 08:21 262337                     /media/matt/DataDrive/SFML-2.4.1/lib/libsfml-system-d.so.2.4.0
7f039c9c5000-7f039cbc4000 ---p 0001b000 08:21 262337                     /media/matt/DataDrive/SFML-2.4.1/lib/libsfml-system-d.so.2.4.0
7f039cbc4000-7f039cbc6000 rw-p 0001a000 08:21 262337                     /media/matt/DataDrive/SFML-2.4.1/lib/libsfml-system-d.so.2.4.0
7f039cbca000-7f039cc14000 r-xp 00000000 08:21 262340                     /media/matt/DataDrive/SFML-2.4.1/lib/libsfml-window-d.so.2.4.0
7f039cc14000-7f039ce14000 ---p 0004a000 08:21 262340                     /media/matt/DataDrive/SFML-2.4.1/lib/libsfml-window-d.so.2.4.0
7f039ce14000-7f039ce17000 rw-p 0004a000 08:21 262340                     /media/matt/DataDrive/SFML-2.4.1/lib/libsfml-window-d.so.2.4.0
7f039ce1a000-7f039ce94000 r-xp 00000000 08:21 262346                     /media/matt/DataDrive/SFML-2.4.1/lib/libsfml-graphics-d.so.2.4.0
7f039ce94000-7f039d093000 ---p 0007a000 08:21 262346                     /media/matt/DataDrive/SFML-2.4.1/lib/libsfml-graphics-d.so.2.4.0
7f039d093000-7f039d097000 rw-p 00079000 08:21 262346                     /media/matt/DataDrive/SFML-2.4.1/lib/libsfml-graphics-d.so.2.4.0
7f039d097000-7f039d098000 rw-p 00000000 00:00 0
7f039d09a000-7f039d0aa000 r-xp 00000000 08:11 11403289                   /lib/x86_64-linux-gnu/ld-2.23.so
7f039d0aa000-7f039d0ab000 r-xp 00010000 08:11 11403289                   /lib/x86_64-linux-gnu/ld-2.23.so
7f039d0ab000-7f039d0c0000 r-xp 00011000 08:11 11403289                   /lib/x86_64-linux-gnu/ld-2.23.so
7f039d0c3000-7f039d0c4000 rw-s 4d699000 00:06 531                        /dev/nvidiactl
7f039d0c9000-7f039d0ca000 rw-s dfdf7000 00:06 532                        /dev/nvidia0
7f039d0d1000-7f039d0d2000 rw-s dfdf7000 00:06 532                        /dev/nvidia0
7f039d0d7000-7f039d0f7000 rw-s 50bed000 00:06 531                        /dev/nvidiactl
7f039d0f9000-7f039d0fa000 rw-s dfdf7000 00:06 532                        /dev/nvidia0
7f039d0fd000-7f039d13d000 rw-s 16932b000 00:06 531                       /dev/nvidiactl
7f039d141000-7f039d161000 rw-s 1692a7000 00:06 531                       /dev/nvidiactl
7f039d163000-7f039d267000 rw-s 22c1e1000 00:06 531                       /dev/nvidiactl
7f039d26c000-7f039d272000 rw-p 00000000 00:00 0
7f039d272000-7f039d290000 r-xp 00000000 08:11 11407683                   /lib/x86_64-linux-gnu/libudev.so.1.6.4
7f039d290000-7f039d291000 r--p 0001d000 08:11 11407683                   /lib/x86_64-linux-gnu/libudev.so.1.6.4
7f039d291000-7f039d292000 rw-p 0001e000 08:11 11407683                   /lib/x86_64-linux-gnu/libudev.so.1.6.4
7f039d292000-7f039d29a000 rw-p 00000000 00:00 0
7f039d29c000-7f039d29d000 rw-s 1692ca000 00:06 531                       /dev/nvidiactl
7f039d2a2000-7f039d2a3000 rw-s fd060000 00:06 532                        /dev/nvidia0
7f039d2a5000-7f039d2b8000 rw-p 00000000 00:00 0
7f039d2bb000-7f039d2bf000 rw-p 00000000 00:00 0
7f039d2bf000-7f039d2c0000 r--p 00025000 08:11 11403289                   /lib/x86_64-linux-gnu/ld-2.23.so
7f039d2c0000-7f039d2c1000 rw-p 00026000 08:11 11403289                   /lib/x86_64-linux-gnu/ld-2.23.so
7f039d2c1000-7f039d2c3000 rw-p 00000000 00:00 0
7ffd0a083000-7ffd0a0a4000 rw-p 00000000 00:00 0                          [stack]
7ffd0a1da000-7ffd0a1dc000 r--p 00000000 00:00 0                          [vvar]
7ffd0a1dc000-7ffd0a1de000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)


« Last Edit: January 13, 2017, 02:26:09 am by BroManSalaam »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error in `./sfml-app': free(): invalid pointer
« Reply #3 on: January 13, 2017, 02:30:07 am »
Build as debug with the -g flag, so you actually get a meaningful backtrace.

What's your code?
Where did you get SFML from?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

BroManSalaam

  • Guest
Re: Error in `./sfml-app': free(): invalid pointer
« Reply #4 on: January 13, 2017, 03:41:56 am »
Ok sorry about that, I included the -g flag and here is the output...

I got sfml form their website http://www.sfml-dev.org/download/sfml/2.4.1/

dow-d -lsfml-system-d
sfml-app:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o:(.rodata.cst4+0x0): first defined here
sfml-app: In function `main':
(.text+0xed): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
sfml-app: In function `data_start':
(.data+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o:(.data+0x0): first defined here
sfml-app: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o:(.fini+0x0): first defined here
sfml-app: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o:(.text+0x0): first defined here
sfml-app: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o:(.init+0x0): first defined here
sfml-app: In function `data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o:(.data+0x0): first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC_END__'
sfml-app:(.data+0x10): first defined here
/usr/bin/ld: error in sfml-app(.eh_frame); no .eh_frame_hdr table will be created.
collect2: error: ld returned 1 exit status


from this code...

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}

« Last Edit: January 13, 2017, 04:02:21 am by BroManSalaam »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Error in `./sfml-app': free(): invalid pointer
« Reply #5 on: January 13, 2017, 10:52:11 am »
From the error messages it seems like you're linking the application object file twice. Can you provide your build command?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

BroManSalaam

  • Guest
Re: Error in `./sfml-app': free(): invalid pointer
« Reply #6 on: January 13, 2017, 01:01:22 pm »
I used this command to compile  (the sfml project main.cpp is in a folder in the DataDrive directory if that helps at all)

g++-4.8 main.o -o -g sfml-app -L /media/matt/DataDrive/SFML-2.4.1/lib -lsfml-graphics -lsfml-window -lsfml-system

Alternatively when I run this command (replace main.o with main.cpp)

g++-4.8 main.cpp -o -g sfml-app -L /media/matt/DataDrive/SFML-2.4.1/lib -lsfml-graphics -lsfml-window -lsfml-system

the output is....

main.cpp:1:27: fatal error: SFML/Graphics.hpp: No such file or directory
compilation terminated.


The sfml window does briefly open for a second when using this command

g++-4.8 main.o -o sfml-app -L /media/matt/DataDrive/SFML-2.4.1/lib -lsfml-graphics -lsfml-window -lsfml-system

 but crashes and shows the error again

I read online about the free(): invalid pointer error, and found it is caused by trying to free objects from memory multiple times, or it Also happens if you have two libraries loaded into memory, which manipulate the same object name. Or two libraries of the same file name  identically named classes

I hope this helps, thanks.




« Last Edit: January 14, 2017, 05:06:49 am by BroManSalaam »

BroManSalaam

  • Guest
Re: Error in `./sfml-app': free(): invalid pointer
« Reply #7 on: January 15, 2017, 01:23:14 am »
It's fixed now, After deleting my project and reinstalling sfml and using g++-4.8 did it finally started to work.


Bogey

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Error in `./sfml-app': free(): invalid pointer
« Reply #8 on: March 30, 2017, 03:46:40 am »
Hi,

I am having a near identical problem with SFML 2.4.2 downloaded from this site. I am copying the example in the tutorial exactly, as in the code above. The code compiles but aborts with an invalid pointer when run. I did a fresh installation of Linux Mint 18.1 in case I broke something, but still have the same problem.

A trace in gdb gives me this:

Code: [Select]
#0  0x00007ffff6dc2428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff6dc402a in __GI_abort () at abort.c:89
#2  0x00007ffff6e047ea in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ffff6f1d2e0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff6e0ce0a in malloc_printerr (ar_ptr=<optimised out>, ptr=<optimised out>, str=0x7ffff6f1a0b2 "free(): invalid pointer", action=3) at malloc.c:5004
#4  _int_free (av=<optimised out>, p=<optimised out>, have_lock=0) at malloc.c:3865
#5  0x00007ffff6e1098c in __GI___libc_free (mem=<optimised out>) at malloc.c:2966
#6  0x0000000000401750 in __gnu_cxx::new_allocator<unsigned int>::deallocate (this=0x7fffffffd730, __p=0x7fa038) at /usr/include/c++/5/ext/new_allocator.h:110
#7  0x000000000040171f in __gnu_cxx::__alloc_traits<std::allocator<unsigned int> >::deallocate (__a=..., __p=0x7fa038, __n=140737344620449) at /usr/include/c++/5/ext/alloc_traits.h:185
#8  0x00000000004016ae in std::__cxx11::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_M_destroy (this=0x7fffffffd730, __size=140737344620448) at /usr/include/c++/5/bits/basic_string.h:185
#9  0x0000000000401624 in std::__cxx11::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_M_dispose (this=0x7fffffffd730) at /usr/include/c++/5/bits/basic_string.h:180
#10 0x00000000004015a3 in std::__cxx11::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::~basic_string (this=0x7fffffffd730, __in_chrg=<optimised out>)
    at /usr/include/c++/5/bits/basic_string.h:543
#11 0x000000000040156a in sf::String::~String (this=0x7fffffffd730, __in_chrg=<optimised out>) at /usr/local/include/SFML/System/String.hpp:45
#12 0x00007ffff7943dbf in sf::priv::JoystickImpl::open (this=0x7ffff7b573c0 <sf::priv::JoystickManager::getInstance()::instance>, index=0) at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/Unix/JoystickImpl.cpp:563
#13 0x00007ffff792aca4 in sf::priv::JoystickManager::update (this=0x7ffff7b573c0 <sf::priv::JoystickManager::getInstance()::instance>) at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/JoystickManager.cpp:90
#14 0x00007ffff792f37a in sf::priv::WindowImpl::WindowImpl (this=0x7f91c0) at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/WindowImpl.cpp:87
#15 0x00007ffff7935c4e in sf::priv::WindowImplX11::WindowImplX11 (this=0x7f91c0, mode=..., title=..., style=7, settings=...) at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/Unix/WindowImplX11.cpp:445
#16 0x00007ffff792f229 in sf::priv::WindowImpl::create (mode=..., title=..., style=7, settings=...) at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/WindowImpl.cpp:71
#17 0x00007ffff792e7b3 in sf::Window::create (this=0x7fffffffde00, mode=..., title=..., style=7, settings=...) at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/Window.cpp:124
#18 0x00007ffff7ba796b in sf::RenderWindow::RenderWindow (this=0x7fffffffde00, mode=..., title=..., style=7, settings=...) at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Graphics/RenderWindow.cpp:45
#19 0x000000000040131e in main () at main.cpp:5

I am not that familiar with Linux, C++ or SFML and I would appreciate your patience in helping me figure out what to do.

Thanks.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Error in `./sfml-app': free(): invalid pointer
« Reply #9 on: March 30, 2017, 09:13:38 am »
And where did you get SFML from?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Bogey

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Error in `./sfml-app': free(): invalid pointer
« Reply #10 on: March 30, 2017, 09:46:03 am »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Error in `./sfml-app': free(): invalid pointer
« Reply #11 on: March 30, 2017, 09:51:38 am »
Use the SFML version by your package manager or build SFML from source.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything