bugGNU Gengetopt - Bugs: bug #40370, gengetopt will segmentation fault...

 
 

bug #40370: gengetopt will segmentation fault with the default C example

Submitted by:  Tong Sun <xpt>
Submitted on:  Fri 25 Oct 2013 04:05:40 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 25 Oct 2013 04:08:51 AM UTC, comment #1:

FTR, my vanilla Ubuntu 13.10 is installed via net install, detailed at http://sfxpt.wordpress.com/2013/06/09/get-the-debianubuntu-ready-and-customized-the-way-you-like-in-10-minutes/.

Tong Sun <xpt>
Fri 25 Oct 2013 04:05:40 AM UTC, original submission:

The C example that come with my Debian/Ubuntu package gave me segmentation fault error, after successfully compile into binary.

Here are my steps, will file another bug report after I go home tonight:

Generate:

gengetopt --input=./sample2.ggo --func-name=my_cmdline_parser
--file-name=cmdline2 --unamed-opts --no-handle-help --no-handle-version

Compile:

gcc -DPACKAGE='"cmdline2"' -DVERSION="1.1" -o main2 main2.c cmdline2.c

Run:

$ main2
main2: '--int-opt' ('-i') option required
main2: '--long-opt' ('-l') option required

$ main2 -i 3 -l 5

$ main2 -h
This is a simple test for gengetopt
Segmentation fault
^^^^^^^^^^^^^^^^^

More details at http://lists.gnu.org/archive/html/help-gengetopt/2013-10/msg00007.html

My OS is Ubuntu 13.10, with the vanilla official kernel:

NAME="Ubuntu"
VERSION="13.10, Saucy Salamander"

$ cat /proc/version
Linux version 3.9.0-1-generic (address@hidden) (gcc version 4.8.0 (Ubuntu
4.8.0-6ubuntu1) ) #5-Ubuntu SMP Wed May 8 20:52:54 UTC 2013

$ uname -rsm
Linux 3.9.0-1-generic i686

$ apt-cache policy gcc
gcc:
Installed: 4:4.8.0-0ubuntu13
Candidate: 4:4.8.1-2ubuntu3
Version table:
4:4.8.1-2ubuntu3 0
500 http://us.archive.ubuntu.com/ubuntu/ saucy/main i386 Packages

      • 4:4.8.0-0ubuntu13 0

100 /var/lib/dpkg/status

Tong Sun <xpt>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by xpt (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup