Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV: when using ~ #58

Open
ee7 opened this issue Jun 28, 2024 · 1 comment
Open

SIGSEGV: when using ~ #58

ee7 opened this issue Jun 28, 2024 · 1 comment
Labels
enhancement New feature or request P1 Priority 1 (lower is higher)

Comments

@ee7
Copy link
Contributor

ee7 commented Jun 28, 2024

With:

  • libcon4m 14604ad
  • x86_64
  • Linux 6.9.6
  • clang 17.0.6

The .c4m file:

x = 1
~x

produces the ASan output:

ERROR: AddressSanitizer: SEGV on unknown address 0x000000000004 (pc 0x5c3742234b28 bp 0x7ffd55a63d10 sp 0x7ffd55a63c70 T0)
The signal is caused by a READ memory access.
Hint: address points to the zero page.
SCARINESS: 10 (null-deref)
    #0 0x5c3742234b28 in gen_one_kid libcon4m/debug/../src/con4m/compiler/codegen.c:478:16
    #1 0x5c374222ff70 in gen_lock libcon4m/debug/../src/con4m/compiler/codegen.c:1783:5
    #2 0x5c374221fba4 in gen_one_node libcon4m/debug/../src/con4m/compiler/codegen.c:1901:9
    #3 0x5c37422241aa in gen_kids libcon4m/debug/../src/con4m/compiler/codegen.c:466:9
    #4 0x5c3742223c66 in gen_module libcon4m/debug/../src/con4m/compiler/codegen.c:787:5
    #5 0x5c374221f710 in gen_one_node libcon4m/debug/../src/con4m/compiler/codegen.c:1805:9
    #6 0x5c374221df59 in gen_module_code libcon4m/debug/../src/con4m/compiler/codegen.c:2110:5
    #7 0x5c374221b383 in c4m_internal_codegen libcon4m/debug/../src/con4m/compiler/codegen.c:2188:9
    #8 0x5c3742174cb6 in c4m_generate_code libcon4m/debug/../src/con4m/compiler/compile.c:1079:5
    #9 0x5c374200e63f in test_compiler libcon4m/debug/../src/tests/test.c:441:20

and e.g.:

~foo.bar = 1

produces:

ERROR: AddressSanitizer: SEGV on unknown address (pc 0x5cf9ab39cedb bp 0x7ffc0e587510 sp 0x7ffc0e587180 T0)
The signal is caused by a READ memory access.
Hint: this fault was caused by a dereference of a high value address.
SCARINESS: 20 (wild-addr-read)
    #0 0x5cf9ab39cedb in hatrack_dict_get_hash_value libcon4m/debug/../src/hatrack/hash/dict.c:682:14
    #1 0x5cf9ab39bb8c in hatrack_dict_get_mmm libcon4m/debug/../src/hatrack/hash/dict.c:205:10
    #2 0x5cf9ab39dadc in hatrack_dict_get libcon4m/debug/../src/hatrack/hash/dict.c:237:12
    #3 0x5cf9ab40a7d5 in c4m_vm_attr_lock libcon4m/debug/../src/con4m/attrstore.c:130:37
    #4 0x5cf9ab25f9f9 in c4m_vm_runloop libcon4m/debug/../src/con4m/vm.c:1127:21
    #5 0x5cf9ab24c4f9 in c4m_vmthread_run libcon4m/debug/../src/con4m/vm.c:1664:18
    #6 0x5cf9ab161919 in test_compiler libcon4m/debug/../src/tests/test.c:453:5
@viega
Copy link
Collaborator

viega commented Jun 30, 2024

I have not done all the work on attributes yet, including this. The two examples will, when I hook them up, give two different errors because the first is a variable not an attr, unless specified in a confspec.

Confspecs are not done yet either.

@viega viega added P1 Priority 1 (lower is higher) enhancement New feature or request labels Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1 Priority 1 (lower is higher)
Projects
None yet
Development

No branches or pull requests

2 participants