This is what lldb reported (truncated from my original message) — a BAD ACCESS:Process 4581 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x968) frame #0: 0x000000010012b52b libX11.6.dylib`XCreatePixmap + 29 libX11.6.dylib`XCreatePixmap: -> 0x10012b52b <+29>: movq 0x968(%rbx), %rax 0x10012b532 <+36>: testq %rax, %rax 0x10012b535 <+39>: je 0x10012b53c ; <+46> 0x10012b537 <+41>: movq %rbx, %rdi Target 0: (mod) stopped.
— Thanks for your reply — Peter
Hi Peter,On Tue, Mar 03, 2020 at 11:09:07AM -0800, Peter Rowat via xforms-development wrote:My program runs successfully 90% of the time, but about every 10th run there is an address exception appearing in XCreatePixmap.
Sorry to be stupid, but what exactly is an "address exception"? I'maware of SEGFAULT (dereferencing a non-existing address) and SIGBUS(an unaligned access), but the term "address exception" doesn't ringa bells. A quick search for the term on Google comes up with someJava-ish stuff.Here is the lldb output:
Process 4581 launched: '/Users/prowat/BioPrep/N2Prep/Izh2p2/mod' (x86_64) ...... ...... Process 4581 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x968) frame #0: 0x000000010012b52b libX11.6.dylib`XCreatePixmap + 29 libX11.6.dylib`XCreatePixmap: -> 0x10012b52b <+29>: movq 0x968(%rbx), %rax 0x10012b532 <+36>: testq %rax, %rax 0x10012b535 <+39>: je 0x10012b53c ; <+46> 0x10012b537 <+41>: movq %rbx, %rdi Target 0: (mod) stopped. (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x968) * frame #0: 0x000000010012b52b libX11.6.dylib`XCreatePixmap + 29 frame #1: 0x000000010012a589 libX11.6.dylib`XCreateBitmapFromData + 53 frame #2: 0x000000010029f593 libforms.2.dylib`fli_init_stipples + 67 frame #3: 0x0000000100250046 libforms.2.dylib`fli_init_colormap + 198 frame #4: 0x0000000100258546 libforms.2.dylib`fl_initialize + 5334 frame #5: 0x0000000100001577 mod`main(argc=1, argv=0x00007ffeefbff888) at runit1.c:315:2 frame #6: 0x00007fff674a07fd libdyld.dylib`start + 1 frame #7: 0x00007fff674a07fd libdyld.dylib`start + 1 (end of lldb print)===========
Had a look at the last potential culprit in XForms, fli_init_stipples().But there's nothing that looks like it could result in a segmentationfault or unaligned access. And I'd guess that this would be somethingthat would happen consistently and not just every tenth time the pro-gram is started as everything used there is global variables whichshould be the same each time round.Frame #5: is at statement: `fl_initialize( &argc, argv, "BioPrep", 0, 0 );’ It was not the first executable statement but was before any other XForms statement.
I’ve moved the fl_initialize statement to be the first executable, in case this stops the address exceptions. None so far after 2 runs. If I get no more address exceptions after another 20-30 runs, I’ll write again.
To be honest I'm not a big fan of movings stuff around in the codeto get rid of annoying behaviour as it, in my experience, tends toat best move a bug to a place where it's less likely to be triggered,but not to fix the underlying issue. My preference would be to figureout what is really going on there;-) But then I don't really know yetwhat this "address exeption" thingy actually signifies... Best regards, Jens-- \ Jens Thoms Toerring ________ address@hidden \_______________________________ http://toerring.de
|