After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 93806 - Script-Fu args parsing needs to be made sane
Script-Fu args parsing needs to be made sane
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Script-Fu
1.x
Other All
: Normal normal
: 2.2
Assigned To: Nathan Summers
Nathan Summers
Depends on:
Blocks:
 
 
Reported: 2002-09-20 23:34 UTC by Nathan Summers
Modified: 2004-10-24 20:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Nathan Summers 2002-09-20 23:34:09 UTC
type the following into the console: (without line breaks, of course)

(let ((foo (array-cons 1)))
 (gimp-parasite-attach '("bar" 0 foo)))

Instant segfault.  This is incorrect code, but should just cause an error 
message, not a segfault.  The correct code,

(let ((foo (array-cons 1)))
 (gimp-parasite-attach (list "bar" 0 foo)))

works correctly
Comment 1 Michael Schumacher 2002-10-22 01:00:34 UTC
WinGimp 1.2.4 on Win98:

ERROR: unbound variable (errobj array-cons)
Comment 2 Nathan Summers 2002-10-22 01:20:58 UTC
oops, (array-cons 1) should be (cons-array 1 'byte)
Comment 3 Alan Horkan 2003-07-23 18:37:32 UTC
Changes at the request of Dave Neary on the developer mailing list.  
I am changing many of the bugzilla reports that have not specified a target
milestone to Future milestone.  Hope that is acceptable.  
Comment 4 Nathan Summers 2003-07-23 19:37:23 UTC
This is an easy fix, and crashing on bad arguments is definately 
ungood.  Resetting to 1.3.
Comment 5 Dave Neary 2003-07-24 19:42:49 UTC
So that we avoid people confusing this for a feature request or a
blocker bug, I'm setting this to 2.0. 

Dave.
Comment 6 Dave Neary 2003-10-04 17:34:17 UTC
Nathan, you've said this is an easy fix. Could you outline what you
think needs doing? I don't know scheme or script-fu, so I didn't even
notice that your script was bad :)

Dave.
Comment 7 Nathan Summers 2003-10-04 21:01:37 UTC
mmmm, don't have easy access to the code this instance, but the 
minimum that needs to be done is check for null at the place where 
it crashes.  Of course it would be better to print that you need an 
array instead of a symbol there.
Comment 8 Sven Neumann 2004-01-12 09:57:45 UTC
Definitely not as easy as Nathan outlined. I've attached gdb to
Script-Fu but I don't get a useable stack trace so I have no idea
where to look for the problem.
Comment 9 Manish Singh 2004-01-28 08:33:33 UTC
2004-01-28  Manish Singh  <yosh@gimp.org>
                                                                     
          
        * plug-ins/script-fu/siod-wrapper.c (marshall_proc_db_call):
validate
        the types of the individual list members when passing parasites.
        Fixes #93806.
Comment 10 Manish Singh 2004-01-28 09:01:20 UTC
Well, the original bug is fixed, but while looking at the code, it's
pretty clear that there are other places this could happen (though not
all would cause a crash).

Also, there are places (like the INT16ARRAY bits) which mix sized
pointers and longs, which won't result in correct interpretation, but
shouldn't cause crashes.

Changing description accordingly.
Comment 11 Kevin Cozens 2004-02-08 03:43:10 UTC
I'm looking at some Script-Fu issues and would like to know what
change was made so it can be fixed for the 2.0 GIMP but someone forgot
to attach the patch here.
Comment 12 Manish Singh 2004-02-08 08:22:05 UTC
The patch is in 2.0 only. 1.2.x is pretty much unmaintained, and has
been for some time.
Comment 13 Dave Neary 2004-03-10 10:48:47 UTC
Bumping a bunch of bugs which won't block the 2.0 release to 2.0.1.

Dave.
Comment 14 Sven Neumann 2004-04-04 12:06:18 UTC
Is anyone working on this for the 2.0 branch? Otherwise I'd say we bump it to
the 2.2 milestone.
Comment 15 Sven Neumann 2004-04-05 10:32:01 UTC
Bumping to 2.2. This shouldn't keep anyone from trying to fix it in the 2.0 branch.
Comment 16 Nathan Summers 2004-04-05 21:26:53 UTC
We should try to fix anything that could cause a crash in the 2.0 branch as
well.  Stability is cool.
Comment 17 Kevin Cozens 2004-09-10 01:08:39 UTC
I have tried this again in both GIMP 2.0.4 and in the latest CVS GIMP. I am
unable to duplicate the seg fault originally reported. Instead I get the message:
ERROR: Invalid type for argument 1 to gimp_parasite_attach

Unless someone else can duplicate the error this bug report should be closed as
FIXED.
Comment 18 Sven Neumann 2004-09-13 23:20:57 UTC
See comment #10 which claims that there are other places in Script-Fu that need
similar fixes.
Comment 19 Michael Natterer 2004-10-06 19:40:18 UTC
Yosh, you mentioned more critical places. Are they fixes by my
latest array checking changes?
Comment 20 Sven Neumann 2004-10-22 23:06:04 UTC
I'd suggest we close this one as FIXED or can anyone clearly point out a
particular problem that needs fixing still?
Comment 21 Sven Neumann 2004-10-24 20:36:33 UTC
Closing as FIXED. Feel free to reopen or open a new bug report if you can point
out a specific problem.