|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64990 Segmentation Fault @ newt_checkbox_tree_add_item
Submitted: 2013-06-07 22:26 UTC Modified: 2013-10-14 12:42 UTC
Avg. Score:4.0 ± 0.9
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:1 (20.0%)
From: recibe_distraction at hotmail dot com Assigned: michael (profile)
Status: Closed Package: newt (PECL)
PHP Version: 5.4.16 OS: Ubuntu 10.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: recibe_distraction at hotmail dot com
New email:
PHP Version: OS:


 [2013-06-07 22:26 UTC] recibe_distraction at hotmail dot com
I like this newt library, although its not documented and no one appears to use 
it. Would like to use it. But then again, I'd like a lot of things. 

Test script:
newt_init ();
newt_cls ();

$rows = 70;
$cols = 25;

newt_open_window ($rows/2-17, $cols/2-10, 34, 17, "Don't be a Tool");

$form = newt_form ();

$checkbox = newt_checkbox_tree(3, 2, 20,NEWT_CHECKBOXTREE_EXPANDED);
$arr = array(
        "Authentication configuration",
        "Firewall configuration",
        "Mouse configuration",
        "Network configuration",
        "Printer configuration",
        "System services");

foreach($arr as $key=>$l_item);
    newt_checkbox_tree_add_item($checkbox, $l_item,'',NEWT_CHECKBOXTREE_UNSELECTED,$key);

newt_form_add_component ($form, $checkbox);
newt_refresh ();

$b1 = newt_button (5, 12, "Run Tool");
$b2 = newt_button (21, 12, "Quit");

newt_form_add_components ($form, array($b1, $b2));

newt_refresh ();
newt_run_form ($form);

newt_pop_window ();
newt_pop_help_line ();
newt_finished ();

newt_form_destroy ($form);

Expected result:
Expect script to render checkbox_tree via continuing with the following code:

Actual result:
Throws a segmentation fault prior to exit.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-08 18:51 UTC] recibe_distraction at hotmail dot com
-Summary: Segmentation Fault +Summary: Segmentation Fault @ newt_checkbox_tree_add_item
 [2013-06-08 18:51 UTC] recibe_distraction at hotmail dot com
The error takes place when using newt_checkbox_tree_add_item
 [2013-08-23 21:45 UTC] a at b dot com
Same problem. Would be nice if someone fixed this.
 [2013-10-13 15:37 UTC]
Automatic comment from SVN on behalf of remi
Log: Fix bug #64990 Segmentation Fault @ newt_checkbox_tree_add_item
 [2013-10-13 15:39 UTC]
The last option of   newt_checkbox_tree_add_item MUST be NEWT_ARG_LAST.

Despite, this should not raise a segfault.

Can you try from SVN ? Commit 331797 should avoid this.
 [2013-10-14 12:42 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: michael
 [2013-10-14 12:42 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Remi, I've verified your fix. Thanks!
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Dec 02 22:01:23 2020 UTC