[Rtk-users] rtkMacro.h GGO issue

Simon Rit simon.rit at creatis.insa-lyon.fr
Thu Feb 5 15:17:34 CET 2015


Indeed, it looks as if I had not tested it, I thought I had... This patch
<https://github.com/SimonRit/RTK/commit/d1450e8946414072f65f2a6f71007193459577de>
should fix it.
Thanks for the report!
Simon

On Thu, Feb 5, 2015 at 12:44 PM, Chao Wu <wuchao04 at gmail.com> wrote:

> Hi Simon,
>
> There is still an issue with gengetopt. The config file cannot be read.
> The problem seems to be at around line 62 in rtkMacro.h:
>     char *configFile = args_info.config_arg; points configFile to the
> address storing the config file name, but next
>     cmdline_parser_##ggo_filename##_free(&args_info); frees all string
> field of args_info, including args_info.config_arg, therefore the
> content pointed by configFile becomes invalid.
>
> Regards,
> Chao
>
> 2014-12-12 14:10 GMT+01:00 Simon Rit <simon.rit at creatis.insa-lyon.fr>:
> > My fix did not work. Cyril (Mory) reported that multiple options were
> read
> > twice. I hope this new fix will work but don't hesitate to report other
> > issues with gengetopt.
> > Thanks again for you reports,
> > Simon
> >
> > On Wed, Dec 10, 2014 at 9:27 PM, Steven Pollmann <spollmann at robarts.ca>
> > wrote:
> >>
> >> That makes sense, thanks for the quick usage explanation, and fix.
> >> (Disabling the override issue makes sense, and I didn't have time to
> trace
> >> through gengetopt.  I thought I was missing something, as none of the
> >> non-flag arguments were being reset (to null, or default values, and
> thus
> >> thought 'override' meant something else!).
> >>
> >> Thanks again, glad the info was helpful.
> >>
> >> Steve
> >>
> >>
> >> On 14-12-10 4:01 AM, Simon Rit wrote:
> >>
> >> Hi,
> >> Thanks for the report, very useful information. I could reproduce the
> bug
> >> and I hope that I have fixed it. Briefly:
> >> - I have changed the code because Ben Champion reported memory leaks
> and I
> >> noticed that they occured in deprecated functions of gengetopt that I
> don't
> >> use anymore,
> >> - the way the new macro (as well as the previous one) is written is:
> first
> >> read the command line to find if a config file is passed, then read the
> >> config file and finally read the command line again to check that
> everything
> >> has been passed.
> >> - your fix was not perfect because we would not have checked that the
> >> required options were set,
> >> - it turns out that disabling the override option did the job.
> >> Everything sworks fine now but let met know if you notice something
> wrong
> >> again. Thanks again,
> >> Simon
> >>
> >> On Wed, Dec 10, 2014 at 1:39 AM, Steven Pollmann <spollmann at robarts.ca>
> >> wrote:
> >>>
> >>> A recent update to rtkMacro.h seems to have caused the ggo command line
> >>> processor to ignore command line flags. (i.e. I can't get any verbose
> output
> >>> with '-v').
> >>> It seems to happen after making a second call to:
> >>>
> >>> cmdline_parser_##ggo_filename##_ext(argc, argv, &args_info,
> &args_params)
> >>>
> >>> Removing this second call, has resolved the issue for me.
> >>> I'm not sure, however, what the intended use of the second call was for
> >>> (it occurs immediately after:
> >>>
> >>> args_params.check_required = 1;
> >>>
> >>> which I feel could just be moved above the first call, as it happens
> >>> regardless, but I may be missing something.
> >>>
> >>> I've attached my quickly modified rtkMacro.h for comparison to the
> latest
> >>> github commit.
> >>>
> >>> Anyhow, hopefully this info is useful, and doesn't only affect me.
> >>>
> >>> Steve
> >>>
> >>> Our system setup:
> >>> -Ubuntu 14.04 x64
> >>> -gcc 4.8.2
> >>> -cuda 6.5
> >>>
> >>>
> >>> _______________________________________________
> >>> Rtk-users mailing list
> >>> Rtk-users at public.kitware.com
> >>> http://public.kitware.com/mailman/listinfo/rtk-users
> >>>
> >>
> >>
> >
> > _______________________________________________
> > Rtk-users mailing list
> > Rtk-users at public.kitware.com
> > http://public.kitware.com/mailman/listinfo/rtk-users
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20150205/879996e7/attachment.htm>


More information about the Rtk-users mailing list