hercules-390 / hyperion

Hercules 390
Other
252 stars 68 forks source link

Unhelpful error message HHC02343S Terminating due to 1 argument errors #111

Closed jphartmann closed 8 years ago

jphartmann commented 8 years ago

If Hercules takes a dislike to the command switches, it issues message 1407 and then the subject message.

WIBNI it told you what it is that it doesn't like?

ivan-w commented 8 years ago

The reason why process_args() indicates an error should be indicated PRIOR to errmsg 2343.

I'm still very confused with error messages in hercules (having to format an error message in a .h file and then put the arguments - I find counter intuitive and counter productive - although I understand the idea of a central error message repository).

However looking at the source - this only happen if issuing :

hercules - hercules -h

All other cases DO issue their own error messages (from reading the source) as to why the arguments are not valid.

Any indication when 2343 is being issued without prior indication as to the invalid argument ?

jphartmann commented 8 years ago

According to set +x the command that is issued is:

+ ./hercules -p ./.libs/ -f ../hyperion/tests/tests.conf -r allTests.testin -t -d

Having the error messages a strings means that they are validated by gcc for printf compatibility between arguments and message string.

jphartmann commented 8 years ago
[/usr/data/src/hercules/atom] ./hercules -p ./.libs/
HHC01414S 
HHC01407S Usage: lt-hercules [-f config-filename] [-r rcfile-name] [-d] [-b logo-filename] [-s sym=val] [-t [factor]] [-p dyn-load-dir] [[-l dynmod-to-load]...] [> logfile]
HHC01414S 
HHC02343S Terminating due to 1 argument errors
[/usr/data/src/hercules/atom] ls -ld .libs
drwxrwxr-x 2 john john 12288 May 12 11:42 .libs

The trouble seems to be with the -p flag. I can do -d and -f without error.

ivan-w commented 8 years ago

Looking at it, there seems to be an issue with message 1414 ;)

I admit I've never used any of these flags (especially NOT the -p flag - I'm more happy with an automated out of source build and install).

Still I'll look into it.

--Ivan

ivan-w commented 8 years ago

Apparently an issue at around line 1319 of impl.c which processes the -p flag - and indicates an error without any error message.

jphartmann commented 8 years ago

yes, line 1319 does not test the return value from hdl_setpath correctly. Fixed and committed.

Seems msg 1414 is deliberate

impl.c:1426:        WRMSG (HHC01414, "S", "");   // (blank line)
impl.c:1428:        WRMSG (HHC01414, "S", "");   // (blank line)
ivan-w commented 8 years ago

You beat me to it !