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:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Open

Add a New Comment (Rich 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: 
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:


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


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


$ 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:

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
  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 Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

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

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.5