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

 
 

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

Submitted by:  Michel Boaventura <michelboaventura>
Submitted on:  Wed 25 Feb 2009 09:05:52 PM UTC  
 
Category: Graphical User InterfaceSeverity: 5 - Average
Status: FixedAssigned to: None
Open/Closed: ClosedRelease: None
Effort: 0.00

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project 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>
Project Member

 

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

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 02 Mar 2009 10:50:09 AM UTCjmdStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 25 Feb 2009 09:52:56 PM UTCjmdCategoryNone=>Graphical User Interface

    Back to the top


    Powered by Savane 3.1-cleanup1