You are not logged in.
here's my strace (compiled with -std=gnu99):
execve("./pacman", ["./pacman"], [/* 39 vars */]) = 0
brk(0) = 0x11ec000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=220299, ...}) = 0
mmap(NULL, 220299, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7feefb9e5000
close(3) = 0
open("/usr/lib/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260u\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=444680, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feefb9e4000
mmap(NULL, 2542224, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7feefb58d000
mprotect(0x7feefb5f4000, 2097152, PROT_NONE) = 0
mmap(0x7feefb7f4000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x67000) = 0x7feefb7f4000
close(3) = 0
open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\7\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1991416, ...}) = 0
mmap(NULL, 3815984, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7feefb1e9000
mprotect(0x7feefb384000, 2093056, PROT_NONE) = 0
mmap(0x7feefb583000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19a000) = 0x7feefb583000
mmap(0x7feefb589000, 14896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7feefb589000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feefb9e3000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feefb9e2000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feefb9e1000
arch_prctl(ARCH_SET_FS, 0x7feefb9e2700) = 0
mprotect(0x7feefb583000, 16384, PROT_READ) = 0
mprotect(0x7feefb7f4000, 16384, PROT_READ) = 0
mprotect(0x7feefba1b000, 4096, PROT_READ) = 0
munmap(0x7feefb9e5000, 220299) = 0
brk(0) = 0x11ec000
brk(0x120d000) = 0x120d000
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
stat("/home/mus/.terminfo", 0x11ec7d0) = -1 ENOENT (No such file or directory)
stat("/usr/share/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
access("/usr/share/terminfo/r/rxvt-unicode-256color", R_OK) = 0
open("/usr/share/terminfo/r/rxvt-unicode-256color", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2234, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feefba1a000
read(3, "\32\1N\0\35\0\37\0p\1$\5rxvt-unicode-256colo"..., 4096) = 2234
read(3, "", 4096) = 0
close(3) = 0
munmap(0x7feefba1a000, 4096) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=70, ws_col=209, ws_xpixel=1672, ws_ypixel=980}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=70, ws_col=209, ws_xpixel=1672, ws_ypixel=980}) = 0
brk(0x122f000) = 0x122f000
brk(0x1250000) = 0x1250000
brk(0x1271000) = 0x1271000
brk(0x1292000) = 0x1292000
brk(0x12b3000) = 0x12b3000
brk(0x12d4000) = 0x12d4000
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
brk(0x12f5000) = 0x12f5000
brk(0x1316000) = 0x1316000
brk(0x1337000) = 0x1337000
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig -icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig -icanon -echo ...}) = 0
rt_sigaction(SIGTSTP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTSTP, {0x7feefb5b7300, [], SA_RESTORER|SA_RESTART, 0x7feefb21c680}, NULL, 8) = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {0x7feefb5b7210, [], SA_RESTORER|SA_RESTART, 0x7feefb21c680}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {0x7feefb5b7210, [], SA_RESTORER|SA_RESTART, 0x7feefb21c680}, NULL, 8) = 0
rt_sigaction(SIGWINCH, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGWINCH, {0x7feefb5b7200, [], SA_RESTORER, 0x7feefb21c680}, NULL, 8) = 0
ioctl(1, TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feefb9fa000
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feefb9f9000
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
write(1, "\n", 1) = 1
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xfffffff91055b001} ---
+++ killed by SIGSEGV (core dumped) +++
Offline
Digging the car out of the ice
-H
OH MAN! Not fun!
... and on the other side of the scale we survived a 41.5°C (106.70°F) day yesterday.
What am I working on right now: nada! - enjoying the first day below 30°C in weeks.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
here's my strace (compiled with -std=gnu99):
Way over my head ... what's it doing?
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
41.5°C (106.70°F) day yesterday
How on Earth did you cope?
That sounds just awful.
Offline
ohnonot wrote:here's my strace (compiled with -std=gnu99):
Way over my head ... what's it doing?
We're trying to debug @pingu's pacman game
https://forums.bunsenlabs.org/viewtopic … 168#p16168
Offline
Compiling pingu's pacman game as follows gives a warning (unrelated to the issue) and enables gdb to give us a stracktrace:
gcc -g pacman.c map.c -o pacman -lncurses -Wall -Werror -Wextra -pedantic
Stracktrace:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000401b55 in insertGhost (g=0x7fffffffe160, p=...) at map.c:239
239 g->ghosts[g->ghostsn] = ghost;
(gdb) bt
#0 0x0000000000401b55 in insertGhost (g=0x7fffffffe160, p=...) at map.c:239
#1 0x0000000000401c66 in Ghosts (m=0x7fffffffe190, g=0x7fffffffe160) at map.c:264
#2 0x0000000000401355 in main (argc=1, argv=0x7fffffffe2a8) at pacman.c:137
Inspecting g->ghostsn shows it has a value of -7712:
(gdb) p g->ghostsn
$1 = -7712
That should give you enough pointers where to look
EDIT: It seems using `long` instead of `int` for `ghostsn` fixes the above issue. However, you might want to look into why/where it overflows and provide an upper bound for the amount of ghosts. (I'm not sure of how your game works exactly, so perhaps you do really need more than INT_MAX ghosts. It seems a bit excessive to me, though).
Now there is a new one to resolve:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000401cb4 in ispresent (g=0x7fffffffe150, p=...) at map.c:279
279 if (g->ghosts[i].pos.line == p.line && g->ghosts[i].pos.col == p.col) {
(gdb) bt
#0 0x0000000000401cb4 in ispresent (g=0x7fffffffe150, p=...) at map.c:279
#1 0x0000000000401c32 in Ghosts (m=0x7fffffffe190, g=0x7fffffffe150) at map.c:263
#2 0x0000000000401331 in main (argc=1, argv=0x7fffffffe2a8) at pacman.c:137
Have fun!
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
^ More snow today
At least it makes everything look nice.
-H
How on Earth did you cope?
That sounds just awful.
Good thing I didn't add the Humidity at ±85% than. Today's forecast is for 29°C but back to 35° tomorrow. ±25 at the moment and Hum: 64% ( ± = with Heat Index/Feels Like )
How do we cope: Don't go out! (UV at 11) don't move much, wet towels over shoulders, drink water like a fish, keep the blinds down and run three fans - one industrial grade!
Sector11 wrote:ohnonot wrote:here's my strace (compiled with -std=gnu99):
Way over my head ... what's it doing?
We're trying to debug @pingu's pacman game
https://forums.bunsenlabs.org/viewtopic … 168#p16168
OH, I guess I missed that.
To me it kinda looks a little like I took the Blue pill, but things are rotated 90°
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
^ More snow today
At least it makes everything look nice.
-H
Clean snow is beautiful! Now doubt about it ... I usually failed to see the beauty when I was digging out 2 feet worth though.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Saturday morning, the snow is hitting heavy, I've got copious amounts of tea, warm cereal, and this. I want to read, ingest and 'grok' this...
I want to be able to come on here, look at someone's problem, and be able to actually help and contribute..So the admin handbook will be my project for the next few weeks
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
^The DAH is absolutely fantastic but it is very detailed.
You may find the Debian Reference to be a bit more readable and concise:
https://www.debian.org/doc/manuals/debian-reference/
Offline
here's my strace... (compiled with -std=gnu99):
I was thinking it could be because of libncurses 6 vs 5, but you are both using 6, and I'm working with 6 also.
and they all look the same to me
"Chuck Norris can compile syntax errors."
Offline
Saturday morning, the snow is hitting heavy, I've got copious amounts of tea, warm cereal, and this. I want to read, ingest and 'grok' this...
http://s27.postimg.org/amy5xtj8v/24265997540_c88240b074_k.jpg
You sketch a great scenario - all it needs is a logfire to go with it. Sounds lovely!
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
You sketch a great scenario - all it needs is a logfire to go with it. Sounds lovely!
Haha, and if I turn to my right... wallah!
Hehe, it's and electric heater with some fake flame display...but hey, it's keeping me warm!
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
^The DAH is absolutely fantastic but it is very detailed.
You may find the Debian Reference to be a bit more readable and concise:
https://www.debian.org/doc/manuals/debian-reference/
I think I'm going to use both as a reference and take notes from each. You're right, the reference manual is a bit more concise, but so far I like the level of detail the admin book is providing.
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
To me it kinda looks a little like I took the Blue pill, but things are rotated 90°
http://s20.postimg.org/5kyl4wfrd/matrix_2.jpg
it actually is:
void matrixalloc (MAP* m);
void freematrix (MAP* m);
@ohnot and hoas:
our diffs are all very similar (the one on the right is from the one that worked-- exits 1 because i exited with ctrl+c):
mine and ohnot: https://bpaste.net/show/e1f676cc33e6
and hoas https://bpaste.net/show/cb4dd7de7dd7
and the one from the 32bit gentoo that is also segfaulting now.. : https://bpaste.net/show/df7e980e967f
and I already messed with the code some more. it introduced a compile warning that if I get rid of, it segfaults(probably due to me "correcting" it wrongly).. ;
map.c: In function ‘matrixalloc’:
map.c:321:13: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
m->matrix = tmp;
it's in the matrix
edit:
and compiling with both gcc 4.9.9 and 5.3.0 worked (only on my main setup.)
edit2:
just added a "no-color mode" in case that was the problem. but it wasn't..
Last edited by pingu (2016-01-23 19:02:21)
"Chuck Norris can compile syntax errors."
Offline
Trying to get caught up on the goings-on here with a fondleslab at a former roommate's house because my current place lost power last night. We aren't expecting to have power back until Monday.
Be excellent to each other, and...party on, dudes!
BunsenLabs Forum Rules
Tending and defending the Flame since 2009
Offline
map.c: In function ‘matrixalloc’: map.c:321:13: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] m->matrix = tmp;
So i've properly fixed this now.
It turns out m->matrix is of type **char, and tmp was *char, so I changed ti to **char and bingo, that warning was gone(obvisouly :8 ). I was hoping that was the problem but it will still segfault on my other setups.
I also added this to the start of the main file, but I have no idea what I'm doing at this point:
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 20809L
#endif
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE
#endif
#ifndef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#endif
...that got rid of another warning when compiling with -std=c11 about nanosleep not being declared (but it was in the time.h file that was imported)... so I was hoping that would be it. But it also fails on the others. I wonder why it doesn't segfault on this one this one.
Last edited by pingu (2016-01-24 15:57:58)
"Chuck Norris can compile syntax errors."
Offline
finally fixed it with a simple change
https://github.com/genoob/likepacman/co … 57625a1ab0
it turns out that that I just needed to check if the n of elements of the ghosts array was zero instead of checking if the array was NULL. 8)
I wonder what's finding that value in here that was not present in the other systems..
Last edited by pingu (2016-01-24 19:28:09)
"Chuck Norris can compile syntax errors."
Offline