help-gengetopt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-gengetopt] make cmd_line_list and cmd_line_list_tmp static?


From: Lorenzo Bettini
Subject: Re: [help-gengetopt] make cmd_line_list and cmd_line_list_tmp static?
Date: Sun, 07 May 2006 12:41:22 +0200
User-agent: Thunderbird 1.5.0.2 (X11/20060501)

Andre Noll wrote:
Here's how to reproduce the problem:

<snip>

thanks I'll try to check this


If the problem still exists I see no other solution than to pass to getopt_long ONLY static memory (of course this would be handled entirely within the code generated by gengetopt thus it would be transparent to the user).

This solves the memory corruption issue, but I think it will still
lead to unexpected behaviour as the second call to getopt() depends

I don't think so; I get the feeling that unexpected behavior is only due to the fact that getopt accesses memory that does not exist anymore (very odd things usually happen in these cases), while for memory that is still allocated nothing bad should happen... hopefully....

on what happend during the first call. How about coding up an own
version of getopt() with sane semantics?

that would be the other possibility I was thinking of... but I'm quite scared of writing another version of getopt with the same semantics... would you be interested in that?

if we could contact the developers of getopt_long... I didn't find their addresses....


Notice that also the code of the confparser relies on dynamic memory and this problem never showed up... that gives me some hope.

ACK. para_server rereads its config file if it receives SIGHUP and
this works fine for ages.

OK, so the problem is really only on string parsing... this is quite mysterious anyway :-(

cheers
        Lorenzo

--
+-----------------------------------------------------+
|  Lorenzo Bettini          ICQ# lbetto, 16080134     |
|  PhD in Computer Science                            |
|  Dip. Sistemi e Informatica, Univ. di Firenze       |
|  Florence - Italy        (GNU/Linux User # 158233)  |
|  Home Page        : http://www.lorenzobettini.it    |
|  http://music.dsi.unifi.it         XKlaim language  |
|  http://www.purplesucker.com Deep Purple Cover Band |
|  http://www.gnu.org/software/src-highlite           |
|  http://www.gnu.org/software/gengetopt              |
|  http://www.lorenzobettini.it/software/gengen       |
|  http://www.lorenzobettini.it/software/doublecpp    |
+-----------------------------------------------------+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]