<< Back to previous view

[PCC-399] ast-ksh/mamake build fails with "major internal compiler error" in src/cmd/INIT/mamake.c, line 372 Created: 11/Aug/12  Updated: 01/May/14

Status: Resolved
Project: pcc
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: ольга крыжановская Assignee: Anders Magnusson
Resolution: Fixed Votes: 1
Environment: Suse 12.1/AMD64

Anders, I pulled and build pcc from cvs -d
:pserver:anonymous@pcc.ludd.ltu.se:/cvsroot co pcc pcc-libs
pcc can compile a hello world application, but unfortunately a more
complex application fails:

wget --http-user="I accept www.opensource.org/licenses/eclipse"
wget --http-user="I accept www.opensource.org/licenses/eclipse"
(export PATH=$HOME/pccinstall/bin:$PATH ; CC=$HOME/pccinstall/bin/pcc
~/bin/ksh ./bin/package make 2>&1 | tee -a buildlog.log)
package: update /home/fleyta/work/ast_ksh_20120801/build_pcc/bin/execrate
package: initialize the
/home/fleyta/work/ast_ksh_20120801/build_pcc/arch/linux.i386-64 view
package: update
package: update
major internal compiler error:
line 372
/home/fleyta/pccinstall/lib/ccom terminated with status 1

Comment by Roland Mainz [ 12/Aug/12 12:28 PM ]
Grumpf... I wish pcc would produce more "hints" what the horrible tentacle-armed internal error was... ;-/
Comment by Iain Hibbert [ 13/Aug/12 09:20 PM ]
major internal compiler error is usually a SIGSEGV or SIGBUS, resulting from a bad pointer dereference
Comment by Roland Mainz [ 13/Aug/12 09:54 PM ]
Any idea how to debug that ? I hit the issue myself but there is no coredump (yes... I did a $ ulimit -c unlimited #) and Linux doesn't have Solaris's coreadm. Poking with xx@@@!!!-gdb (I wish dbx would work on Linux) didn't help much either.
Comment by Iain Hibbert [ 15/Aug/12 12:21 PM ]
pcc uses lazy initializations in general, pointers are expected to be valid when they are required. This means that a code path which forgets to set something may cause another segment to bomb out with an invalid pointer, but it is the first code path which is needing to be fixed.

To get a core dump you would need to disable the segvcatch() function in main.c but that is not greatly useful because of the above reason, it doesn't help you know where the pointer was not set correctly.

the best way is to reduce the problem to the essential part (and from your comments on pcc-list I think this may be same as PCC-400), then dump out the data structures with -X options to ccom and discover which was wrong and thus find the code which should have set it. (its easy to describe, but not so easy to do I think.. I can usually do the first part at least :)
Comment by Anders Magnusson [ 01/May/14 11:01 AM ]
This bug now seems fixed, mamake says:

linux-qyl5:/home/ragge/att >./arch/linux.i386-64/bin/mamake
mamake: Mamfile: not found

which I assume is a health sign :-)
Generated at Sat Oct 21 06:41:32 CEST 2017 using JIRA Enterprise Edition, Version: 3.13.1-#333.