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

handling garbage on stdin #42

Closed
slayoo opened this issue Apr 7, 2018 · 5 comments
Closed

handling garbage on stdin #42

slayoo opened this issue Apr 7, 2018 · 5 comments

Comments

@slayoo
Copy link
Member

slayoo commented Apr 7, 2018

(extracted from ulysss's comments at https://sourceforge.net/p/gnudatalanguage/bugs/711/)

$ echo ugly_test | idl
% Attempt to call undefined procedure/function: 'UGLY_TEST'.
% Execution halted at: $MAIN$  
$ echo ugly_test | gdl
% Procedure not found: UGLY_TEST
% Execution halted at: $MAIN$
terminate called without an active exception
Aborted
@GillesDuvert
Copy link
Contributor

$ echo ugly_test | gdl
% PREF_SET: Unknown preference: IDL_RBUF_SIZE
% PREF_SET: Unknown preference: IDL_MORE
% Procedure not found: UGLY_TEST
% Execution halted at: $MAIN$  
$     

so it's working.

@slayoo
Copy link
Member Author

slayoo commented Apr 10, 2018

(gdb) run < /etc/hostname
Starting program: /usr/bin/gdl < /etc/hostname
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe04dd700 (LWP 9651)]
[Thread 0x7fffe04dd700 (LWP 9651) exited]
% Procedure not found: EYRIE
% Execution halted at: $MAIN$          
[New Thread 0x7fffe04dd700 (LWP 9652)]
[Thread 0x7fffe04dd700 (LWP 9652) exited]
terminate called without an active exception

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.
(gdb) bt
#0  0x00007fffef0c8e7b in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007fffef0ca231 in __GI_abort () at abort.c:79
#2  0x00007fffef91e5a9 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fffef9247fa in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007fffef924855 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff764478c in DInterpreter::NoReadline(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
    at /usr/lib/x86_64-linux-gnu/libgnudatalanguage.so.0
#6  0x00007ffff7644953 in DInterpreter::GetLine[abi:cxx11]() () at /usr/lib/x86_64-linux-gnu/libgnudatalanguage.so.0
#7  0x00007ffff764898b in DInterpreter::ExecuteLine(std::istream*, unsigned long long) () at /usr/lib/x86_64-linux-gnu/libgnudatalanguage.so.0
#8  0x00007ffff764ba3a in DInterpreter::InterpreterLoop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
    at /usr/lib/x86_64-linux-gnu/libgnudatalanguage.so.0
#9  0x000055555555bcb8 in main ()

:(

@slayoo
Copy link
Member Author

slayoo commented Apr 10, 2018

and with debug info:

(gdb) bt
#0  0x00007fffef0c8e7b in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007fffef0ca231 in __GI_abort () at abort.c:79
#2  0x00007fffef91e5a9 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fffef9247fa in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007fffef924855 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff764478c in DInterpreter::NoReadline(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/7/thread:135
#6  0x00007ffff764478c in DInterpreter::NoReadline(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=this@entry=0x7fffffffe060, prompt="GDL> ") at ./src/dinterpreter.cpp:1299
#7  0x00007ffff7644953 in DInterpreter::GetLine[abi:cxx11]() (this=this@entry=0x7fffffffe060) at ./src/dinterpreter.cpp:1365
#8  0x00007ffff764898b in DInterpreter::ExecuteLine(std::istream*, unsigned long long) (this=this@entry=0x7fffffffe060, in=in@entry=0x0, lineOffset=lineOffset@entry=0) at ./src/dinterpreter.cpp:967
#9  0x00007ffff764ba3a in DInterpreter::InterpreterLoop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=0x7fffffffe060, startup="", batch_files=..., statement=...) at ./src/dinterpreter.cpp:1741
#10 0x000055555555bcb8 in main(int, char**) (argc=1, argv=0x7fffffffe388) at ./src/gdl.cpp:414

@slayoo
Copy link
Member Author

slayoo commented Apr 10, 2018

using Debian-packaged 0.9.8 on Debian

@slayoo
Copy link
Member Author

slayoo commented Jun 17, 2018

Indeed with current repo version it works!

$ echo ugly_test |./build/src/gdl
% PRINT: Variable is undefined: UGLY_TEST
% Execution halted at: $MAIN$
$

(0.9.8 on the same machine behaves as reported) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants