From: Arjen M. <Arj...@de...> - 2018-01-05 13:38:55
|
Hi Alan, The crash I reported before occurs somewhere between the call to interface_plparseopts(...) and max_cstring_length: $ ./x01f -dev wingcc pl_parse_dynamic = T argv before call to plparseopts(..., PL_PARSE_SKIP) i = 0, argument = ./x01f i = 1, argument = -dev i = 2, argument = wingcc In plparse_opts_dynamic After character_array_to_c After interface_plparseopts Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: That limits the possibilities considerably ;). I have narrowed it further to the call of max_cstring_length, but of course this is merely the location where it is noted something is wrong, not necessarily the cause. Regards, Arjen From: Arjen Markus Sent: Friday, January 05, 2018 9:10 AM To: 'Alan W. Irwin' Cc: PLplot development list Subject: RE: Command-line parsing improvements for both C and Fortran Hi Alan, > -----Original Message----- > From: Alan W. Irwin [mailto:ir...@be...] > Furthermore, I would appreciate you following the parsing testing advice in > README.release section 2.7.2 to discover which parts of this API work for gfortran > with version > 4.9.2 (e.g., for your Cygwin and MinGW-w64/MSYS2 platforms) as > well as the ifort compiler you have access to (and possibly the nagfor compiler you > have arranged access to in the past). > > By the way, I am not sure of the correct terminology for character arrays that have > both length and size allocated. I refer to them above as "dynamic length and size", > but I have also seen the term "deferred-length" used for character strings with > allocated length. > I did the tests yesterday and found quite some problems with the dynamic case, but also with the C example. First the C example: "x01c -dev wingcc" complains that I did not give the value for the -dev option. If I give other options like "a b c", I get complaints that these are unknown. If I run "x02c -dev wingcc", all works as usual. $ ./x01c -dev wingcc Argument missing for -dev option. Usage: ./x01c [options] x01c options: [-pl_parse_skip] [-locate] [-xor] [-font number] [-save filename] PLplot options: ... Then the Fortran example: - With the static-character-length, allocatable array option, all works, also for the static-character-length, fixed-size array option. Surprisingly, I can specify "-dev wingcc" and the window pops up immediately. This is for both gfortran 6.4.0 and Intel Fortran 2015. - However, with both compilers the deferred-character-length, allocatable array option fails miserably. The result is a coredump like the one you have seen with the older version of gfortran. My conclusion therefore is that there is something wrong with the code. I have not been able to figure out yet what is wrong - which part, but I will try to do so today, using a few strategic print statements to at least find the point where things go awry. (A minor pleasant surprise is that maybe after correction the code will work for gfortran 4.x as well.) Regards, Arjen DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail. |