Page MenuHomeFreeBSD

daniel_octaforge.org (q66)
User

Projects

User does not belong to any projects.

User Details

User Since
Jun 3 2023, 9:00 PM (45 w, 5 d)

Recent Activity

Jun 29 2023

daniel_octaforge.org requested review of D40802: seq(1): print integers up to 2^mantissa as integers.
Jun 29 2023, 4:59 PM

Jun 4 2023

daniel_octaforge.org added a comment to D40415: sh(1): make smark a static variable instead of a local in main().

yes, you are right; i have changed it

Jun 4 2023, 3:07 PM
daniel_octaforge.org updated the diff for D40415: sh(1): make smark a static variable instead of a local in main().
Jun 4 2023, 3:06 PM

Jun 3 2023

daniel_octaforge.org added a comment to D40413: sh(1): initialize smark to zero in main().

proper patch: https://reviews.freebsd.org/D40415

Jun 3 2023, 10:45 PM
daniel_octaforge.org requested review of D40415: sh(1): make smark a static variable instead of a local in main().
Jun 3 2023, 10:44 PM
daniel_octaforge.org added a comment to D40413: sh(1): initialize smark to zero in main().

Now that I am thinking about it, this may not be a compiler issue - the C standard specifies that the value of non-volatile local variables modified between the setjmp call and the longjmp is unspecified. So making these static is actually the right way to go.

Jun 3 2023, 10:35 PM
daniel_octaforge.org added a comment to D40413: sh(1): initialize smark to zero in main().

This patch actually works around the problem:

Jun 3 2023, 10:24 PM
daniel_octaforge.org added a comment to D40413: sh(1): initialize smark to zero in main().

and indeed, further testing reveals that the issue does not get fixed by this change (nor by moving setstackmark), only hidden; any changes to smark contents are *not* visible after the jump, which in practice means we are most likely leaking memory, or worse

Jun 3 2023, 10:14 PM
daniel_octaforge.org added a comment to D40413: sh(1): initialize smark to zero in main().

@jilles I looked into this more and it seems that this is actually a miscompilation, possibly caused by the LLVM optimizer getting confused because of the long jumps.

Jun 3 2023, 9:46 PM