Re: Bus error -- some education sought

2002-04-28 Thread Edward Moy

On Sunday, April 28, 2002, at 07:12 AM, Puneet Kishor wrote:

> I am developing a web application, and have started encountering a new 
> error (taken from the error_log)...
>
> [Sun Apr 28 08:50:40 2002] [error] (22)Invalid argument: getsockname
> [Sun Apr 28 08:50:40 2002] [notice] child pid 493 exit signal Bus error 
> (10)
> [Sun Apr 28 08:50:40 2002] [notice] child pid 482 exit signal Bus error 
> (10)
>
>
> If I run the script from the command line I get the same, cryptic "Bus 
> error" on the terminal. A little bit of research reveals that the error 
> is probably because Perl tried to clear a memory pointer that doesn't 
> exist any more. When I delve into the module I am using for my scripts, 
> that indeed seems to be the case... the croaking seems to happen when 
> the module tries to destroy an existing hash... specifically at...
>
> sub DESTROY {
> my $self = tied(%{$_[0]});
> delete $ITERATORS{$self};
> if (exists $OWNER{$self}) {
> mapscriptc::delete_mapObj($self);
> delete $OWNER{$self};
> }
> }
>
> In any case, here are my questions --
>
> 1. am I right about my assumption about failure to clear a memory 
> pointer?
> 2. that the above error is new to me means that this is a problem 
> specific to the module I am using, and not some new gremlin I have 
> exposed in my iBook or the "Perl on MacOS X" implementation?

I've seen the bus error problem a lot myself, and after trying to 
workaround the problem, occurring even in standard packages, I concluded 
that it is a real bug in Perl 5.6.0, the default version that comes with 
Mac OS X.  Upgrading to 5.6.1 solved the bus error problems for me.
--
Edward Moy
Apple Computer, Inc.
[EMAIL PROTECTED]

(This message is from me as a reader of this list, and not a statement
from Apple.)




Re: puzzling results from missing she-bang

2002-04-28 Thread Peter N Lewis

At 22:09 -0400 28/4/02, Michael  Turner wrote:

>Thanks for your response. I remain puzzled, however. Your response 
>seems to imply that if I invoke "print" from the command line, it 
>will be interepreted. This is not the case, it errors.

Sure it will - if you are using the sh shell.  Try this:

zany:~/unix/avr/avr/include% sh
zany% print "hello";
hello
zany% exit
zany:~/unix/avr/avr/include%

(ie, type: shprint "hello";)

Enjoy,
Peter.

-- 
  



Re: puzzling results from missing she-bang

2002-04-28 Thread Michael Turner

>>
>> Note the missing "she-bang" line: #!/usr/bin/perl -w   Note also that I
>> didn't tell the shell "how" to execute the file. So the file is set to
>> executable, but I thought it should error. Is that line not necessary 
>> on
>> a Mac for some reason? How is this a Mac thing? It is not functional on
>> other unix  machines I have access to (and I tried various shells,
>> including tcsh & bash). I repeated the experiment with no ".pl"
>> extension, that isn't it.
>>
>> I suspect that it is a shell issue of some kind.
>>
>> /Michael Turner
>>
>
> Not an issue. No shebang line means that 'exec(2)' will invoke your 
> standard
> shell on it. 'print' is defined in some 'bash' or 'ksh' environments, 
> or you
> may have such an alias or local program.
>

Bob,

Thanks for your response. I remain puzzled, however. Your response seems 
to imply that if I invoke "print" from the command line, it will be 
interepreted. This is not the case, it errors.

/Michael Turner





Re: Getting the path of a running process from OS X Perl

2002-04-28 Thread Ken Williams


On Monday, April 29, 2002, at 07:26 AM, Arshad Tayyeb wrote:
> I'm trying to discover the path of a running process 
> (Codewarrior IDE 7.2), and save it in a perl variable, so I 
> will know where the application is located later.  (This way I 
> will know where to launch it from if it is quit).
>
> The only way I can think of doing this is by executing a ps 
> command, and parsing the output.  However, there are some odd 
> artifacts in the output.
>
> [...]
>
> Does anyone know a better way to glean this information?

Perhaps you don't need to.  Maybe you could just use the "open" 
command in the shell (see "man open") to open it without a 
path.  You can do things like this:

   open -a com.barebones.bbedit file.txt

