Re: tools-windows-msvc runtime error
Frederik Seiffert <[email protected]> Mon, 17 Jul 2023 17:28:55 +0200
| Newsgroups | gmane.comp.lib.gnustep.general,gmane.comp.lib.gnustep.bugs,gmane.comp.lib.gnustep.devel |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_56F14ADE-DC27-4AC3-8A64-AAD4E3FFAEC5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
Can you send the backtrace of the crash ("bt" in LLDB)?
> Am 16.07.2023 um 15:23 schrieb loserist <[email protected]>:
>=20
> Hi all! I seem to have found the problem.the problem is that the =
user-defined class is not working properly, see the following code and =
its output message please.Does anyone know how to fix this?
> #import <Foundation/Foundation.h>
> @interface SayHello : NSObject
> - (void)greet;
> @end
> @implementation SayHello
> - (void)greet {
> NSLog(@"Hello GnuStep");
> }
> @end
> int main(int argc, char *argv[]) {
> NSLog(@"arrayCls =3D %@", objc_getClass("NSArray")); // Yes
> NSLog(@"stringCls =3D %@", objc_getClass("NSString")); // Yes
>=20
> //! NSLog(@"userCls =3D %@", [SayHello class]); -- crash here!
> NSLog(@"userCls =3D %@", objc_getClass("SayHello")); // null
>=20
> NSArray *nameList =3D [NSArray arrayWithObjects:
> @"Scott", @"Jesse", @"Gaia",
> nil
> ];
> NSLog(@"nameList =3D %@", nameList); // good
> NSArray *nameList2 =3D [[NSArray alloc] init];
> NSLog(@"nameList2 =3D %@", nameList2); // Ok
>=20
> SayHello *userObj =3D [[SayHello alloc] init]; // crash here!
> NSLog(@"userObj =3D %@", userObj);
> return 0;
> }
> 2023-07-16 21:02:02.665 abc[2996:4992] arrayCls =3D NSArray
> 2023-07-16 21:02:02.665 abc[2996:4992] stringCls =3D NSString
> 2023-07-16 21:02:02.665 abc[2996:4992] userCls =3D (null)
> 2023-07-16 21:02:02.665 abc[2996:4992] nameList =3D (Scott, Jesse, =
Gaia)
> 2023-07-16 21:02:02.665 abc[2996:4992] nameList2 =3D ()
> Process 2380 stopped
> * thread #1, stop reason =3D Exception 0xc0000005 encountered at =
address 0x7ffb73b91048: Access violation reading locatio
> n 0x00000000
> frame #0: 0x00007ffb73b91048 objc.dll`objc_msgSend + 40
> objc.dll`objc_msgSend:
> -> 0x7ffb73b91048 <+40>: movl (%r10), %r11d
> 0x7ffb73b9104b <+43>: cmpl $0x8, %r11d
> 0x7ffb73b9104f <+47>: je 0x7ffb73b91063 ; <+67>
> 0x7ffb73b91051 <+49>: cmpl $0x0, %r11d
>=20
>=20
> Thank you!
>=20
--Apple-Mail=_56F14ADE-DC27-4AC3-8A64-AAD4E3FFAEC5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=us-ascii
<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dus-ascii"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;"><div>Can you =
send the backtrace of the crash ("bt" in =
LLDB)?</div><br><div><br><blockquote type=3D"cite"><div>Am 16.07.2023 um =
15:23 schrieb loserist <[email protected]>:</div><br =
class=3D"Apple-interchange-newline"><div><blockquote =
class=3D"ReferenceQuote" style=3D"padding:0;margin:0;"><div =
style=3D"margin: 0px;">Hi all! I seem to have found the problem.the =
problem is that the <span style=3D"color: rgb(255, 0, 1)">user-defined =
class</span> is not working properly, see the following code and its =
output message please.Does anyone know how to fix this?</div><table =
style=3D"
border-collapse: collapse;
table-layout: auto;
font-size: inherit;
border: 1px solid #D7D7D7;
overflow: hidden;"><tbody><tr style=3D"border: 1px solid #D7D7D7;"><td =
colspan=3D"1" rowspan=3D"1" data-colwidth=3D"922" style=3D"border-right: =
1px solid #D7D7D7;
border-bottom: 1px solid #D7D7D7;
padding: 3px 8px;
height: 36px;
word-break: break-all;
overflow-wrap: break-word;"><div style=3D"margin: 0px;"><span =
style=3D"font-size: inherit">#import =
<Foundation/Foundation.h></span></div><div style=3D"margin: =
0px;">@interface SayHello : NSObject</div><div style=3D"margin: 0px;">- =
(void)greet;</div><div style=3D"margin: 0px;">@end</div><div =
style=3D"margin: 0px;">@implementation SayHello</div><div style=3D"margin:=
0px;">- (void)greet {</div><div style=3D"margin: 0px;"> =
NSLog(@"Hello GnuStep");</div><div style=3D"margin: 0px;">}</div><div =
style=3D"margin: 0px;">@end</div><div style=3D"margin: 0px;">int =
main(int argc, char *argv[]) {</div><div style=3D"margin: 0px;"> =
NSLog(@"arrayCls =3D %@", objc_getClass("NSArray")); // Yes</div><div =
style=3D"margin: 0px;"> NSLog(@"stringCls =3D %@", =
objc_getClass("NSString")); // Yes</div><div style=3D"margin: =
0px;"><br></div><div style=3D"margin: 0px;"> <span style=3D"color: =
rgb(255, 0, 1)">//! NSLog(@"userCls =3D %@", [SayHello class]); -- crash =
here!</span></div><div style=3D"margin: 0px;"><span style=3D"color: =
rgb(255, 0, 1)"> NSLog(@"userCls =3D %@", =
objc_getClass("SayHello")); // null</span></div><div style=3D"margin: =
0px;"><br></div><div style=3D"margin: 0px;"> NSArray *nameList =3D =
[NSArray arrayWithObjects:</div><div style=3D"margin: 0px;"> =
@"Scott", @"Jesse", @"Gaia", </div><div style=3D"margin: 0px;"> =
nil</div><div style=3D"margin: 0px;"> ];</div><div style=3D"margin: =
0px;"> NSLog(@"nameList =3D %@", nameList); // good</div><div =
style=3D"margin: 0px;"> NSArray *nameList2 =3D [[NSArray alloc] =
init];</div><div style=3D"margin: 0px;"> NSLog(@"nameList2 =3D =
%@", nameList2); // Ok</div><div style=3D"margin: 0px;"><br></div><div =
style=3D"margin: 0px;"> <span style=3D"color: rgb(255, 0, 1)">SayHello =
*userObj =3D [[SayHello alloc] init]; // crash here!</span></div><div =
style=3D"margin: 0px;"> NSLog(@"userObj =3D %@", userObj);</div><p =
style=3D"margin:0;"> </p><div style=3D"margin: 0px;"> return =
0;</div><div style=3D"margin: 0px;">}</div></td></tr><tr style=3D"border: =
1px solid #D7D7D7;"><td colspan=3D"1" rowspan=3D"1" data-colwidth=3D"922" =
style=3D"border-right: 1px solid #D7D7D7;
border-bottom: 1px solid #D7D7D7;
padding: 3px 8px;
height: 36px;
word-break: break-all;
overflow-wrap: break-word;"><div style=3D"margin: 0px;">2023-07-16 =
21:02:02.665 abc[2996:4992] arrayCls =3D NSArray</div><div =
style=3D"margin: 0px;">2023-07-16 21:02:02.665 abc[2996:4992] stringCls =
=3D NSString</div><div style=3D"margin: 0px;">2023-07-16 21:02:02.665 =
abc[2996:4992] userCls =3D (null)</div><div style=3D"margin: =
0px;">2023-07-16 21:02:02.665 abc[2996:4992] nameList =3D (Scott, Jesse, =
Gaia)</div><div style=3D"margin: 0px;">2023-07-16 21:02:02.665 =
abc[2996:4992] nameList2 =3D ()</div></td></tr><tr style=3D"border: 1px =
solid #D7D7D7;"><td colspan=3D"1" rowspan=3D"1" data-colwidth=3D"922" =
style=3D"border-right: 1px solid #D7D7D7;
border-bottom: 1px solid #D7D7D7;
padding: 3px 8px;
height: 36px;
word-break: break-all;
overflow-wrap: break-word;"><div style=3D"margin: 0px;">Process =
2380 stopped</div><div style=3D"margin: 0px;">* thread #1, stop reason =3D=
Exception 0xc0000005 encountered at address 0x7ffb73b91048: Access =
violation reading locatio</div><div style=3D"margin: 0px;">n <span =
style=3D"color: rgb(255, 0, 1)">0x00000000</span></div><div =
style=3D"margin: 0px;"> frame #0: 0x00007ffb73b91048 =
objc.dll`objc_msgSend + 40</div><div style=3D"margin: =
0px;">objc.dll`objc_msgSend:</div><div style=3D"margin: 0px;">-> =
0x7ffb73b91048 <+40>: movl (%r10), %r11d</div><div =
style=3D"margin: 0px;"> 0x7ffb73b9104b <+43>: cmpl $0x8, =
%r11d</div><div style=3D"margin: 0px;"> 0x7ffb73b9104f <+47>: =
je 0x7ffb73b91063 ; <+67></div><div style=3D"margin: =
0px;"> 0x7ffb73b91051 <+49>: cmpl $0x0, %r11d</div><div =
style=3D"margin: =
0px;"><br></div></td></tr></tbody></table></blockquote><blockquote =
class=3D"ReferenceQuote" =
style=3D"padding:0;margin:0;"></blockquote><blockquote =
class=3D"ReferenceQuote" style=3D"padding:0;margin:0;"><div =
style=3D"margin: 0px;"><br></div><div style=3D"margin: 0px;">Thank =
you!</div></blockquote><div style=3D"margin: =
0px;"><br></div></div></blockquote></div><br></body></html>=
--Apple-Mail=_56F14ADE-DC27-4AC3-8A64-AAD4E3FFAEC5--