bugPSPP - Bugs: bug #25711, psppire on Windows crashes if...

 
 

bug #25711: psppire on Windows crashes if receive a file name as argument.

Submitter:  Michel Boaventura <michelboaventura>
Submitted:  Wed 25 Feb 2009 09:05:52 PM UTC
   
 
Category:  Graphical User Interface Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 02 Mar 2009 10:50:09 AM UTC, comment #11: 

I believe the ultimate cause of this should now be fixed.

John Darrington <jmd>
Group administrator
Fri 27 Feb 2009 10:04:21 PM UTC, comment #10: 

Thanks for persuing this  Michel.

I guess however that until glib-2.20 is released, this is still going to be a potential problem for pspp. So we should fix any possibly null strings we encouter.

John Darrington <jmd>
Group administrator
Fri 27 Feb 2009 05:11:06 PM UTC, comment #9: 

The trunk version of glib has the patch. I've use it and works.
So I guess that the problem was solved.

Michel Boaventura <michelboaventura>
Group Member
Fri 27 Feb 2009 12:02:18 PM UTC, comment #8: 

The glib team apply a patch who fix this. I guess that in next version it will be avaible.

Michel Boaventura <michelboaventura>
Group Member
Fri 27 Feb 2009 05:23:39 AM UTC, comment #7: 

Fri Feb 27 05:00:59 2009, comment #5:

Seems like gnulib guys already talk about this issue:
http://bugzilla.gnome.org/show_bug.cgi?id=167569

Sorry about that. Those are the GLIB guys, not GNULIB.

Michel Boaventura <michelboaventura>
Group Member
Fri 27 Feb 2009 05:22:40 AM UTC, comment #6: 

Gcc folks also talk about this:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15685

Michel Boaventura <michelboaventura>
Group Member
Fri 27 Feb 2009 05:00:59 AM UTC, comment #5: 

Seems like gnulib guys already talk about this issue:
http://bugzilla.gnome.org/show_bug.cgi?id=167569

Michel Boaventura <michelboaventura>
Group Member
Fri 27 Feb 2009 04:53:31 AM UTC, comment #4: 


>I've always expected printf("%s", NULL) to print the string
>"(null)" but it seems that under Mingw it just crashes....
>Does anyone know what POSIX says about null vs %s ?


The behavior of printf("%s", NULL) is formally undefined.  Many C libraries are kind enough to print something like "(null)" or "(nil)", but they are not obliged to.

Ben Pfaff <blp>
Group administrator
Fri 27 Feb 2009 03:52:31 AM UTC, comment #3: 

I've always expected printf("%s", NULL) to print the string "(null)" but it seems that under Mingw it just crashes.  I'm wondering if we should report this as a bug to glib and/or mingw.

Does anyone know what POSIX says about null vs %s ?

John Darrington <jmd>
Group administrator
Fri 27 Feb 2009 03:37:02 AM UTC, comment #2: 

I finally was able to use gdb to debug psppire under linux. Seems like I've found the problem. Look:

b psppire_window_set_filename
r -q teste.sav

and on psppire-data-window.c:310
gchar *uri = g_filename_to_uri (fine_name,NULL,NULL);

p file_name
$10 = 0x110479 "teste.sav"

p uri
$12 = (gchar *) 0x0

Then, on line 312 I got the first error:
gtk_recent_manager_remove_item(manager,item,NULL);
Gtk-CRITICAL **: gtk_recent_manager_remove_item: assertion 'uri != NULL` failed

This error repeats on line 314, and on line 315 I've got a segfault.
g_warning("Could not add item %s to recent list\n",uri);

Seems like g_warning doesn't like of receive a null string as argument.


Michel Boaventura <michelboaventura>
Group Member
Wed 25 Feb 2009 09:52:56 PM UTC, comment #1: 


> Debuging it I've found that the problem is on gl/argp-parse.c:232:

err = (*group->parser)(key, arg, state);

This should call parse_non_options in psppire.c and from there psppire_data_window_load_file in psppire-data-window.c

Can you try to localise the problem a bit further.

John Darrington <jmd>
Group administrator
Wed 25 Feb 2009 09:05:52 PM UTC, original submission:  

The last master git version crashes if receive a file name as argument. It works if I pass any internal flags, like "-q"
and even if I pass an filename that doesn't exists psppire opens and tells me that those file don't exist. And if I pass any other file, like a txt or a binary, psppire opens and tells me that those file isn't a portable or system file.

But if I pass an existing file it crashes. Debuging it I've found
that the problem is on gl/argp-parse.c:232:
err = (*group->parser)(key, arg, state);

If I comment this line, the program works, but doesn't load the file. Putting this line:
printf("%p,%d,%s,%p\n",*group->parser,key, arg, state);
before the problem line I've got:
00412FCE,0,teste.sav,007AFD40

Michel Boaventura <michelboaventura>
Group Member

 

(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 blp (Posted a comment)
  • -email is unavailable- added by jmd (Posted a comment)
  • -email is unavailable- added by michelboaventura (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.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-03-02 jmd StatusNone Fixed
        Open/ClosedOpen Closed
    2009-02-25 jmd CategoryNone Graphical User Interface

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code