Photon program crashes on one machine, but not another

Here’s a non-portable crash. This program consistently works on
desktop AMD K5 machines, and consistently crashes on a Panasonic
laptop with Intel inside. This is under QNX 6.21 PE in all cases.

The program crashes when a checkbox in a menu is checked or unchecked.
I’ve been through this in the debugger, and nothing looks wrong for
as far down as there are symbols. The crash is coming when a meter
is having its value changed. The widget object is dumpable and
looks sane. My own objects look fine.

I’ve built the program in both static and dynamic forms.
No difference. I’ve run the executable that works on the desktops
on the laptop. It crashes. I’ve rebuilt the executable on the
laptop. It crashes.

This is all repeatable and will happen under GDB.

See backtrace below.

John Nagle
Team Overbot

(gdb) backtrace
#0 0xb82fde54 in PtMarkDamage () from /x86/usr/lib/libph.so.2
#1 0xb82fe0ad in PtDamageTiles () from /x86/usr/lib/libph.so.2
#2 0xb82fe03b in PtDamageTiles () from /x86/usr/lib/libph.so.2
#3 0xb82fe2f0 in PtDamageExtent () from /x86/usr/lib/libph.so.2
#4 0xb82856e7 in change_range () from /x86/usr/lib/libph.so.2
#5 0xb82f5fed in PtSetValue () from /x86/usr/lib/libph.so.2
#6 0xb82cfb8a in PtCoreSetResources () from /x86/usr/lib/libph.so.2
#7 0xb82f48bf in _PtSetResource () from /x86/usr/lib/libph.so.2
#8 0x0804f067 in NavRead::drawframeitem (this=0x80c93c8, item=@0x80c9418)
at …/navread.cpp:472
#9 0x08050769 in NavRead::map_port_draw (this=0x80c93c8, widget=0x80ad7e0,
damage=0x80476a4) at …/navread.cpp:964
#10 0x0804d69a in video_port_draw (widget=0x80ad7e0, damage=0x80476a4)
at …/video_port_draw.c:26
#11 0xb82a4e43 in raw_draw () from /x86/usr/lib/libph.so.2
#12 0xb82eea6f in simple_call_draw_f () from /x86/usr/lib/libph.so.2
#13 0xb82ef48d in PtDrawClippedWidget () from /x86/usr/lib/libph.so.2
#14 0xb8293615 in os_draw () from /x86/usr/lib/libph.so.2
#15 0xb82eea6f in simple_call_draw_f () from /x86/usr/lib/libph.so.2
#16 0xb82ef0b1 in PtDrawClippedWidget () from /x86/usr/lib/libph.so.2
#17 0xb82fdc44 in PtUpdate () from /x86/usr/lib/libph.so.2
#18 0xb82f01bc in PtEventHandler () from /x86/usr/lib/libph.so.2
#19 0xb825bbbd in PtAppProcessEvent () from /x86/usr/lib/libph.so.2
#20 0xb825bc8d in PtAppMainLoop () from /x86/usr/lib/libph.so.2
#21 0xb825bcce in PtMainLoop () from /x86/usr/lib/libph.so.2
#22 0x0804c759 in main (argc=1, argv=0x8047a80) at …/abmain.c:62

You’re setting a resource in a draw function. You’re not supposed to do
that.

“John Nagle” <nagle@overbot.com> wrote in message
news:dednm2$rgh$1@inn.qnx.com

Here’s a non-portable crash. This program consistently works on
desktop AMD K5 machines, and consistently crashes on a Panasonic
laptop with Intel inside. This is under QNX 6.21 PE in all cases.

The program crashes when a checkbox in a menu is checked or unchecked.
I’ve been through this in the debugger, and nothing looks wrong for
as far down as there are symbols. The crash is coming when a meter
is having its value changed. The widget object is dumpable and
looks sane. My own objects look fine.
I’ve built the program in both static and dynamic forms.
No difference. I’ve run the executable that works on the desktops
on the laptop. It crashes. I’ve rebuilt the executable on the
laptop. It crashes.
This is all repeatable and will happen under GDB.

See backtrace below.

John Nagle
Team Overbot

