discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why does this crash?


From: Kim Shrier
Subject: Re: why does this crash?
Date: Fri, 31 May 2002 11:00:30 -0500

>From what you have included in your email, it looks like the variable
string_ has a value but it is not a pointer to an object instance.

Kim

David Wetzel wrote:
> 
> Hi folks,
> 
> maybe I am too tired to see the problem...
> 
>   if (string_)
>     {
>       NSData* newData=nil;
>       NSString* _string=nil;
>       NSLog(@"DAVE string_ ....");
>       NSLog(@"DAVE string_ %p",string_);
>       if (string_ == EONullNull) {
>       NSLog(@"DAVE string_ is EONullNull");
>       }
>       NSLog(@"DAVE string_ 1");
> 
>       NSLog(@"DAVE string_ class = %@",[string_ class]);
>       _string=[NSString stringWithObject:string_];
> 
> (.....)
> 
> The output is:
> 
> 2002-05-31 13:56:38.124 PDFDemo[8455] File GSWKeyValueAssociation.m: 73. In 
> [GSWKeyValueAssociation -valueInObject:] retValue=(nil) () (class=(nil))
> 2002-05-31 13:56:38.124 PDFDemo[8455] DAVE string_ ....
> 2002-05-31 13:56:38.124 PDFDemo[8455] DAVE string_ 0x481714d0
> 2002-05-31 13:56:38.124 PDFDemo[8455] DAVE string_ 1
> (no debugging symbols found)...
> Program received signal SIGSEGV, Segmentation fault.
> 0x8053a01 in objc_msg_lookup ()
> (gdb)
> (gdb) bt
> #0  0x8053a01 in objc_msg_lookup ()
> #1  0x481708e2 in _i_GSWResponse_GSWContentConveniences_appendContentString_ 
> ()
> #2  0x481712a4 in _i_GSWResponse_GSWHTMLConveniences_appendContentHTMLString_
>     ()
> #3  0x481ba8a4 in _i_GSWText_GSWTextA_appendToResponse_inContext_ ()
> #4  0x481cd36e in 
> _i_GSWHTMLStaticElement_GSWHTMLStaticElementA_appendToResponse_inContext_elementsFromIndex_toIndex_
>  ()
> 
> for those who don't have GSWeb:
> 
> @implementation NSString (stringWithObject)
> 
> //--------------------------------------------------------------------
> +(NSString*)stringWithObject:(id)object_
> {
>   NSString* _string=nil;
>   if (object_)
>         {
>           if ([object_ isKindOfClass:[NSString class]])
>                 _string=[[object_ copy] autorelease];
> #ifdef GDL2
>           else if ([object_ isKindOfClass:[EONull class]])
>                 _string=@"";
> #else
>           else if ([object_ isKindOfClass:[NSNull class]])
>                 _string=@"";
> #endif
>           else if ([object_ respondsToSelector:@selector(stringValue)])
>                 _string=[object_ stringValue];
>           else if ([object_ respondsToSelector:@selector(description)])
>                 _string=[object_ description];
>           else
>                 _string=object_;
>         };
>   return _string;
> };
> @end
> 
> Any ideas?
> 
> ---
>    _  _
>  _(_)(_)_  David Wetzel, Turbocat's Development,
> (_) __ (_) Buchhorster Strasse 23, D-16567 Muehlenbeck/Berlin, FRG,
>   _/  \_   Fax +49 33056 82835 Phone +49 33056 82834
>  (______)  http://www.turbocat.de/  dave@turbocat.de
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep

-- 
 Kim Shrier - principal, Shrier and Deihl - mailto:kim@tinker.com
Remote Unix Network Admin, Security, Internet Software Development
  Tinker Internet Services - Superior FreeBSD-based Web Hosting
                     http://www.tinker.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]