Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 146 by
alex.tur...@soartech.com: Null Pointer Crash on Invalid
Soar Code
http://code.google.com/p/soar/issues/detail?id=146
The following brief Soar code will crash Soar with a Null Pointer Exception.
...
(<s> ^smem.command.store <store>)
-->
(<s> ^smem.command.store <store> -)
...
This is invalid soar code in that it won't do what you might think it
should, remove the store WM on the smem.command link. Instead since this
is on the RHS and is dot notation, it will expand <s> ^smem.command.store
to:
sp {apply*successful-store
(state <s> ^storage <storage> ^smem <s*1>)
(<s*1> ^command <c*1>)
(<c*1> ^store <store>)
-->
(<s> ^smem <s*2> +)
(<s*2> ^command <c*2> +)
(<c*2> ^store <store> -)
}
And so it will fail in prefmem.cpp:remove_preference_from_tm:373 because
slot* s is NULL and it tries to access the element all_preferences on the
slot pointer. Ideally this should fail more gracefully than crashing Soar
but unfortunately it does.
Attached is Soar code which consistently exposes this issue. Just launch
the Soar Java Debugger and source the file and try to run for an infinite
number of decisions. It will crash on the third decision cycle because of
this issue.
Attachments:
SMemClearResult_SimpleFloat-Bug.soar 884 bytes
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings