A
Andreas Otto
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I have the following code:
MqFactoryCtxIdentGet (struct MqS * const context) {
printP(context)
printP(NULL)
printI(context)
printI(NULL)
printI(context != NULL)
printI(context == NULL)
MA
if (context && context->setup.factory) {
M0
return context->setup.factory->ident;
} else {
M1
return "";
}
}
- -> the print??? is debugging output, "P" as pointer, "I" as integer
I call the code 2 times,
1'st with a valid pointer as input ...
2'nd with NULL as input
and now the result:
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:508:26150:0x7fd801319700)
- -> (MQ_PTR)context<0x961880>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:509:26150:0x7fd801319700)
- -> (MQ_PTR)((void *)0)<(nil)>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:510:26150:0x7fd801319700)
- -> context<9836672>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:511:26150:0x7fd801319700)
- -> ((void *)0)<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:512:26150:0x7fd801319700)
- -> context != ((void *)0)<1>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:513:26150:0x7fd801319700)
- -> context == ((void *)0)<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:514:26150:0x7fd801319700)
- -> AAAAAAAAAAAAAAAAA
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:516:26150:0x7fd801319700)
- -> 00000000000000000
- ---- init-3-(1|binary|pipe|ruby.pipe.pipe) start
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:508:26150:0x7fd801319700)
- -> (MQ_PTR)context<(nil)>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:509:26150:0x7fd801319700)
- -> (MQ_PTR)((void *)0)<(nil)>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:510:26150:0x7fd801319700)
- -> context<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:511:26150:0x7fd801319700)
- -> ((void *)0)<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:512:26150:0x7fd801319700)
- -> context != ((void *)0)<1>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:513:26150:0x7fd801319700)
- -> context == ((void *)0)<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:514:26150:0x7fd801319700)
- -> AAAAAAAAAAAAAAAAA
..../theLink/example/ruby/server.rb:458: [BUG] Segmentation fault
why is (NULL != NULL) = 1 ?????????????????
mfg, Andreas Otto
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJNL0UgAAoJEGTcPijNG3/A4jkH/3AMWYbNssd/Gssd71XYCxSV
tNEdYWxD8GLFpAkBR6dVz5z97cf9OYNYbpSfc9YCt6OF4P/4VGdmQz9PhR7mmJIU
L2n5h0ehBBTENI25QCm6mHv7hij6U0iIo6dpNAjNIx30weyb+ImjhevCnEpqRS8i
0dVg0yi10+sNRMyoOg/Lu027tHnnOCcBH+jstzcGnk4wVkI6xN7+liizxT9hsQMw
X0Szsn+SxztT14G5X9i5idaSCjNPH1W/4Fqv7f8/HWgTCQtQEi7Y6RmfSIqbQMwI
7UFHtWzKl8X65I5Tp9dqPaapfXePqFwgGhsUkfinSPynbROY2YTsbrDXuksJmqY=
=OdDG
-----END PGP SIGNATURE-----
Hash: SHA1
Hi,
I have the following code:
MqFactoryCtxIdentGet (struct MqS * const context) {
printP(context)
printP(NULL)
printI(context)
printI(NULL)
printI(context != NULL)
printI(context == NULL)
MA
if (context && context->setup.factory) {
M0
return context->setup.factory->ident;
} else {
M1
return "";
}
}
- -> the print??? is debugging output, "P" as pointer, "I" as integer
I call the code 2 times,
1'st with a valid pointer as input ...
2'nd with NULL as input
and now the result:
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:508:26150:0x7fd801319700)
- -> (MQ_PTR)context<0x961880>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:509:26150:0x7fd801319700)
- -> (MQ_PTR)((void *)0)<(nil)>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:510:26150:0x7fd801319700)
- -> context<9836672>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:511:26150:0x7fd801319700)
- -> ((void *)0)<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:512:26150:0x7fd801319700)
- -> context != ((void *)0)<1>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:513:26150:0x7fd801319700)
- -> context == ((void *)0)<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:514:26150:0x7fd801319700)
- -> AAAAAAAAAAAAAAAAA
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:516:26150:0x7fd801319700)
- -> 00000000000000000
- ---- init-3-(1|binary|pipe|ruby.pipe.pipe) start
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:508:26150:0x7fd801319700)
- -> (MQ_PTR)context<(nil)>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:509:26150:0x7fd801319700)
- -> (MQ_PTR)((void *)0)<(nil)>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:510:26150:0x7fd801319700)
- -> context<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:511:26150:0x7fd801319700)
- -> ((void *)0)<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:512:26150:0x7fd801319700)
- -> context != ((void *)0)<1>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:513:26150:0x7fd801319700)
- -> context == ((void *)0)<0>
MqFactoryCtxIdentGet(../../../theLink/libmsgque/factory.c:514:26150:0x7fd801319700)
- -> AAAAAAAAAAAAAAAAA
..../theLink/example/ruby/server.rb:458: [BUG] Segmentation fault
why is (NULL != NULL) = 1 ?????????????????
mfg, Andreas Otto
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJNL0UgAAoJEGTcPijNG3/A4jkH/3AMWYbNssd/Gssd71XYCxSV
tNEdYWxD8GLFpAkBR6dVz5z97cf9OYNYbpSfc9YCt6OF4P/4VGdmQz9PhR7mmJIU
L2n5h0ehBBTENI25QCm6mHv7hij6U0iIo6dpNAjNIx30weyb+ImjhevCnEpqRS8i
0dVg0yi10+sNRMyoOg/Lu027tHnnOCcBH+jstzcGnk4wVkI6xN7+liizxT9hsQMw
X0Szsn+SxztT14G5X9i5idaSCjNPH1W/4Fqv7f8/HWgTCQtQEi7Y6RmfSIqbQMwI
7UFHtWzKl8X65I5Tp9dqPaapfXePqFwgGhsUkfinSPynbROY2YTsbrDXuksJmqY=
=OdDG
-----END PGP SIGNATURE-----