(gdb) backtrace
#0 0xb82fde54 in PtMarkDamage () from /x86/usr/lib/libph.so.2
#1 0xb82fe0ad in PtDamageTiles () from /x86/usr/lib/libph.so.2
#2 0xb82fe03b in PtDamageTiles () from /x86/usr/lib/libph.so.2
#3 0xb82fe2f0 in PtDamageExtent () from /x86/usr/lib/libph.so.2
#4 0xb82856e7 in change_range () from /x86/usr/lib/libph.so.2
#5 0xb82f5fed in PtSetValue () from /x86/usr/lib/libph.so.2
#6 0xb82cfb8a in PtCoreSetResources () from /x86/usr/lib/libph.so.2
#7 0xb82f48bf in _PtSetResource () from /x86/usr/lib/libph.so.2
#8 0x0804f067 in NavRead::drawframeitem (this=0x80c93c8, item=@0x80c9418)
at …/navread.cpp:472
#9 0x08050769 in NavRead::map_port_draw (this=0x80c93c8,
widget=0x80ad7e0,
damage=0x80476a4) at …/navread.cpp:964
#10 0x0804d69a in video_port_draw (widget=0x80ad7e0, damage=0x80476a4)
at …/video_port_draw.c:26
#11 0xb82a4e43 in raw_draw () from /x86/usr/lib/libph.so.2
#12 0xb82eea6f in simple_call_draw_f () from /x86/usr/lib/libph.so.2
#13 0xb82ef48d in PtDrawClippedWidget () from /x86/usr/lib/libph.so.2
#14 0xb8293615 in os_draw () from /x86/usr/lib/libph.so.2
#15 0xb82eea6f in simple_call_draw_f () from /x86/usr/lib/libph.so.2
#16 0xb82ef0b1 in PtDrawClippedWidget () from /x86/usr/lib/libph.so.2
#17 0xb82fdc44 in PtUpdate () from /x86/usr/lib/libph.so.2
#18 0xb82f01bc in PtEventHandler () from /x86/usr/lib/libph.so.2
#19 0xb825bbbd in PtAppProcessEvent () from /x86/usr/lib/libph.so.2
#20 0xb825bc8d in PtAppMainLoop () from /x86/usr/lib/libph.so.2
#21 0xb825bcce in PtMainLoop () from /x86/usr/lib/libph.so.2
#22 0x0804c759 in main (argc=1, argv=0x8047a80) at …/abmain.c:62

That fixed it. Thank you.

John Nagle

Wojtek Lerch wrote:

You’re setting a resource in a draw function. You’re not supposed to do
that.

“John Nagle” <> nagle@overbot.com> > wrote in message
news:dednm2$rgh$> 1@inn.qnx.com> …

Here’s a non-portable crash. This program consistently works on
desktop AMD K5 machines, and consistently crashes on a Panasonic
laptop with Intel inside. This is under QNX 6.21 PE in all cases.

The program crashes when a checkbox in a menu is checked or unchecked.
I’ve been through this in the debugger, and nothing looks wrong for
as far down as there are symbols. The crash is coming when a meter
is having its value changed. The widget object is dumpable and
looks sane. My own objects look fine.
I’ve built the program in both static and dynamic forms.
No difference. I’ve run the executable that works on the desktops
on the laptop. It crashes. I’ve rebuilt the executable on the
laptop. It crashes.
This is all repeatable and will happen under GDB.

See backtrace below.

John Nagle
Team Overbot

(gdb) backtrace
#0 0xb82fde54 in PtMarkDamage () from /x86/usr/lib/libph.so.2
#1 0xb82fe0ad in PtDamageTiles () from /x86/usr/lib/libph.so.2
#2 0xb82fe03b in PtDamageTiles () from /x86/usr/lib/libph.so.2
#3 0xb82fe2f0 in PtDamageExtent () from /x86/usr/lib/libph.so.2
#4 0xb82856e7 in change_range () from /x86/usr/lib/libph.so.2
#5 0xb82f5fed in PtSetValue () from /x86/usr/lib/libph.so.2
#6 0xb82cfb8a in PtCoreSetResources () from /x86/usr/lib/libph.so.2
#7 0xb82f48bf in _PtSetResource () from /x86/usr/lib/libph.so.2
#8 0x0804f067 in NavRead::drawframeitem (this=0x80c93c8, item=@0x80c9418)
at …/navread.cpp:472
#9 0x08050769 in NavRead::map_port_draw (this=0x80c93c8,
widget=0x80ad7e0,
damage=0x80476a4) at …/navread.cpp:964
#10 0x0804d69a in video_port_draw (widget=0x80ad7e0, damage=0x80476a4)
at …/video_port_draw.c:26
#11 0xb82a4e43 in raw_draw () from /x86/usr/lib/libph.so.2
#12 0xb82eea6f in simple_call_draw_f () from /x86/usr/lib/libph.so.2
#13 0xb82ef48d in PtDrawClippedWidget () from /x86/usr/lib/libph.so.2
#14 0xb8293615 in os_draw () from /x86/usr/lib/libph.so.2
#15 0xb82eea6f in simple_call_draw_f () from /x86/usr/lib/libph.so.2
#16 0xb82ef0b1 in PtDrawClippedWidget () from /x86/usr/lib/libph.so.2
#17 0xb82fdc44 in PtUpdate () from /x86/usr/lib/libph.so.2
#18 0xb82f01bc in PtEventHandler () from /x86/usr/lib/libph.so.2
#19 0xb825bbbd in PtAppProcessEvent () from /x86/usr/lib/libph.so.2
#20 0xb825bc8d in PtAppMainLoop () from /x86/usr/lib/libph.so.2
#21 0xb825bcce in PtMainLoop () from /x86/usr/lib/libph.so.2
#22 0x0804c759 in main (argc=1, argv=0x8047a80) at …/abmain.c:62