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

 
 

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

Submitter:  Tong Sun <xpt>
Submitted:  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
* Mandatory Fields

Add a New Comment Rich Markup
   

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:

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

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code