pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pdf-devel] Problems Compiling with PDF_FORCE_BIGNUMS (Unexpected Code G


From: Jeffrey Walton
Subject: [pdf-devel] Problems Compiling with PDF_FORCE_BIGNUMS (Unexpected Code Generation?)
Date: Mon, 1 Feb 2010 20:46:31 -0500

Hi All,

If PDF_FORCE_BIGNUMS is defined, the library's pdf_i64_t is used:

struct pdf_i64_s
{
  pdf_i32_t high;
  pdf_u32_t low;
};
typedef struct pdf_i64_s pdf_i64_t;

Running 'make check' causes a melt down in a number of modules (shown
below). I can control the way many of these functions crash by
reversing members of the struct:

struct pdf_i64_s
{
  pdf_u32_t low;
  pdf_i32_t high;
};

I believe the problem arises because, in the case of
PDF_FORCE_BIGNUMS, a struct is being pushed on the stack and accessed
incorrectly in the called function. I was able to duplicate the issue
in the attached struct-test.c. In the test file, I create a similar
struct initialized to 1 (ie, high=0, low=1). I then push on the stack
to Print:

$ ./struct-test.exe
high=-1079373640, low=134513824
high=1, low=0

It's been a few years since I took C in college, but I don't remember
this. If the problem is Ubuntu, I have two images ready: Debian and
Fedora. But they need to be restored from a backup disk.

$ gcc --version
gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
...
$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.20
Copyright 2009 Free Software Foundation, Inc.
...

Any ideas on how to work around the issue?

Jeff

93%: Checks: 660, Failures: 0, Errors: 44
base/time/pdf-time-new.c:55:E:pdf_time_new:pdf_time_new_001:0: (after
this point) Received signal 6 (Aborted)
base/time/pdf-time-set-from-u32.c:61:E:pdf_time_set_from_u32:pdf_time_set_from_u32_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-set-from-i64.c:115:E:pdf_time_set_from_i64:pdf_time_set_from_i64_002:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-add-cal-span.c:100:E:pdf_time_add_cal_span:pdf_time_add_cal_span_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-add-cal-span.c:174:E:pdf_time_add_cal_span:pdf_time_add_cal_span_002:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-sub-cal-span.c:97:E:pdf_time_sub_cal_span:pdf_time_sub_cal_span_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-add-span.c:60:E:pdf_time_add_span:pdf_time_add_span_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-sub-span.c:60:E:pdf_time_sub_span:pdf_time_sub_span_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-get-local-cal.c:69:E:pdf_time_get_local_cal:pdf_time_get_local_cal_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-get-utc-cal.c:67:E:pdf_time_get_utc_cal:pdf_time_get_utc_cal_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-get-utc-cal.c:113:E:pdf_time_get_utc_cal:pdf_time_get_utc_cal_002:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-set-local-offset.c:73:E:pdf_time_set_local_offset:pdf_time_set_local_offset_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-from-string.c:920:E:pdf_time_from_string:pdf_time_from_string_012:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-from-string.c:1006:E:pdf_time_from_string:pdf_time_from_string_013:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-span-new.c:42:E:pdf_time_span_new:pdf_time_span_new_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-dup.c:42:E:pdf_time_span_dup:pdf_time_span_dup_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-destroy.c:39:E:pdf_time_span_destroy:pdf_time_span_destroy_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-set.c:44:E:pdf_time_span_set:pdf_time_span_set_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-set-from-i32.c:43:E:pdf_time_span_set_from_i32:pdf_time_span_set_from_i32_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-negate.c:42:E:pdf_time_span_negate:pdf_time_span_negate_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-negate.c:78:E:pdf_time_span_negate:pdf_time_span_negate_002:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-add.c:41:E:pdf_time_span_add:pdf_time_span_add_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-add.c:91:E:pdf_time_span_add:pdf_time_span_add_002:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-cmp.c:38:E:pdf_time_span_cmp:pdf_time_span_cmp_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-cmp.c:72:E:pdf_time_span_cmp:pdf_time_span_cmp_002:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-cmp.c:106:E:pdf_time_span_cmp:pdf_time_span_cmp_003:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-copy.c:42:E:pdf_time_span_copy:pdf_time_span_copy_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-copy.c:79:E:pdf_time_span_copy:pdf_time_span_copy_002:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-diff.c:41:E:pdf_time_span_diff:pdf_time_span_diff_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-diff.c:88:E:pdf_time_span_diff:pdf_time_span_diff_002:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-span-to-secs.c:45:E:pdf_time_span_to_secs:pdf_time_span_to_secs_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-diff-cal.c:101:E:pdf_time_diff_cal:pdf_time_diff_cal_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-set-to-current-local-time.c:80:E:pdf_time_set_to_current_local_time:pdf_time_set_to_current_local_time_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-set-to-current-utc-time.c:69:E:pdf_time_set_to_current_utc_time:pdf_time_set_to_current_utc_time_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-diff.c:63:E:pdf_time_diff:pdf_time_diff_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/time/pdf-time-to-string.c:67:E:pdf_time_to_string:pdf_time_to_string_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-to-string.c:170:E:pdf_time_to_string:pdf_time_to_string_002:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-to-string.c:273:E:pdf_time_to_string:pdf_time_to_string_003:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-to-string.c:356:E:pdf_time_to_string:pdf_time_to_string_004:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-cal-span-cmp.c:62:E:pdf_time_cal_span_cmp:pdf_time_cal_span_cmp_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-cal-span-diff.c:70:E:pdf_time_cal_span_diff:pdf_time_cal_span_diff_001:0:
(after this point) Received signal 6 (Aborted)
base/time/pdf-time-add-cal-span-with-base.c:71:E:pdf_time_add_cal_span_with_base:pdf_time_add_cal_span_with_base_001:0:
(after this point) Received signal 6 (Aborted)
base/fsys/pdf-fsys-get-free-space.c:51:E:pdf_fsys_get_free_space:pdf_fsys_get_free_space_001:0:
(after this point) Received signal 11 (Segmentation fault)
base/fsys/pdf-fsys-get-free-space.c:82:E:pdf_fsys_get_free_space:pdf_fsys_get_free_space_002:0:
(after this point) Received signal 11 (Segmentation fault)
PASS: runtests.sh

Attachment: struct-test.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]