|
From: Defiant H. <he...@er...> - 2003-04-01 20:39:34
|
What can cause a segmentation fault besides pointers? I've been getting=20 one that resists all attempts to track down its cause. The problem persisted after I eliminated all pointers to the variable tha= t=20 seems to be causing it. (I made the function return the value instead of=20 modifying it directly) There is some recursion involved, but as far as I can tell, it isn=E2=80=99= t being=20 called before the fault. I have determined that the memory location of this variable /is/ being=20 changed before the crash. However, when I attempted to locate exactly whe= re=20 in the code it is being changed using printf(%p,foo), the crash didn=E2=80= =99t=20 happen. (Heisenburg meets Ritchie?) The fault seems like it might be dependent on the contents of a file I=E2= =80=99m=20 viewing (ASCII text). Some files can be read without crashing; others=20 cannot. Other than that, I have no clue. |