That will find BBEdit, wherever it is, and launch it.

A potential snafu is that it seems to require a file to open, 
you can't just launch the application by itself.  Anyone know a 
way around this?


  -Ken




Getting the path of a running process from OS X Perl

2002-04-28 Thread Arshad Tayyeb

I'm trying to discover the path of a running process (Codewarrior IDE 
7.2), and save it in a perl variable, so I will know where the 
application is located later.  (This way I will know where to launch it 
from if it is quit).

The only way I can think of doing this is by executing a ps command, and 
parsing the output.  However, there are some odd artifacts in the output.

If I run

ps -wwxocommand

I get, as part of the output:


/Volumes/CW 7.2 build tools/CodeWarrior 7.2/Metrowerks CodeWarrior/CodeWarrior IDE 
4.2.6 /Volumes/CW 7.2 build tools/CodeWarrior 7.2/Metrowerks CodeWarrior/CodeWarrior 
IDE 4.2.6 -psn_0_6684673

This is partialy correct, but I do not understand why the command path 
is repeated twice.  

Does anyone understand this output?

Does anyone know a better way to glean this information?


Thanks,

-Arshad




Re: Bus error -- some education sought

2002-04-28 Thread David Wheeler

On 4/28/02 7:12 AM, "Puneet Kishor" <[EMAIL PROTECTED]> claimed:

> If I run the script from the command line I get the same, cryptic "Bus
> error" on the terminal. A little bit of research reveals that the error
> is probably because Perl tried to clear a memory pointer that doesn't
> exist any more. When I delve into the module I am using for my scripts,
> that indeed seems to be the case... the croaking seems to happen when
> the module tries to destroy an existing hash... specifically at...
> 
> sub DESTROY {
>my $self = tied(%{$_[0]});
>delete $ITERATORS{$self};
>if (exists $OWNER{$self}) {
>mapscriptc::delete_mapObj($self);
>delete $OWNER{$self};
>}
> }
> 
> In any case, here are my questions --
> 
> 1. am I right about my assumption about failure to clear a memory
> pointer?

I don't know.

> 2. that the above error is new to me means that this is a problem
> specific to the module I am using, and not some new gremlin I have
> exposed in my iBook or the "Perl on MacOS X" implementation?

I think that it may be Mac OS X related, because I've run into it, too, but
couldn't nail it down. What I did find was that if I ran the script that
triggered the bus error in MallocDebug, the bus error never occurred!

But if you can write a short test script that demonstrates the error
happening every time, it'd be worth sending in via perlbug. If you post it
here, we can also test it on our OS X and other systems, too.

David

-- 
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/  Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]





Bus error -- some education sought

2002-04-28 Thread Puneet Kishor

I am developing a web application, and have started encountering a new 
error (taken from the error_log)...

[Sun Apr 28 08:50:40 2002] [error] (22)Invalid argument: getsockname
[Sun Apr 28 08:50:40 2002] [notice] child pid 493 exit signal Bus error 
(10)
[Sun Apr 28 08:50:40 2002] [notice] child pid 482 exit signal Bus error 
(10)


If I run the script from the command line I get the same, cryptic "Bus 
error" on the terminal. A little bit of research reveals that the error 
is probably because Perl tried to clear a memory pointer that doesn't 
exist any more. When I delve into the module I am using for my scripts, 
that indeed seems to be the case... the croaking seems to happen when 
the module tries to destroy an existing hash... specifically at...

sub DESTROY {
 my $self = tied(%{$_[0]});
 delete $ITERATORS{$self};
 if (exists $OWNER{$self}) {
 mapscriptc::delete_mapObj($self);
 delete $OWNER{$self};
 }
}

In any case, here are my questions --

1. am I right about my assumption about failure to clear a memory 
pointer?
2. that the above error is new to me means that this is a problem 
specific to the module I am using, and not some new gremlin I have 
exposed in my iBook or the "Perl on MacOS X" implementation?

Many tia,

pk/




Re: [OT] portsentry

2002-04-28 Thread Bill -OSX- Jones

NM:

http://www3.sympatico.ca/dccote/firewall.html

-Sx- :]

>
> using it?  Also, anyone have a good MacOS X firewall resource?  I
> have already seen the man page for ipfw but was hoping to find
>

_Sx
  ('>-Sx- IUDICIUM
  //\   Have Computer -
  v_/_Will Hack...