Map iteration crashes client #79
miguelalbuquerque
started this conversation in
Bugs
Replies: 1 comment 2 replies
-
#foreach causes a buffer overflow if the variable is too large. Best solution is to use #loop instead.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
My map has above 60k rooms.
I'm trying to develop some scripts which need to iterate through all the rooms, but getting a client crash.
To demonstrate, I can do something like the following:
#map read
#map goto
#map list {variable} {maplist}
#foreach {*maplist[]}{temp} {#nop do nothing for now}
The result:
DEBUG_STACK[000] [000] = mainloop()
DEBUG_STACK[001] [000] = process_input(void)
DEBUG_STACK[002] [001] = script_driver(%p,%d,%p)
DEBUG_STACK[003] [001] = sub_arg_in_braces(%p,%p,%p,%d,%d)
DEBUG_STACK[004] [002] = substitute(%p,%p,%p,%d)
DEBUG_STACK[005] [005] = substitute(%p,%p,%p,%d)
FATAL ERROR trap_handler (signal 11: Segmentation fault)
syserr_fatal(crashed)
If I change the index to be restricted to, for example only 1000 rooms, there is no crash.
Is this due to the size of the map?
I've tried in my desktop (wintin) and in iSH (ipad), same result.
Thanks for any hint.
Beta Was this translation helpful? Give feedback.
All reactions