Issue 96 in teyjus: getenv causes segmentation error instead of failure

1 view
Skip to first unread message

tey...@googlecode.com

unread,
Mar 9, 2015, 12:06:01 PM3/9/15
to teyjus...@googlegroups.com
Status: Accepted
Owner: dale.a.m...@gmail.com

New issue 96 by dale.a.m...@gmail.com: getenv causes segmentation error
instead of failure
https://code.google.com/p/teyjus/issues/detail?id=96

As the following dialog shows, the getenv predicate causes a segmentation
error when the environment variable is not bound. It's probably better to
have this fail instead (or return use an (option string) as the type of its
second argument.

I note that this was also a problem with Teyjus 1.0-b30 (reported back on
23 Oct 2000).


[toplevel] ?- getenv "PATH" P.

The answer substitution:
P
= "/home/dale/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

More solutions (y/n)? y

no (more) solutions

[toplevel] ?- getenv "XYZ" P.
Segmentation fault (core dumped)
dale@dale-Precision-T3610:~/temp$ tjsim -v
Teyjus version 2.0-b2
dale@dale-Precision-T3610:~/temp$

--
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

tey...@googlecode.com

unread,
Mar 10, 2015, 11:44:34 AM3/10/15
to teyjus...@googlegroups.com

Comment #1 on issue 96 by giselle....@gmail.com: getenv causes segmentation
This patch fixes the issue with getenv. Please review and let me know if
further changes are needed.

Best,
Giselle.

Attachments:
fix_getenv.patch 1.7 KB
Reply all
Reply to author
Forward
0 new messages