fatal SIGSYS under irix

Quinn Dunkan quinn at mono.ugcs.caltech.edu
Thu Mar 2 04:22:54 EST 2000


On Sat, 26 Feb 2000 01:29:56 -0500, Tim Peters <tim_one at email.msn.com> wrote:
>[Quinn Dunkan]
>> % python                                                    ~/tmp
>> quinn at cholera
>> Python 1.5.2 (#10, Feb 11 2000, 15:14:46)  [GCC 2.8.1] on irix6-n32
>> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>> >>> f = open('foo')
>> >>> f.seek(1, -4)
>> zsh: 61898 invalid system call  python
>> 140%
>>
>> Granted, I reversed the order of the arguments for seek().  But
>> killing the interpreter is a bit harsh.  This happens on all
>> irix systems I was able to test.  Linux just ignores the bad
>> SEEK_* arg.
>
>I'd say both OSes are unreasonable here (Irix shouldn't blow up, Linux
>should at least complain).  Under Win95 (dear Lord, how embarrassing for
>Unix <wink>):
> 
> [gee, it works]

Hmm, actually, only the linux I was testing ignored it, my home machine
behaves like Dave's (throws IOError, invalid argument), which is as documented
in the man page (EINVAL).  Actually, just tried a simple fseek.c test on the
lab machine, and fseek(fp, 1, -4) returns 0 and Success in errno.  But that
machine uses glibc2 and my home machine is glibc2.1, so I'll bet it's a bug in
glibc2.

Irix hits the process with SIGSYS, bad system call (for both fseek and
fseek64), which seems like a sane, if harsh, thing to do.  The man page
doesn't mention what happens if you mess up the seek arg, but I guess now we
know.  Maybe posix doesn't specify this, and it's just a difference of opinion
between irix and reasonable people (strange to class windows stdio as
'reasonable'), in which case it's python's job to catch it.

>Python generally doesn't try to validate arguments when using a tissue-thin
>wrapper around a libc function, partly because it seems redundant, partly
>because it doesn't want to prevent you from getting at platform-specific
>extensions.  But if the platform fseek is unreasonable about error-checking
>under several OSes, Guido would probably opt to validate fseek's argument
>himself.

It appears Irix just disagrees about what should be done.  Maybe that means
it's an Irix "extension" that I shouldn't be protected from... but I'd rather
I was :)

>the-python-implementation-would-be-a-lot-simpler-if-oses-worked-ly
>    y'rs  - tim

Let's generalize that: things would be simpler of things worked.



More information about the Python-list mailing list