Great test code! Could you please file this as a bug report for gcc? I am a bit unsure whether the issue is in gcc itself or in libobjc but both are handled in the same bug tracking system.
Fred > Am 08.08.2018 um 00:34 schrieb Josh Freeman <[email protected]>: > > On Aug 5, 2018, at 5:22 AM, Wolfgang Lux wrote: > >> I finally managed to reproduce the crash, once I've noticed that you are >> compiling on a 32-bit OS rather than 64-bits (any reason for not using >> 64-bits nowadays?). > > Good catch, now I'm seeing the crash as well (Ubuntu 16.04.5, 32-bit). > > >> Setting a breakpoint on the setApplicationIconImage: and then stepping >> through that method I found that the code crashes here: >> 2385 miniWindowSize = [GSCurrentServer() iconSize]; > > It seems to be a gcc/gobjc compiler/runtime bug: Sending a nil message > using a method signature that returns a structure (ex. -[NSView bounds] -> > NSRect) results in: > 1. Garbage values in the returned structure's members (affects: > 32-bit/64-bit, debug/non-debug) > 2. A corrupted stack (affects: 32-bit w/non-debug) > > Attached are two files: > - nil_msg_check.m: source for a simple test program, NilMsgCheck, which sends > a nil message that returns an NSSize value > - GNUmakefile: makefile for NilMsgCheck > > ----- > Output from running NilMsgCheck on gcc/gobjc 32-bit non-debug: > > [self nmcZeroSize] returned: {width = 0; height = 0} > [nil nmcZeroSize] returned: {width = -2.90002e-05; height = 0} > *** stack smashing detected ***: ./obj/NilMsgCheck terminated > Aborted (core dumped) > > (If the nil-message is commented-out (nil_msg_check.m:22), NilMsgCheck > exits normally without error) > > ---- > Output from running NilMsgCheck on gcc/gobjc 32-bit debug: > > [self nmcZeroSize] returned: {width = 0; height = 0} > [nil nmcZeroSize] returned: {width = -2.74035e-05; height = -2.78249e-05} > > (Exits normally) > > ---- > Output from running NilMsgCheck on clang/objc2 32-bit debug: > > [self nmcZeroSize] returned: {width = 0; height = 0} > [nil nmcZeroSize] returned: {width = 0; height = 0} > > (Exits normally, values are correctly zeroed) > > > > Cheers, > > Josh > > > <nil_msg_check.m><GNUmakefile> > > _______________________________________________ > Discuss-gnustep mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/discuss-gnustep _______________________________________________ Discuss-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
