[tlbuild] dvi test?

John Hawkinson jhawk at alum.mit.edu
Sun Jan 30 07:49:42 CET 2022


Replies to Karl and Luigi both in-line.

Karl Berry <karl at freefriends.org> wrote on Sat, 29 Jan 2022
at 17:56:00 EST in <202201292256.20TMu0f4003068 at freefriends.org>:

> One minor thing that I see is that the return value from fseek is not
> being checked here (line 1821):
> 	fseek(m_dvi_fp, 0L, SEEK_SET);
> although I don't know if that's even being called.

It is called, but it returns 0 for success (or, at least, that's what's in the $x0 register, which I understand from https://developer.arm.com/documentation/ihi0055/latest to be the return value in the arm64 ABI. That document specifies the r0 register, confusingly, but also explains "these are labeled r0-r30. In a 64-bit context these registers are normally referred to using the names x0-x30." And Apple refers to arm's docs at https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms). Debugging transcript after the next section. Let me know if you want me to actually add a printf to the code.

Anyhow, this reminds me Luigi Scarso had suggested a watchpoint on m_dvi_fp:

luigi scarso <luigi.scarso at gmail.com> wrote on Tue, 25 Jan 2022
at 15:18:46 EST in <CAG5iGsDCNBAeN0OvhjFKRkDbq4Qk6fu01OvDHWpRDZYBRLFAeQ at mail.gmail.com>:

> ../../../texk/xdvik/dvi-init.c:1702: FILES: dvi_file_changed: fp = 0x0?
> ../../../texk/xdvik/dvi-init.c:1706: FILES: m_dvi_fp == NULL
> ../../../texk/xdvik/dvi-init.c:1752: FILES: file not changed
> 
> hm a file point that is NULL ?
> I expect that fp is not NULL and point to /<path>/|t2a-draftcopy.dvi .

I think that fp is reset to NULL when the file is closed and reopened.

Anyhow, I set a watchpoint on m_dvi_fp in lldb and here's the debugging session. I also -debug 524288 to turn on FILES debugging at the same time.

One odd thing is that, even after recompiling with -O0, thw watchpoint seems to trigger on the line after the modification here:

   1686		m_dvi_fp = NULL;
-> 1687		if (!resource.use_temp_fp)

but nowhere else.

Here's the session; I interrupted (^C) the running program and put in a print command in lldb before I hit shift-R, so you can see where that is in the session ((lldb) print "OK, about to hit R"):

(lldb) run -debug 524288 t2a
There is a running process, kill it and restart?: [Y/n] 
Process 21902 launched: '/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/xdvi-bin' (arm64)
Process 21902 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100001010 xdvi-bin`main(argc=4, argv=0x000000016fdff640) at main.c:997:17
   994 	{
   995 	    int i;
   996 	    static struct startup_info info;
-> 997 	    const char *file_name = NULL;
   998 	    const char *file_name2 = NULL;
   999 	    
   1000	    /* Hack to have command-line options override ~/.xdvirc stuff:
Target 0: (xdvi-bin) stopped.
(lldb) watch list
Number of supported hardware watchpoints: 4
Current watchpoints:
Watchpoint 1: addr = 0x100177200 size = 8 state = disabled type = w
    watchpoint spec = 'm_dvi_fp'
(lldb) r
There is a running process, kill it and restart?: [Y/n] y
Process 21902 exited with status = 9 (0x00000009) 
Process 21907 launched: '/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/xdvi-bin' (arm64)
Process 21907 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100001010 xdvi-bin`main(argc=4, argv=0x000000016fdff640) at main.c:997:17
   994 	{
   995 	    int i;
   996 	    static struct startup_info info;
-> 997 	    const char *file_name = NULL;
   998 	    const char *file_name2 = NULL;
   999 	    
   1000	    /* Hack to have command-line options override ~/.xdvirc stuff:
Target 0: (xdvi-bin) stopped.
(lldb) watch set var m_dvi_fp
Watchpoint created: Watchpoint 1: addr = 0x100177200 size = 8 state = enabled type = w
    watchpoint spec = 'm_dvi_fp'
(lldb) c
Process 21907 resuming
KPATHSEA_DEBUG = 8192
../../../texk/xdvik/main.c:1210: FILES: Initializing kpathsearch with program name 'xdvi'
../../../texk/xdvik/main.c:1265: FILES: file history: |(null)|
../../../texk/xdvik/dvi-init.c:1234: FILES: file_exists_p for |t2a.dvi|

Watchpoint 1 hit:
new value: 0x0000000207f6ec10
Process 21907 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = watchpoint 1
    frame #0: 0x0000000100013580 xdvi-bin`file_exists_p(path="t2a.dvi", errflag=0x000000016fdff2ac) at dvi-init.c:1236:9
   1233	{
   1234	    TRACE_FILES((stderr, "file_exists_p for |%s|", path));
   1235	    *errflag = UNKNOWN_ERROR;
-> 1236	    if ((m_dvi_fp = XFOPEN(path, OPEN_MODE)) == NULL) {
   1237		/*  	fprintf(stderr, "after internal_open_dvi1: xfopen\n"); */
   1238		*errflag = FILE_DOESNT_EXIST;
   1239		return False;
Target 0: (xdvi-bin) stopped.
(lldb)  
../../../texk/xdvik/dvi-init.c:1241: FILES: m_dvi_fp for |t2a.dvi| = 0x207f6ec10
Process 21907 resuming
../../../texk/xdvik/dvi-init.c:779: FILES: process_preamble: fp = 0x207f6eca8, errflag = 2
../../../texk/xdvik/dvi-init.c:802: FILES: process_preamble: fp = 0x207f6eca8, errflag = 2, returning True
../../../texk/xdvik/dvi-init.c:821: FILES: find_postamble on fp: 0x207f6eca8
../../../texk/xdvik/dvi-init.c:855: FILES: find_postamble: returning TRUE
../../../texk/xdvik/dvi-init.c:946: FILES: read_postamble: reading 0x207f6eca8 (0)
../../../texk/xdvik/dvi-init.c:1037: FILES: read_postamble: returning TRUE
../../../texk/xdvik/filehist.c:171: FILES: Pushing: |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|
======= File history:
../../../texk/xdvik/filehist.c:182: FILES: current length: 1, max: 20
../../../texk/xdvik/filehist.c:207: FILES: NEW item: |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|

======= File history:
item 0: 0:/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi
../../../texk/xdvik/filehist.c:217: FILES: returning: 0 < 1
../../../texk/xdvik/xdvi.c:3174: FILES: globals.dvi_name is: |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi| 0x600001700180

xdvik 22.87.05 (Xaw toolkit), kpathsea: kpathsea version 6.3.2
configured with: ppi=600 shrink=8 mfmode=<NONE> alt_font=cmr10 paper=a4
--- G_depth: 24
../../../texk/xdvik/dvi-init.c:1360: FILES: internal_open_dvi for |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|

Watchpoint 1 hit:
old value: 0x0000000207f6ec10
new value: 0x0000000000000000
Process 21907 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = watchpoint 1
    frame #0: 0x000000010001349c xdvi-bin`close_old_filep at dvi-init.c:1687:16
   1684	    if (m_dvi_fp != NULL) {
   1685		fclose(m_dvi_fp);
   1686		m_dvi_fp = NULL;
-> 1687		if (!resource.use_temp_fp)
   1688		    globals.dvi_file.bak_fp = NULL;
   1689	    }
   1690	}
Target 0: (xdvi-bin) stopped.
(lldb)  
Process 21907 resuming
../../../texk/xdvik/dvi-init.c:1234: FILES: file_exists_p for |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|

Watchpoint 1 hit:
old value: 0x0000000000000000
new value: 0x0000000207f6ec10
Process 21907 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = watchpoint 1
    frame #0: 0x0000000100013580 xdvi-bin`file_exists_p(path="/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi", errflag=0x000000016fdff31c) at dvi-init.c:1236:9
   1233	{
   1234	    TRACE_FILES((stderr, "file_exists_p for |%s|", path));
   1235	    *errflag = UNKNOWN_ERROR;
-> 1236	    if ((m_dvi_fp = XFOPEN(path, OPEN_MODE)) == NULL) {
   1237		/*  	fprintf(stderr, "after internal_open_dvi1: xfopen\n"); */
   1238		*errflag = FILE_DOESNT_EXIST;
   1239		return False;
Target 0: (xdvi-bin) stopped.
(lldb)  
Process 21907 resuming
../../../texk/xdvik/dvi-init.c:1241: FILES: m_dvi_fp for |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi| = 0x207f6ec10
../../../texk/xdvik/dvi-init.c:1286: FILES: internal_init_dvi, globals.dvi_file.bak_fp = 0x207f6ed40
../../../texk/xdvik/dvi-init.c:779: FILES: process_preamble: fp = 0x207f6ed40, errflag = 14
../../../texk/xdvik/dvi-init.c:802: FILES: process_preamble: fp = 0x207f6ed40, errflag = 14, returning True
../../../texk/xdvik/dvi-init.c:821: FILES: find_postamble on fp: 0x207f6ed40
../../../texk/xdvik/dvi-init.c:855: FILES: find_postamble: returning TRUE
../../../texk/xdvik/dvi-init.c:946: FILES: read_postamble: reading 0x207f6ed40 (1)
../../../texk/xdvik/dvi-init.c:1064: FILES: read_postamble: returning TRUE
../../../texk/xdvik/dvi-init.c:1075: FILES: calling pageinfo_deallocate
../../../texk/xdvik/dvi-init.c:1078: FILES: pageinfo_allocate for 4 pages
../../../texk/xdvik/special.c:1481: FILES: init_prescan: scanned_page = -1
../../../texk/xdvik/dvi-init.c:1391: FILES: internal_open_dvi: SUCCESS!
../../../texk/xdvik/filehist.c:230: FILES: SETTING HEAD to 0
======= File history:
item 0: 0:/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi
../../../texk/xdvik/filehist.c:235: FILES: Setting page of |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi| to 0
../../../texk/xdvik/dvi-draw.c:1364: FILES: prescan on 0x207f6ed40
../../../texk/xdvik/dvi-draw.c:1371: FILES: prescan on page 1
../../../texk/xdvik/dvi-init.c:1127: FILES: init_page: setting globals.page.w = 623, globals.page.h = 879
../../../texk/xdvik/events.c:6049: FILES: Redraw page on 0x207f6ed40
../../../texk/xdvik/events.c:6065: FILES: redraw_page: current_page = 0
../../../texk/xdvik/events.c:6049: FILES: Redraw page on 0x207f6ed40
../../../texk/xdvik/events.c:6056: FILES: redraw_page: scanned_page = -1, current_page = 0, prescanning 0x207f6ed40

../../../texk/xdvik/dvi-draw.c:1364: FILES: prescan on 0x207f6ed40
../../../texk/xdvik/dvi-draw.c:1371: FILES: prescan on page 1
../../../texk/xdvik/events.c:6065: FILES: redraw_page: current_page = 0
../../../texk/xdvik/dvi-init.c:1702: FILES: dvi_file_changed: fp = 0x207f6ec10?
Process 21907 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00000001ae8f4e88 libsystem_kernel.dylib`__sigsuspend + 8
libsystem_kernel.dylib`__sigsuspend:
->  0x1ae8f4e88 <+8>:  b.lo   0x1ae8f4ea8               ; <+40>
    0x1ae8f4e8c <+12>: pacibsp 
    0x1ae8f4e90 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1ae8f4e94 <+20>: mov    x29, sp
Target 0: (xdvi-bin) stopped.
(lldb) print "OK, about to hit R"
(const char [19]) $0 = "OK, about to hit R"
(lldb) c
Process 21907 resuming
../../../texk/xdvik/dvi-init.c:1816: FILES: load_dvi_file: going to read 0x207f6ec10
../../../texk/xdvik/dvi-init.c:779: FILES: process_preamble: fp = 0x207f6ec10, errflag = 0
../../../texk/xdvik/dvi-init.c:802: FILES: process_preamble: fp = 0x207f6ec10, errflag = 0, returning True
../../../texk/xdvik/dvi-init.c:821: FILES: find_postamble on fp: 0x207f6ec10
../../../texk/xdvik/dvi-init.c:855: FILES: find_postamble: returning TRUE
../../../texk/xdvik/dvi-init.c:946: FILES: read_postamble: reading 0x207f6ec10 (1)
../../../texk/xdvik/dvi-init.c:1064: FILES: read_postamble: returning TRUE
../../../texk/xdvik/dvi-init.c:1360: FILES: internal_open_dvi for |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|

Watchpoint 1 hit:
old value: 0x0000000207f6ec10
new value: 0x0000000000000000
Process 21907 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = watchpoint 1
    frame #0: 0x000000010001349c xdvi-bin`close_old_filep at dvi-init.c:1687:16
   1684	    if (m_dvi_fp != NULL) {
   1685		fclose(m_dvi_fp);
   1686		m_dvi_fp = NULL;
-> 1687		if (!resource.use_temp_fp)
   1688		    globals.dvi_file.bak_fp = NULL;
   1689	    }
   1690	}
Target 0: (xdvi-bin) stopped.
(lldb) c
Process 21907 resuming
../../../texk/xdvik/dvi-init.c:1234: FILES: file_exists_p for |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|

Watchpoint 1 hit:
old value: 0x0000000000000000
new value: 0x0000000207f6ec10
Process 21907 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = watchpoint 1
    frame #0: 0x0000000100013580 xdvi-bin`file_exists_p(path="/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi", errflag=0x000000016fdff1bc) at dvi-init.c:1236:9
   1233	{
   1234	    TRACE_FILES((stderr, "file_exists_p for |%s|", path));
   1235	    *errflag = UNKNOWN_ERROR;
-> 1236	    if ((m_dvi_fp = XFOPEN(path, OPEN_MODE)) == NULL) {
   1237		/*  	fprintf(stderr, "after internal_open_dvi1: xfopen\n"); */
   1238		*errflag = FILE_DOESNT_EXIST;
   1239		return False;
Target 0: (xdvi-bin) stopped.
(lldb)  
Process 21907 resuming
../../../texk/xdvik/dvi-init.c:1241: FILES: m_dvi_fp for |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi| = 0x207f6ec10
../../../texk/xdvik/dvi-init.c:1286: FILES: internal_init_dvi, globals.dvi_file.bak_fp = 0x207f6ed40
../../../texk/xdvik/dvi-init.c:779: FILES: process_preamble: fp = 0x207f6ed40, errflag = 14
../../../texk/xdvik/dvi-init.c:783: FILES: process_preamble: fp = 0x207f6ed40, errflag = 3, returning False

Watchpoint 1 hit:
old value: 0x0000000207f6ec10
new value: 0x0000000000000000
Process 21907 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = watchpoint 1
    frame #0: 0x000000010001349c xdvi-bin`close_old_filep at dvi-init.c:1687:16
   1684	    if (m_dvi_fp != NULL) {
   1685		fclose(m_dvi_fp);
   1686		m_dvi_fp = NULL;
-> 1687		if (!resource.use_temp_fp)
   1688		    globals.dvi_file.bak_fp = NULL;
   1689	    }
   1690	}
Target 0: (xdvi-bin) stopped.
(lldb)  
Process 21907 resuming
../../../texk/xdvik/events.c:6049: FILES: Redraw page on 0x207f6ed40
../../../texk/xdvik/events.c:6065: FILES: redraw_page: current_page = 0
../../../texk/xdvik/dvi-init.c:1702: FILES: dvi_file_changed: fp = 0x0?
../../../texk/xdvik/dvi-init.c:1706: FILES: m_dvi_fp == NULL
../../../texk/xdvik/dvi-init.c:1752: FILES: file not changed
xdvi-bin: set_no_char: attempt to set character of unknown font, offset 42
xdvi-bin 22.87.05 (Xaw toolkit): ../../../texk/xdvik/dvi-draw.c:488: Shouldn't happen: I'll abort now, to help you debugging this.
Process 21907 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001ae8d19b8 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1ae8d19b8 <+8>:  b.lo   0x1ae8d19d8               ; <+40>
    0x1ae8d19bc <+12>: pacibsp 
    0x1ae8d19c0 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1ae8d19c4 <+20>: mov    x29, sp
Target 0: (xdvi-bin) stopped.



As for Karl's q about fseek():

(lldb) b dvi_init.c:1821
Breakpoint 2: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) b dvi-init.c:1821
Breakpoint 3: where = xdvi-bin`load_dvi_file + 224 at dvi-init.c:1821:8, address = 0x00000001000151dc
(lldb) watch disable 1
1 watchpoints disabled.
(lldb) break list
Current breakpoints:
1: name = 'main', locations = 1, resolved = 1, hit count = 3
  1.1: where = xdvi-bin`main + 136 at main.c:997:17, address = 0x0000000100001010, resolved, hit count = 3 

2: file = 'dvi_init.c', line = 1821, exact_match = 0, locations = 0 (pending)

3: file = 'dvi-init.c', line = 1821, exact_match = 0, locations = 1, resolved = 1, hit count = 0
  3.1: where = xdvi-bin`load_dvi_file + 224 at dvi-init.c:1821:8, address = 0x00000001000151dc, resolved, hit count = 0 

(lldb) break disable 1
1 breakpoints disabled.
(lldb) break delete 2
1 breakpoints deleted; 0 breakpoint locations disabled.
(lldb) r
There is a running process, kill it and restart?: [Y/n] y
Process 21907 exited with status = 9 (0x00000009) 
Process 21919 launched: '/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/xdvi-bin' (arm64)
KPATHSEA_DEBUG = 8192
../../../texk/xdvik/main.c:1210: FILES: Initializing kpathsearch with program name 'xdvi'
../../../texk/xdvik/main.c:1265: FILES: file history: |(null)|
../../../texk/xdvik/dvi-init.c:1234: FILES: file_exists_p for |t2a.dvi|
../../../texk/xdvik/dvi-init.c:1241: FILES: m_dvi_fp for |t2a.dvi| = 0x207f6ec10
../../../texk/xdvik/dvi-init.c:779: FILES: process_preamble: fp = 0x207f6eca8, errflag = 2
../../../texk/xdvik/dvi-init.c:802: FILES: process_preamble: fp = 0x207f6eca8, errflag = 2, returning True
../../../texk/xdvik/dvi-init.c:821: FILES: find_postamble on fp: 0x207f6eca8
../../../texk/xdvik/dvi-init.c:855: FILES: find_postamble: returning TRUE
../../../texk/xdvik/dvi-init.c:946: FILES: read_postamble: reading 0x207f6eca8 (0)
../../../texk/xdvik/dvi-init.c:1037: FILES: read_postamble: returning TRUE
../../../texk/xdvik/filehist.c:171: FILES: Pushing: |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|
======= File history:
../../../texk/xdvik/filehist.c:182: FILES: current length: 1, max: 20
../../../texk/xdvik/filehist.c:207: FILES: NEW item: |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|

======= File history:
item 0: 0:/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi
../../../texk/xdvik/filehist.c:217: FILES: returning: 0 < 1
../../../texk/xdvik/xdvi.c:3174: FILES: globals.dvi_name is: |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi| 0x600001708000

xdvik 22.87.05 (Xaw toolkit), kpathsea: kpathsea version 6.3.2
configured with: ppi=600 shrink=8 mfmode=<NONE> alt_font=cmr10 paper=a4
--- G_depth: 24
../../../texk/xdvik/dvi-init.c:1360: FILES: internal_open_dvi for |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|
../../../texk/xdvik/dvi-init.c:1234: FILES: file_exists_p for |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi|
../../../texk/xdvik/dvi-init.c:1241: FILES: m_dvi_fp for |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi| = 0x207f6ec10
../../../texk/xdvik/dvi-init.c:1286: FILES: internal_init_dvi, globals.dvi_file.bak_fp = 0x207f6ed40
../../../texk/xdvik/dvi-init.c:779: FILES: process_preamble: fp = 0x207f6ed40, errflag = 14
../../../texk/xdvik/dvi-init.c:802: FILES: process_preamble: fp = 0x207f6ed40, errflag = 14, returning True
../../../texk/xdvik/dvi-init.c:821: FILES: find_postamble on fp: 0x207f6ed40
../../../texk/xdvik/dvi-init.c:855: FILES: find_postamble: returning TRUE
../../../texk/xdvik/dvi-init.c:946: FILES: read_postamble: reading 0x207f6ed40 (1)
../../../texk/xdvik/dvi-init.c:1064: FILES: read_postamble: returning TRUE
../../../texk/xdvik/dvi-init.c:1075: FILES: calling pageinfo_deallocate
../../../texk/xdvik/dvi-init.c:1078: FILES: pageinfo_allocate for 4 pages
../../../texk/xdvik/special.c:1481: FILES: init_prescan: scanned_page = -1
../../../texk/xdvik/dvi-init.c:1391: FILES: internal_open_dvi: SUCCESS!
../../../texk/xdvik/filehist.c:230: FILES: SETTING HEAD to 0
======= File history:
item 0: 0:/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi
../../../texk/xdvik/filehist.c:235: FILES: Setting page of |/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi| to 0
../../../texk/xdvik/dvi-draw.c:1364: FILES: prescan on 0x207f6ed40
../../../texk/xdvik/dvi-draw.c:1371: FILES: prescan on page 1
../../../texk/xdvik/dvi-init.c:1127: FILES: init_page: setting globals.page.w = 623, globals.page.h = 879
../../../texk/xdvik/events.c:6049: FILES: Redraw page on 0x207f6ed40
../../../texk/xdvik/events.c:6065: FILES: redraw_page: current_page = 0
../../../texk/xdvik/events.c:6049: FILES: Redraw page on 0x207f6ed40
../../../texk/xdvik/events.c:6056: FILES: redraw_page: scanned_page = -1, current_page = 0, prescanning 0x207f6ed40

../../../texk/xdvik/dvi-draw.c:1364: FILES: prescan on 0x207f6ed40
../../../texk/xdvik/dvi-draw.c:1371: FILES: prescan on page 1
../../../texk/xdvik/events.c:6065: FILES: redraw_page: current_page = 0
../../../texk/xdvik/dvi-init.c:1702: FILES: dvi_file_changed: fp = 0x207f6ec10?
../../../texk/xdvik/dvi-init.c:1702: FILES: dvi_file_changed: fp = 0x207f6ec10?
../../../texk/xdvik/dvi-init.c:1702: FILES: dvi_file_changed: fp = 0x207f6ec10?
../../../texk/xdvik/dvi-init.c:1702: FILES: dvi_file_changed: fp = 0x207f6ec10?
../../../texk/xdvik/dvi-init.c:1816: FILES: load_dvi_file: going to read 0x207f6ec10
Process 21919 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1
    frame #0: 0x00000001000151dc xdvi-bin`load_dvi_file(load_fonts='\x01', errflag=0x000000016fdff1bc) at dvi-init.c:1821:8
   1818	    if (resource.use_temp_fp && m_dvi_fp != NULL) {
   1819		/* in this case, reload only if file has been written completely */
   1820		*errflag = NO_ERROR;
-> 1821		fseek(m_dvi_fp, 0L, SEEK_SET);
   1822		if (!process_preamble(m_dvi_fp, errflag)
   1823		    || !find_postamble(m_dvi_fp, errflag)
   1824		    || !read_postamble(m_dvi_fp, errflag,
Target 0: (xdvi-bin) stopped.
(lldb) p fseek(m_dvi_fp, 0L, SEEK_SET)
error: <user expression 1>:1:21: use of undeclared identifier 'SEEK_SET'
fseek(m_dvi_fp, 0L, SEEK_SET)
                    ^
(lldb) reg read
General Purpose Registers:
        x0 = 0x0000000000000001
        x1 = 0x0000000000000000
        x2 = 0x0000000000000000
        x3 = 0x000000016fdfeb69
        x4 = 0x00000001001295d0  "'\n'"
        x5 = 0x000000016fdff0c0
        x6 = 0x000000000000000a
        x7 = 0x0000000000000000
        x8 = 0x0000000100177000  xdvi-bin`src_this_line
        x9 = 0x0000000207f6fa20  libsystem_kernel.dylib`errno
       x10 = 0x0000000000000002
       x11 = 0x00000000fffffffd
       x12 = 0x0000000000000000
       x13 = 0x0000000000000000
       x14 = 0x0000000000000001
       x15 = 0x0000000000000002
       x16 = 0x00000001ae8ca358  libsystem_kernel.dylib`__error
       x17 = 0x0000000209135858  (void *)0x00000001ae8ca358: __error
       x18 = 0x0000000000000000
       x19 = 0x00000001002b0060
       x20 = 0x0000000100000f88  xdvi-bin`main at main.c:994
       x21 = 0x000000010025c070  dyld`dyld4::sConfigBuffer
       x22 = 0x0000000000000000
       x23 = 0x0000000000000000
       x24 = 0x0000000000000000
       x25 = 0x0000000000000000
       x26 = 0x0000000000000000
       x27 = 0x0000000000000000
       x28 = 0x0000000000000000
        fp = 0x000000016fdff130
        lr = 0xb0050001000151b0 (0x00000001000151b0) xdvi-bin`load_dvi_file + 180 at dvi-init.c
        sp = 0x000000016fdff0c0
        pc = 0x00000001000151dc  xdvi-bin`load_dvi_file + 224 at dvi-init.c:1821:8
      cpsr = 0x20001000

(lldb) next
Process 21919 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x00000001000151ec xdvi-bin`load_dvi_file(load_fonts='\x01', errflag=0x000000016fdff1bc) at dvi-init.c:1822:24
   1819		/* in this case, reload only if file has been written completely */
   1820		*errflag = NO_ERROR;
   1821		fseek(m_dvi_fp, 0L, SEEK_SET);
-> 1822		if (!process_preamble(m_dvi_fp, errflag)
   1823		    || !find_postamble(m_dvi_fp, errflag)
   1824		    || !read_postamble(m_dvi_fp, errflag,
   1825	#if DELAYED_MKTEXPK
Target 0: (xdvi-bin) stopped.
(lldb) reg read
General Purpose Registers:
        x0 = 0x0000000000000000
        x1 = 0x0000000000000000
        x2 = 0x00000000000120a8
        x3 = 0x0000000000000001
        x4 = 0x00000001001295d0  "'\n'"
        x5 = 0x000000016fdff0c0
        x6 = 0x000000000000000a
        x7 = 0x0000000000000000
        x8 = 0x0000000100177000  xdvi-bin`src_this_line
        x9 = 0x0000000207f6fa20  libsystem_kernel.dylib`errno
       x10 = 0x0000000000000002
       x11 = 0x00000000fffffffd
       x12 = 0x0000000000000000
       x13 = 0x0000000000000000
       x14 = 0x0000000000000001
       x15 = 0x0000000000000002
       x16 = 0x00000001ae8ca358  libsystem_kernel.dylib`__error
       x17 = 0x0000000209135858  (void *)0x00000001ae8ca358: __error
       x18 = 0x0000000000000000
       x19 = 0x00000001002b0060
       x20 = 0x0000000100000f88  xdvi-bin`main at main.c:994
       x21 = 0x000000010025c070  dyld`dyld4::sConfigBuffer
       x22 = 0x0000000000000000
       x23 = 0x0000000000000000
       x24 = 0x0000000000000000
       x25 = 0x0000000000000000
       x26 = 0x0000000000000000
       x27 = 0x0000000000000000
       x28 = 0x0000000000000000
        fp = 0x000000016fdff130
        lr = 0xd96f8001000151e8 (0x00000001000151e8) xdvi-bin`load_dvi_file + 236 at dvi-init.c:1821:2
        sp = 0x000000016fdff0c0
        pc = 0x00000001000151ec  xdvi-bin`load_dvi_file + 240 at dvi-init.c:1822:24
      cpsr = 0x20001000

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
  * frame #0: 0x00000001000151ec xdvi-bin`load_dvi_file(load_fonts='\x01', errflag=0x000000016fdff1bc) at dvi-init.c:1822:24
    frame #1: 0x00000001000233b0 xdvi-bin`do_pages at events.c:6235:11
    frame #2: 0x00000001000567b4 xdvi-bin`run_dvi_file(filename="/Users/jhawk/src/xdvik-22.87.05/Work/texk/xdvik/t2a.dvi", data=0x00000001001762e0) at xdvi.c:3622:5
    frame #3: 0x000000010000198c xdvi-bin`main(argc=2, argv=0x000000016fdff640) at main.c:1311:6
    frame #4: 0x00000001002010f4 dyld`start + 520


--
jhawk at alum.mit.edu
John Hawkinson


More information about the tlbuild mailing list.