Skip to content

Segfault in binary_call_atomic #6

@maximk

Description

@maximk

To reproduce define a function:

(set notifGetSince
    (fn [since]
        (select {
from:notifications
where:
            (>= gen_time since)
})))

Try to call the function over IPC using (notifGetSince 0)
Rayforce crashes with the following log:

↪ core/binary.c:196:13: runtime error: member access within misaligned address 0x0000001a0106 for type 'struct obj_t', which requires 8 byte alignment
0x0000001a0106: note: pointer points here
<memory cannot be printed>
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior core/binary.c:196:13 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==91316==ERROR: AddressSanitizer: SEGV on unknown address 0x0000001a0108 (pc 0x60db0c0f95b1 bp 0x7fff8e4500d0 sp 0x7fff8e44fc20 T0)
==91316==The signal is caused by a READ memory access.
    #0 0x60db0c0f95b1 in binary_call_atomic /home/mk/lx/rayforce/core/binary.c:196:13
    #1 0x60db0c0fa913 in binary_call_atomic /home/mk/lx/rayforce/core/binary.c:249:16
    #2 0x60db0c0fbb0c in binary_call /home/mk/lx/rayforce/core/binary.c:322:16
    #3 0x60db0c0b0960 in eval /home/mk/lx/rayforce/core/eval.c:263:23
    #4 0x60db0c1c021d in select_apply_filters /home/mk/lx/rayforce/core/query.c:257:15
    #5 0x60db0c1c5747 in ray_select /home/mk/lx/rayforce/core/query.c:561:11
    #6 0x60db0c0f44e8 in unary_call /home/mk/lx/rayforce/core/unary.c:133:12
    #7 0x60db0c0af3ac in eval /home/mk/lx/rayforce/core/eval.c:213:23
    #8 0x60db0c0ac828 in call /home/mk/lx/rayforce/core/eval.c:136:15
    #9 0x60db0c0f3358 in lambda_call /home/mk/lx/rayforce/core/lambda.c:106:12
    #10 0x60db0c0b3cc4 in eval /home/mk/lx/rayforce/core/eval.c:341:27
    #11 0x60db0c0bd783 in eval_obj /home/mk/lx/rayforce/core/eval.c:527:37
    #12 0x60db0c016728 in process_request /home/mk/lx/rayforce/core/epoll.c:382:13
    #13 0x60db0c017963 in poll_run /home/mk/lx/rayforce/core/epoll.c:480:21
    #14 0x60db0c01c38f in runtime_run /home/mk/lx/rayforce/core/runtime.c:189:16
    #15 0x60db0c22ea78 in main /home/mk/lx/rayforce/app/main.c:51:10
    #16 0x731772a4ac87  (/usr/lib/libc.so.6+0x25c87) (BuildId: 32a656aa5562eece8c59a585f5eacd6cf5e2307b)
    #17 0x731772a4ad4b in __libc_start_main (/usr/lib/libc.so.6+0x25d4b) (BuildId: 32a656aa5562eece8c59a585f5eacd6cf5e2307b)
    #18 0x60db0beda334 in _start (/home/mk/lx/rayforce/rayforce+0x11a334) (BuildId: d96a343fe05822f47519872d6edba5ddd8c08962)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/mk/lx/rayforce/core/binary.c:196:13 in binary_call_atomic
==91316==ABORTING

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions