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

Crashbug in store_mail() #93

Closed
luciensadi opened this issue Jun 29, 2017 · 3 comments
Closed

Crashbug in store_mail() #93

luciensadi opened this issue Jun 29, 2017 · 3 comments
Labels
bug crashbug Bugs that cause the game to stop working.

Comments

@luciensadi
Copy link
Owner

luciensadi commented Jun 29, 2017

This is old Circle code, and I can't figure out why it's crashing. I suspect it has something to do with memory sizes for various constructs varying based on your compiler.

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
Assertion failed: (sizeof(header_block_type) == BLOCK_SIZE), function store_mail, file mail.cpp, line 213.
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fffe3077d42 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fffe3165457 pthread_kill + 90
2   libsystem_c.dylib             	0x00007fffe2fdd420 abort + 129
3   libsystem_c.dylib             	0x00007fffe2fa4893 __assert_rtn + 320
4   awake                         	0x0000000100576026 store_mail(long, long, char*) + 150
5   awake                         	0x000000010056fb43 point_update() + 5683 (limits.cpp:717)
6   awake                         	0x00000001004e3b12 game_loop(int) + 3810 (comm.cpp:776)
7   awake                         	0x00000001004e17f1 init_game(int) + 145 (comm.cpp:363)
8   awake                         	0x00000001004e170e main + 782 (comm.cpp:239)
9   libdyld.dylib                 	0x00007fffe2f49235 start + 1
@luciensadi luciensadi added the bug label Jun 29, 2017
@luciensadi
Copy link
Owner Author

Crash is also difficult to reproduce-- I haven't seen it at all today. Will leave this issue open.

@luciensadi luciensadi added the crashbug Bugs that cause the game to stop working. label Nov 3, 2018
@luciensadi
Copy link
Owner Author

It happened again, this time we have a stack trace.

awake: mail.cpp:213: void store_mail(long int, long int, char*): Assertion `sizeof(header_block_type) == BLOCK_SIZE' failed.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff6636801 in __GI_abort () at abort.c:79
#2  0x00007ffff662639a in __assert_fail_base (fmt=0x7ffff67ad7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x555555767408 "sizeof(header_block_type) == BLOCK_SIZE", file=file@entry=0x5555557673fa "mail.cpp", line=line@entry=213, function=function@entry=0x555555767700 <store_mail(long, long, char*)::__PRETTY_FUNCTION__> "void store_mail(long int, long int, char*)") at assert.c:92
#3  0x00007ffff6626412 in __GI___assert_fail (assertion=0x555555767408 "sizeof(header_block_type) == BLOCK_SIZE", file=0x5555557673fa "mail.cpp", line=213, function=0x555555767700 <store_mail(long, long, char*)::__PRETTY_FUNCTION__> "void store_mail(long int, long int, char*)") at assert.c:101
#4  0x00005555555e252d in store_mail (to=16, from=2, message_pointer=0x555555a00600 <buf2> "A Novatech Slimcase-10 clone has arrived at Unnamed Shop and is ready for pickup.\r\n") at mail.cpp:213
#5  0x000055555569f384 in point_update () at limits.cpp:716
#6  0x00005555556e7100 in game_loop (mother_desc=3) at comm.cpp:765
#7  0x00005555556e5f56 in init_game (port=4000) at comm.cpp:364
#8  0x00005555556e59a2 in main (argc=3, argv=0x7fffffffe538) at comm.cpp:240
A debugging session is active.~~~

@luciensadi
Copy link
Owner Author

luciensadi commented May 21, 2019

Update: Looks like the game always crashes when you send mail because of this assertion. It's due to the newer compiler padding the struct to 64-bit boundaries (13x64/8=104) instead of 32-bit boundaries (25x32/8=100).

May 21 13:53:22 :: Sizeof header_block_type 104; data_block_type 104; BLOCK_SIZE = 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug crashbug Bugs that cause the game to stop working.
Projects
None yet
Development

No branches or pull requests

1 participant