Morten Werner Forsbring wrote:
> Mark Burgess <[EMAIL PROTECTED]> writes:
> 
>> Pardon me for saying so, but one recalls the story of the patient
>> visiting the doctor: "Doctor, doctor, it hurts when I do this."
>>
>> To which the answer is "Then don't do that!"
> 
> I don't agree with your comparison here, but ok. In my opinion a
> program shouldn't _segfault_ just if it's called with more than 31
> arguments.
> 

This is probably true, but the case cited in the mail is not a
limitation of cfengine but the argument "getopt" code in the operating
system concerned. It is normal that Unix limits to 31 args, and
internally cfengine does the same for consistency.

The conclusion is that, while I agree there should be no segfault, I
am not sure what I can do about it, since there is no code in cfengine
that lead to this fault.

As you see:

(gdb) run -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a
-a -a -a -a -a -a -a  -a -a -a -a
Starting program: /home/mark/LapTop/GNU-cfengine/trunk/src/cfagent -a
-a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a -a
-a -a -a  -a -a -a -a
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1212573488 (LWP 12444)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1212573488 (LWP 12444)]
0xb7c77b34 in _getopt_internal_r () from /lib/libc.so.6
(gdb) back
#0  0xb7c77b34 in _getopt_internal_r () from /lib/libc.so.6
#1  0xb7c78721 in _getopt_internal () from /lib/libc.so.6
#2  0xb7c788d1 in getopt_long () from /lib/libc.so.6
#3  0x0804b4cf in CheckOpts (argc=32, argv=0xbf9926f0) at cfagent.c:1693
#4  0x0804ec3b in Initialize (argc=32, argv=0xbf9928a4) at cfagent.c:379
#5  0x0804edad in main (argc=Cannot access memory at address 0x1f



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to